Commit c4c980d
Replace f2py Fortran module with pure Python for Elk PMAT.OUT reader
The elktools converter previously used an f2py-compiled Fortran module
to read binary PMAT.OUT files. This has been replaced with a pure Python
implementation that provides identical functionality without requiring
a Fortran compiler at build time.
Changes:
- Add python/triqs_dft_tools/converters/elktools/getpmatelk.py
Pure Python implementation to read Elk's Fortran unformatted binary files
- Update python/triqs_dft_tools/converters/elk.py
Modified import to use new Python module
- Update python/triqs_dft_tools/converters/elktools/__init__.py
Export getpmatelk function for direct import
- Remove python/triqs_dft_tools/converters/elktools/elkwrappers/
Deleted f2py build infrastructure and Fortran source
- Update CMakeLists.txt
Removed elkwrappers subdirectory from build
Benefits:
- Eliminates Fortran compiler dependency for this component
- Simplifies build process (no f2py compilation needed)
- Easier to maintain and debug
- Better error messages and handling
- Resolves historical f2py compatibility issues on Intel/macOS
Implementation details:
- Correctly handles Fortran direct-access unformatted binary files
- Properly reads column-major array ordering
- Maintains exact compatibility with original Fortran version
- All validation and error checking preserved
Testing:
- All 5 Elk converter tests pass
- Output matches reference files exactly (verified with h5diff)
- Tested with actual Elk PMAT.OUT files (41 states, 10 k-points)
Cc: @AlynJ1 parent 96fd210 commit c4c980d
File tree
7 files changed
+122
-110
lines changed- python/triqs_dft_tools/converters
- elktools
- elkwrappers
- test/python/elk/elk_transport_convert
7 files changed
+122
-110
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
149 | | - | |
150 | 148 | | |
151 | 149 | | |
152 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
787 | 787 | | |
788 | 788 | | |
789 | 789 | | |
790 | | - | |
791 | | - | |
| 790 | + | |
| 791 | + | |
792 | 792 | | |
793 | 793 | | |
794 | 794 | | |
| |||
802 | 802 | | |
803 | 803 | | |
804 | 804 | | |
805 | | - | |
806 | | - | |
807 | | - | |
808 | | - | |
| 805 | + | |
| 806 | + | |
809 | 807 | | |
810 | 808 | | |
811 | 809 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | | - | |
| 30 | + | |
30 | 31 | | |
Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 0 additions & 65 deletions
This file was deleted.
Lines changed: 116 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
Binary file not shown.
0 commit comments