Skip to content

Move data loaded into b_inputs.gms from .csv files to one inputs.h5inputs.gdx file #38

@patrickbrown4

Description

@patrickbrown4

Summary

b_inputs.gms is almost 7000 lines long, of which almost 2000 lines are just for reading in ~270 .csv files. .csv files are also much less storage-space-efficient than numeric formats like .h5. To support the long-term aspiration of a free software base (i.e. not GAMS) for ReEDS and make the ReEDS inputs more portable, we'd like to start moving away from .csv files for intermediate data handling in ReEDS. (We'd still use them for user-facing input files, but less for reading data into GAMS.)

Overview of proposed structure

1103 on the old repo tried something similar in terms of simplifying b_inputs.gms, but was never merged, and still relied on .csv files. Here, the idea is that instead of writing .csv files from the input_processing scripts, we create an inputs.h5 container, write the inputs to that, convert it to inputs.gdx, and then load it into b_inputs.gms in one line. A graphical outline of the proposed structure is below:

Image

Components

  • Create inputs.h5 container and the functions to write to it easily (start from the write_input_to_h5() function)
  • Create h5_to_gdx.py script to convert inputs.h5 to inputs.gdx and load inputs.gdx into b_inputs.gms
    • Compare gamspy, gams.transfer, and gdxpds to see which is fastest and use the winner for h5_to_gdx.py
  • Modify input_processing scripts to write to inputs.h5 instead of .csv files

Then we would start moving other data processing from b_inputs.py into upstream python scripts, but that will be tracked in a separate issue.

(moved from https://github.nrel.gov/ReEDS/ReEDS-2.0/issues/1947)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions