File: create_csv_files.py

package info (click to toggle)
gpaw 25.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 18,888 kB
  • sloc: python: 174,804; ansic: 17,564; cpp: 5,668; sh: 972; csh: 139; makefile: 45
file content (24 lines) | stat: -rw-r--r-- 848 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# creates: ugd.csv, uga.csv, pwd.csv, pwa.csv, m.csv
from gpaw.core import PWArray, PWDesc, UGArray, UGDesc
from gpaw.core.matrix import Matrix

for cls in [UGDesc,
            PWDesc,
            UGArray,
            PWArray,
            Matrix]:
    name = ''.join(x for x in cls.__name__ if x.isupper()).lower()
    mod = cls.__module__
    mod = mod.replace('.plane_waves', '')
    mod = mod.replace('.uniform_grid', '')
    print(name, mod)
    with open(f'{name}.csv', 'w') as fd:
        for name, meth in cls.__dict__.items():
            if name[0] != '_':
                try:
                    print(name)
                    doc = meth.__doc__.splitlines()[0]
                except AttributeError:
                    doc = '...'
                print(f':meth:`~{mod}.{cls.__name__}.{name}`, "{doc}"',
                      file=fd)