model.runtime.runners.base_runnerΒΆ

Shared simulation-runner infrastructure for ADELM workflows.

Module ContentsΒΆ

ClassesΒΆ

BaseRunner

Shared simulation-runner infrastructure that is agnostic to the concrete data-loading strategy.

DataΒΆ

APIΒΆ

class model.runtime.runners.base_runner.BaseRunner(config, model, site_ids=None, time_values=None, data=None)ΒΆ

Bases: object

Shared simulation-runner infrastructure that is agnostic to the concrete data-loading strategy.

Initialization

runtime_output_dir()ΒΆ
nn_training_config()ΒΆ
spinup_config()ΒΆ
classmethod from_config(config_path=DEFAULT_CONFIG_PATH, config_overrides=None)ΒΆ
property deviceΒΆ
get_initial_states()ΒΆ
set_initial_states(initial_states)ΒΆ
to(device)ΒΆ
initialize_nn_from_path(weights_path, strict=True)ΒΆ
initialize_nn_from_config()ΒΆ
refresh_nn_parameter_values()ΒΆ
reset_runtime_summary()ΒΆ
append_runtime_summary_section(title, lines)ΒΆ
save_parameter_value_summary(title, include_fixed=False, echo=False)ΒΆ
print_parameterization_summary()ΒΆ
append_evaluation_summary(result, stage='Evaluation')ΒΆ
append_forward_run_summary(outputs, final_states, stage='Forward run')ΒΆ
save_full_inference_netcdf(outputs, final_states=None, filename='site_simulation.nc')ΒΆ

Write model outputs, parameters, and final states to a NetCDF file.

Packs time-varying outputs (fluxes, diagnostics) along entity and time coordinates, appends static parameters and end-of-run prognostic states as non-time-varying variables, and writes the file under the runtime output directory.

Parameters

outputs : dict Time-varying model outputs to store. final_states : dict, optional End-of-run prognostic states to append as static snapshots. filename : str Output file name within the runtime output directory.

Returns

str or None Path to the written file, or None if no output directory is set.

bind_static_inputs(attris=None, fcover=None, params=None, n_entities=None)ΒΆ

Bind static inputs to the model and finalize static parameterization.

Moves data to the runner device, then delegates to :meth:ADELMSystem.bind_static_inputs.

initialize_states(n_entities)ΒΆ

Initialize default prognostic states for a set of entities.

run_forward(drivers, initial_states=None, output_keys=None, track_gradients=False, show_progress=False, progress_desc='Forward')ΒΆ

Run the assembled ADELM system on [entity, inputs] drivers.

run_with_spinup(drivers=None, initial_states=None, output_keys=None, track_gradients=False, show_progress=False, progress_desc='Forward')ΒΆ
decode_time_values(units, calendar='standard')ΒΆ
make_cross_validation(site_ids=None, time_values=None)ΒΆ
model.runtime.runners.base_runner.__all__ΒΆ

[β€˜BaseRunner’]