Some additional tools are provided with the library.
pysd.tools.benchmarking
Simulation results can be stored as netCDF (.nc) files (see Storing simulation results on a file <./getting_started>
).
The :pypysd.tools.ncfiles.NCFile
allows loading netCDF files generated with PySD as an :pyxarray.Dataset
. When passing the argument parallel=True to the constructor, :pyxarray.DataArray
inside the Dataset will be loded as dask arrays, with chunks=-1.
Once the Dataset is loaded, a subset (or all) of the data_vars can be exported into:
- A :py
pandas.DataFrame
, using the :pypysd.tools.ncfiles.NCFile.to_df
method - A *.csv or *.tab files, using the the :py
pysd.tools.ncfiles.NCFile.to_text_file
method
Alternatively, to get further control of the chunking, users can load the :pyxarray.Dataset
using :pyxarray.open_dataset
and then use the :pypysd.tools.ncfiles.NCFile.ds_to_df
or :pypysd.tools.ncfiles.NCFile.df_to_text_file
static methods.
pysd.tools.ncfiles