dwind.cli#
Please see the [CLI documentation](../cli) for more details on using the CLI. Below is a summary of the available functionality best accessed through the CLI.
Modules
Enables running dwind as a CLI tool, the primary interface for working with dwind. |
|
Enables running dwind as a CLI tool, the primary interface for working with dwind. |
|
Provides shared utilities among the CLI subcommand modules. |
Run#
Debug#
Enables running dwind as a CLI tool, the primary interface for working with dwind.
Functions
|
Print a table summary of the provided job id(s) and their final run status. |
|
Compare the agent "gid" field between the chunked agents and results files, and save the missing chunk index and agent gid as a 2-column CSV file. |
|
Compare the agent "gid" field between the chunked agents and results files, and save the missing chunk index and agent gid as a 1-column CSV file. |
- dwind.cli.debug.job_summary(jobs, chunks=None)[source]#
Print a table summary of the provided job id(s) and their final run status.
Collect#
Enables running dwind as a CLI tool, the primary interface for working with dwind.
Functions
|
Deletes the temporary agent chunk files generated at runtime. |
|
Deletes the chunked results files generated at runtime. |
|
Combine the results of a multi-job run based on the run's TOML configuration. |
- dwind.cli.collect.cleanup_agents(dir_out)[source]#
Deletes the temporary agent chunk files generated at runtime.
- Parameters:
dir_out (str) – The base output directory, which should be the same as that passed to the run command.
Utilities#
Provides shared utilities among the CLI subcommand modules.
Functions
|
Deletes the temporary agent chunk files, typically in |
|
Load the agent file based on a filename or the location and sector to a Pandas DataFrame, and return the data frame. |
|
Prints a nicely formatted pandas DataFrame to the console. |
|
Typer helper to validate the year input. |
- dwind.cli.utils.cleanup_chunks(dir_out, which)[source]#
Deletes the temporary agent chunk files, typically in
/path/to/analysis_scenario/chunk_files/agents
, and of the formagents_{ix}.pqt
.- Parameters:
dir_out (str | None) – The same
dir_out
passed to the run command. Thechunk_files/agent_chunks
will be automatically added to the path.which (str) – One of “agents” or “results” to indicate which chunked files should be deleted.
- Return type:
None
- dwind.cli.utils.load_agents(file_name=None, location=None, sector=None, model_config=None, *, prepare=False)[source]#
Load the agent file based on a filename or the location and sector to a Pandas DataFrame, and return the data frame.
- Parameters:
file_name (Path | None, optional) – Name of the agent file, if not auto-generating from the
location
andsector
inputs. Defaults to None.location (str | None, optional) – The name of the location or grouping, such as “colorado_larimer” or “priority1”. Defaults to None.
sector (str | None, optional) – The name of the section. Must be one of “btm” or “fom”. Defaults to None.
model_config (
str
|Path
|None
) – (str | Path, optional): The file name and path for the overarching model configuration containing SQL and file references, scenario configurations, and etc. Defaults to None.prepare (bool, optional) – True if loading pre-chunked and prepared agent data, which should bypass the standard column checking for additional joins, by default False.
- Returns:
The agent DataFrame.
- Return type:
pd.DataFrame
- dwind.cli.utils.print_status_table(summary, id_col='job', chunk_col=None, status_col='status')[source]#
Prints a nicely formatted pandas DataFrame to the console.
- Parameters:
summary (pd.DataFrame) – Summary DataFrame of the job (
id_col
), chunk (chunk_col
), and status (status_col
).id_col (str) – Name of the job ID column.
chunk_col (str) – Name of the chunk index column.
status_col (str) – Name of the final job status column.
- Return type:
None
- dwind.cli.utils.year_callback(ctx, param, value)[source]#
Typer helper to validate the year input.
- Parameters:
ctx (typer.Context) – The Typer context.
param (typer.CallbackParam) – The Typer parameter.
value (int) – User input for the analysis year basis, must be one of 2022, 2024, or 2025.
- Returns:
The input
value
, if it is a valid input.- Return type:
int
- Raises:
typer.BadParameter – Raised if the input is not one of 2022, 2024, or 2025.