pywrdrb.utils#

Utility functions for working with Pywr-DRB data and simulation outputs.

pywrdrb.utils.hdf5#

Contains functions for working with HDF5 files in pywrdrb context.

Overview: Simple functions for reading and working with HDF5 files. Some functions are deisgned for pywrdrb output files while others are for ensemble input files.

Technical Notes: - In the future, we should consider improving this to be a more standard class, but for now these are simple functions.

Links: - NA

Change Log: TJA, 2025-05-06, Add docs.

pywrdrb.utils.hdf5.get_hdf5_realization_numbers

Checks the contents of hdf5 and return a list of the realization IDs.

pywrdrb.utils.hdf5.extract_realization_from_hdf5

Pull a single inflow realization from an HDF5 file of inflows.

pywrdrb.utils.hdf5.combine_batched_hdf5_outputs

Aggregate multiple pywrdrb output (hdf5) files into a single HDF5 file.

pywrdrb.utils.hdf5.get_n_scenarios_from_pywrdrb_output_file

Determine the number of scenarios (n_scenarios) from datasets in an HDF5 file.

pywrdrb.utils.timeseries#

Functions for working directly with pd.Series timeseries.

Overview: These functions are broadly applicable across the pywrdrb codebase.

Technical Notes: - NA

Links: - NA

Change Log: TJA, 2025-05-05, Add docs.

pywrdrb.utils.timeseries.subset_timeseries

Take a subset of pd.Series timeseries data between start_date and end_date.

pywrdrb.utils.timeseries.get_rollmean_timeseries

Calculates the rolling mean of a timeseries for a given window size.