Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PpCalculation: add support for retrieving and parsing multiple files #533

Merged
merged 1 commit into from
Jun 30, 2020

Commits on Jun 27, 2020

  1. 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.
    sphuber committed Jun 27, 2020
    Configuration menu
    Copy the full SHA
    efd41ad View commit details
    Browse the repository at this point in the history