Generate a CompoundSweepParameter from variant axes.
describe
grid.GridSpec.describe()
Human-readable overview of the grid and its external-data inventory.
Shows geometry, variant axes, and each external file’s on-disk status — handy for confirming what a preprocessed grid actually provides without writing any code. See :meth:to_summary_dict for the structured form.
file_mappings_for
grid.GridSpec.file_mappings_for(**variant_values)
Resolve file mappings with specific variant values.
Static path files pass through unchanged. template_path files are resolved using the provided values (falling back to defaults for unspecified axes).
Parameters
Name
Type
Description
Default
**variant_values
str
Axis name → value overrides (e.g., scenario="ssp370").
{}
Returns
Name
Type
Description
dict[str, Path]
Dict mapping josh external names to absolute file Paths.
Raises
Name
Type
Description
ValueError
If an axis name or value is invalid.
from_yaml
grid.GridSpec.from_yaml(path)
Load a GridSpec from a YAML file.
Parameters
Name
Type
Description
Default
path
str | Path
Path to a grid.yaml file.
required
Returns
Name
Type
Description
GridSpec
GridSpec with paths resolved relative to the YAML file’s directory.
Preprocess a CSV point data file using this grid’s geometry.
Parameters
Name
Type
Description
Default
cli
JoshCLI
JoshCLI instance.
required
josh_name
str
Name the josh model uses for this external data.
required
data_file
str | Path
Path to the input CSV file.
required
variable
str
Column name to extract.
required
units
str
Data units.
required
timestep
int
Simulation timestep this data maps to.
required
crs
str | None
Coordinate reference system.
None
parallel
bool
Enable parallel processing.
False
amend
bool
Append to existing .jshd file.
False
subdirectory
str | None
Optional subdirectory within output_dir.
None
variant
dict[str, str] | None
Variant values to resolve template_path (e.g., {"scenario": "ssp370"}). When provided, the output path is resolved from the file’s template_path and _register_file() is skipped.
None
compress
bool
If True, write XZ-compressed .jshdz output instead of plain .jshd. See :meth:preprocess_geotiff for full semantics and template_path interaction.
Preprocess a CSV point data file on a remote target using this grid’s geometry.
Batch-dispatch counterpart of :meth:preprocess_csv; same output path computation and file registration, dispatched via :meth:JoshCLI.preprocess_batch instead of run locally.
Parameters
Name
Type
Description
Default
cli
JoshCLI
JoshCLI instance.
required
target
str
Target profile name (required).
required
josh_name
str
Name the josh model uses for this external data.
required
data_file
str | Path
Path to the input CSV file.
required
variable
str
Column name to extract.
required
units
str
Data units.
required
timestep
int
Simulation timestep this data maps to.
required
crs
str | None
Coordinate reference system.
None
parallel
bool
Enable parallel processing.
False
amend
bool
Append to existing .jshd file.
False
subdirectory
str | None
Optional subdirectory within output_dir.
None
variant
dict[str, str] | None
Variant values to resolve template_path (e.g., {"scenario": "ssp370"}). When provided, the output path is resolved from the file’s template_path and _register_file() is skipped.
None
compress
bool
If True, write XZ-compressed .jshdz output instead of plain .jshd. See :meth:preprocess_geotiff for full semantics and template_path interaction.
False
poll_interval
int | None
Polling interval in seconds (optional).
None
timeout
int | None
Maximum seconds to wait for completion (optional).
Preprocess a GeoTIFF file using this grid’s geometry.
Parameters
Name
Type
Description
Default
cli
JoshCLI
JoshCLI instance.
required
josh_name
str
Name the josh model uses for this external data.
required
data_file
str | Path
Path to the input GeoTIFF.
required
band
int
Band index (0-based).
required
units
str
Data units.
required
timestep
int
Simulation timestep this data maps to.
required
crs
str | None
Coordinate reference system (if not embedded in file).
None
parallel
bool
Enable parallel processing.
False
amend
bool
Append to existing .jshd file.
False
subdirectory
str | None
Optional subdirectory within output_dir.
None
variant
dict[str, str] | None
Variant values to resolve template_path (e.g., {"scenario": "ssp370"}). When provided, the output path is resolved from the file’s template_path and _register_file() is skipped.
None
compress
bool
If True, write XZ-compressed .jshdz output instead of plain .jshd. The file is read transparently at simulation time via josh’s MultiFormatExternalGetter, typically 5-20x smaller on geospatial rasters. Incompatible with template_path (raises ValueError) — template_path users should put .jshdz directly into the template string instead. Note: amend=True with compress=True may not be supported by the underlying JAR; the JAR will report any incompatibility at run time.
Preprocess a GeoTIFF file on a remote target using this grid’s geometry.
Batch-dispatch counterpart of :meth:preprocess_geotiff; same output path computation, script sizing, and file registration, dispatched via :meth:JoshCLI.preprocess_batch instead of run locally.
Parameters
Name
Type
Description
Default
cli
JoshCLI
JoshCLI instance.
required
target
str
Target profile name (required).
required
josh_name
str
Name the josh model uses for this external data.
required
data_file
str | Path
Path to the input GeoTIFF.
required
band
int
Band index (0-based).
required
units
str
Data units.
required
timestep
int
Simulation timestep this data maps to.
required
crs
str | None
Coordinate reference system (if not embedded in file).
None
parallel
bool
Enable parallel processing.
False
amend
bool
Append to existing .jshd file.
False
subdirectory
str | None
Optional subdirectory within output_dir.
None
variant
dict[str, str] | None
Variant values to resolve template_path (e.g., {"scenario": "ssp370"}). When provided, the output path is resolved from the file’s template_path and _register_file() is skipped.
None
compress
bool
If True, write XZ-compressed .jshdz output instead of plain .jshd. See :meth:preprocess_geotiff for full semantics and template_path interaction.
False
poll_interval
int | None
Polling interval in seconds (optional).
None
timeout
int | None
Maximum seconds to wait for completion (optional).
Preprocess a NetCDF file using this grid’s geometry.
Parameters
Name
Type
Description
Default
cli
JoshCLI
JoshCLI instance.
required
josh_name
str
Name the josh model uses for this external data.
required
data_file
str | Path
Path to the input NetCDF file.
required
variable
str
NetCDF variable name to extract.
required
units
str
Data units.
required
x_coord
str
Name of the X/longitude dimension.
'lon'
y_coord
str
Name of the Y/latitude dimension.
'lat'
time_coord
str | None
Name of the time dimension. Set to None for a source with no time dimension (emits --no-time-dim).
'time'
timestep
int | None
Optional specific time slice to extract.
None
time_type
str | None
Temporal axis type: "count" or "ISO".
None
time_start
str | int | float | None
First count coordinate or ISO date.
None
time_unit
str | None
Unit for a count axis.
None
time_count
int | None
Number of declared temporal coordinates.
None
time_increment
int | float | None
Increment between count coordinates.
None
time_interval
str | None
ISO-8601 period between ISO dates.
None
time_instant
str | int | float | None
Single count coordinate or ISO date for one output slice.
None
time
TimeAxis | None
Per-resource temporal-axis override. When omitted, this GridSpec’s time axis supplies omitted temporal options.
None
crs
str | None
Coordinate reference system.
None
parallel
bool
Enable parallel processing.
False
amend
bool
Append to existing .jshd file.
False
subdirectory
str | None
Optional subdirectory within output_dir.
None
variant
dict[str, str] | None
Variant values to resolve template_path (e.g., {"scenario": "ssp370"}). When provided, the output path is resolved from the file’s template_path and _register_file() is skipped.
None
compress
bool
If True, write XZ-compressed .jshdz output instead of plain .jshd. See :meth:preprocess_geotiff for full semantics and template_path interaction.
Preprocess a NetCDF file on a remote target using this grid’s geometry.
Batch-dispatch counterpart of :meth:preprocess_netcdf; same declared temporal axis resolution, stub-script sizing, and file registration, dispatched via :meth:JoshCLI.preprocess_batch instead of run locally.
Parameters
Name
Type
Description
Default
cli
JoshCLI
JoshCLI instance.
required
target
str
Target profile name (required).
required
josh_name
str
Name the josh model uses for this external data.
required
data_file
str | Path
Path to the input NetCDF file.
required
variable
str
NetCDF variable name to extract.
required
units
str
Data units.
required
x_coord
str
Name of the X/longitude dimension.
'lon'
y_coord
str
Name of the Y/latitude dimension.
'lat'
time_coord
str | None
Name of the time dimension. Set to None for a source with no time dimension (emits --no-time-dim).
'time'
timestep
int | None
Optional specific time slice to extract.
None
time_type
str | None
Temporal axis type: "count" or "ISO".
None
time_start
str | int | float | None
First count coordinate or ISO date.
None
time_unit
str | None
Unit for a count axis.
None
time_count
int | None
Number of declared temporal coordinates.
None
time_increment
int | float | None
Increment between count coordinates.
None
time_interval
str | None
ISO-8601 period between ISO dates.
None
time_instant
str | int | float | None
Single count coordinate or ISO date for one output slice.
None
time
TimeAxis | None
Per-resource temporal-axis override. When omitted, this GridSpec’s time axis supplies omitted temporal options.
None
crs
str | None
Coordinate reference system.
None
parallel
bool
Enable parallel processing.
False
amend
bool
Append to existing .jshd file.
False
subdirectory
str | None
Optional subdirectory within output_dir.
None
variant
dict[str, str] | None
Variant values to resolve template_path (e.g., {"scenario": "ssp370"}). When provided, the output path is resolved from the file’s template_path and _register_file() is skipped.
None
compress
bool
If True, write XZ-compressed .jshdz output instead of plain .jshd. See :meth:preprocess_geotiff for full semantics and template_path interaction.
False
poll_interval
int | None
Polling interval in seconds (optional).
None
timeout
int | None
Maximum seconds to wait for completion (optional).
None
Returns
Name
Type
Description
CLIResult
CLIResult from the preprocessing command.
save
grid.GridSpec.save(path=None)
Save the GridSpec to a YAML file.
Parameters
Name
Type
Description
Default
path
str | Path | None
Output path. Defaults to output_dir / "grid.yaml".
None
Returns
Name
Type
Description
Path
Path to the written file.
to_summary_dict
grid.GridSpec.to_summary_dict()
Structured overview of the grid for display/inspection.
Captures geometry, variant axes (values + default), and the external-data inventory with each file’s resolved path(s) and whether they exist on disk. Templated files are expanded across the variant values they reference, so you can see exactly which preprocessed .jshd files are available. Pure read-only (only stats files for existence).
Returns
Name
Type
Description
dict[str, Any]
A JSON-serializable dict (see :meth:describe for a human view).
Generate a CompoundSweepParameter from variant axes.
Finds all template_path files referencing the given axis/axes, builds one FileSweepParameter per file, and wraps them in a CompoundSweepParameter so all files switch together.
Parameters
Name
Type
Description
Default
axis
str | None
Single axis name (common case).
None
axes
list[str] | None
List of axis names for multi-axis cross-product.
None
values
list[str] | None
Subset of values to sweep (single-axis only).
None
Returns
Name
Type
Description
CompoundSweepParameter
A CompoundSweepParameter ready for
CompoundSweepParameter
SweepConfig.compound_parameters.
Raises
Name
Type
Description
ValueError
If axis/axes are invalid, both provided, or values used with multi-axis.