autosim.cli#

Command-line interface for generating and inspecting AutoSim datasets.

build_simulator(simulator_cfg)[source]#

Instantiate and validate a spatiotemporal simulator from Hydra config.

Parameters:

simulator_cfg (Any)

Return type:

SpatioTemporalSimulator

generate_dataset_splits(sim, n_train, n_valid, n_test, base_seed=None, ensure_exact_n=False)[source]#

Generate train/valid/test splits from a simulator.

Parameters:
Return type:

dict[str, dict[str, Any]]

save_dataset_splits(splits, output_dir, overwrite=False)[source]#

Persist split dictionaries to output_dir/{split}/data.pt.

Parameters:
Return type:

None

save_resolved_config(cfg, output_dir)[source]#

Persist the fully resolved Hydra config next to generated datasets.

Parameters:
Return type:

None

save_example_videos(splits, output_dir, visualize_cfg, channel_names=None)[source]#

Optionally render example videos for selected batch indices.

Expected data shape is [batch, time, x, y, channels].

Parameters:
Return type:

None

compute_normalization_stats(split_payload, core_field_names=None, constant_field_names=None, shared_core_field_groups=None)[source]#

Compute normalization statistics for one split payload.

Parameters:
Return type:

dict[str, Any]

save_normalization_stats(stats_payload, output_path, sig_figs=4)[source]#

Persist normalization statistics as YAML.

Parameters:
Return type:

None

generate_normalization_stats_yaml(dataset_dir, split='train', output_path=None, core_field_names=None, sig_figs=4)[source]#

Generate normalization-stats YAML from an existing dataset directory.

Parameters:
  • dataset_dir (Path)

  • split (str)

  • output_path (Path | None)

  • core_field_names (list[str] | None)

  • sig_figs (int)

Return type:

Path

get_per_strata_counts(n_train, n_valid, n_test, n_strata)[source]#

Get per-strata split sizes, requiring exact divisibility.

Parameters:
Return type:

tuple[int, int, int]

combine_stratified_splits(ordered_strata_splits)[source]#

Combine per-strata splits preserving strata order in batch dimension.

Parameters:

ordered_strata_splits (list[dict[str, dict[str, Any]]])

Return type:

dict[str, dict[str, Any]]

list_simulators()[source]#

Return available simulator config names from the package config group.

Return type:

list[str]

main()[source]#

Dispatch tiny autosim subcommands.

  • autosim list prints simulator config names.

  • autosim stats writes normalization stats YAML for an existing dataset.

  • autosim (or any Hydra overrides) runs data generation.

Return type:

None