Cycles class
cycles.Cycles(path, simulation, output=dict[str, Output](), control=None, operations=None, soil_profile=None, curve_number=None, slope=None, weather=None, executable=None)
dataclass
Interface for executing one Cycles simulation and reading its files.
Provides methods to run simulations, read outputs, and inspect soil/weather/operation configurations. Automatically loads the control file upon initialization.
| Parameters: |
|
|---|
| Attributes: |
|
|---|
run(options, silence=False)
Run the Cycles executable for this simulation.
To use the run method, the executable attribute must be set to the absolute path of the Cycles binary. The
options string is passed directly to the command line when invoking Cycles, allowing you to specify any
command-line options supported by Cycles (e.g., -s for spin-up, etc.).
| Parameters: |
|
|---|
| Returns: |
|
|---|
read_output(output_types)
Read one or more output tables into memory.
| Parameters: |
|
|---|
read_operation_file()
Load operation records defined in the control file.
read_soil_file()
Load soil profile layers and metadata from the configured soil file.
read_weather_file(*, start_year=-9999, end_year=9999, subdaily=False)
Read weather forcing data for the configured weather file.
| Parameters: |
|
|---|
generate_reinit_file(doy, *, reinit_name=None)
Generate a reinitialization file from model output.
| Parameters: |
|
|---|
plot_yield(*, ax=None, fontsize=None)
Plot grain and forage yields from harvest output.
plot_operations(*, axs=None, fontsize=None)
Plot operation timelines grouped by rotation year.
| Parameters: |
|
|---|
| Returns: |
|
|---|