-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PpCalculation
: add support for retrieving and parsing multiple files
The implementation of the `PpCalculation` and `PpParser` assumed that the code would always only produce on output file with pre-processed data and one output file with the data formatted in a custom plot format. However, for certain input parameter combinations, such as `INPUTPP.plot_num = 7` where more than a single band is requested, a pair of outputfiles is produced for each band. The filename of the data file has `INPUTPP.filplot` as a prefix, with some kind of suffix to distinguish it from the others. The corresponding plot file will use that filename as a prefix with the `PLOT.fileout` value as a suffix. For example, for the inputs: INPUTPP filplot = 'aiida.filplot' PLOT fileout = 'aiida.fileout' The data files will be named `aiida.filplot_K1_B1` and the plot files are formatted as `aiida.filplot_K1_B1aiida.fileout`. To support this use case, the `PpCalculation` is updated to not just retrieve a single file, but add a directive to the `retrieve_files` or `retrieve_temporary_list` that contains the corresponding globbing pattern. The `PpParser` then simply loops over the content of the retrieved (temporary) folder and parses each file whose filename matches the pattern described above. We assume that if there are more than one file, they all have the exact same format and so can be parsed with the same logic. Since now there are potentially more than one parsed output `ArrayData` node, the `output_data` port, which is not a namespace can not be used. To keep backwards compatibility, we add the `output_data_multiple` namespace, which is used if more than one output plot file is parsed.
- Loading branch information
Showing
8 changed files
with
244 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
tests/parsers/fixtures/pp/default_3d_multiple/aiida.filplot_K001_B001aiida.fileout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Cubefile created from PWScf calculation | ||
k_point 1, band 1 | ||
1 0.000000 0.000000 0.000000 | ||
1 0.000000 0.141231 0.141231 | ||
1 0.141231 0.000000 0.141231 | ||
1 0.141231 0.141231 0.000000 | ||
14 14.000000 10.168616 10.168616 10.168616 | ||
0.16567E-01 0.14498E-01 0.96968E-02 |
8 changes: 8 additions & 0 deletions
8
tests/parsers/fixtures/pp/default_3d_multiple/aiida.filplot_K001_B002aiida.fileout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Cubefile created from PWScf calculation | ||
k_point 1, band 2 | ||
1 0.000000 0.000000 0.000000 | ||
1 0.000000 0.141231 0.141231 | ||
1 0.141231 0.000000 0.141231 | ||
1 0.141231 0.141231 0.000000 | ||
14 14.000000 2.542154 2.542154 2.542154 | ||
0.22404E-01 0.19330E-01 0.12458E-01 |
Oops, something went wrong.