Tip
Need help? Please let us know in the SUEWS Community.
Please report issues with the manual on GitHub Issues (or use Report Issue for This Page for page-specific feedback).
Please cite SUEWS with proper information from our Zenodo page.
6.2.1.3. supy.save_supy#
- supy.save_supy(df_output: DataFrame, df_state_final: DataFrame, freq_s: int = 3600, site: str = '', path_dir_save: str = PosixPath('.'), path_runcontrol: str | None = None, save_tstep=False, logging_level=50, output_level=1, debug=False, output_config=None, output_format='txt') list[source]#
Save SuPy run results to files.
Deprecated since version 2025.11.20: This function is deprecated and will be removed in a future release. Please migrate to
SUEWSSimulation.save.- Parameters:
df_output (pandas.DataFrame) – DataFrame of output
df_state_final (pandas.DataFrame) – DataFrame of final model states
freq_s (int, optional) – Output frequency in seconds (the default is 3600, which indicates hourly output)
site (str, optional) – Site identifier (the default is ‘’, which indicates site identifier will be left empty)
path_dir_save (str, optional) – Path to directory to saving the files (the default is Path(‘.’), which indicates the current working directory)
path_runcontrol (str, optional) – Path to SUEWS RunControl.nml, which, if set, will be preferably used to derive
freq_s, Site Configuration andpath_dir_save. (the default is None, which is unset)save_tstep (bool, optional) – whether to save results in temporal resolution as in simulation (which may result very large files and slow progress), by default False.
logging_level (logging level) – one of these values [50 (CRITICAL), 40 (ERROR), 30 (WARNING), 20 (INFO), 10 (DEBUG)]. A lower value informs SuPy for more verbose logging info.
output_level (integer, optional) – option to determine selection of output variables, by default 1. Notes: 0 for all but snow-related; 1 for all; 2 for a minimal set without land cover specific information.
debug (bool, optional) – whether to enable debug mode (e.g., writing out in serial mode, and other debug uses), by default False.
output_config (OutputConfig, optional) – Output configuration object specifying format, frequency, and groups to save. If provided, overrides freq_s parameter.
- Returns:
a list of paths of saved files
- Return type:
See also
supy.suews_sim.SUEWSSimulation.saveModern interface for saving results (recommended)
Examples
save results of a supy run to the current working directory with default settings
>>> list_path_save = supy.save_supy(df_output, df_state_final)
save results according to settings in RunControl.nml
>>> list_path_save = supy.save_supy( ... df_output, df_state_final, path_runcontrol="path/to/RunControl.nml" ... )
save results of a supy run at resampling frequency of 1800 s (i.e., half-hourly results) under the site code
Testto a customised location ‘path/to/some/dir’
>>> list_path_save = supy.save_supy( ... df_output, ... df_state_final, ... freq_s=1800, ... site="Test", ... path_dir_save="path/to/some/dir", ... )