Configuration Reference
This page lists every settable field in the TOML configuration file. Fields that accept a sub-table are described in their own section below.
All fields are optional — each has a default value. The minimum useful config only needs [chemistry].
Top-level (StellarConfig)
StellarConfig
pydantic-model
Bases: BaseModel
Top-level configuration for stellar evolution
Fields:
-
model(ModelConfig) -
chemistry(ChemistryConfig) -
grid(GridConfig) -
parameters(ParameterConfig) -
plot(PlotConfig) -
output_dir(Optional[str | Path])
Validators:
-
validate_all
lane_emden
cached
property
The Lane-Emden grid for this config, built once on first access.
Pure function of model.mass, chemistry.mu and the grid
overrides, so it is (re)built lazily after override()/reload rather
than eagerly during validation. massunit is excluded from the grid
kwargs (it is a post-grid scaling applied when emitting cards).
override
Return a new, fully re-validated config with section fields changed.
Intended for a "load a template, then tweak it" workflow::
cfg = load_config("template.toml")
cfg = cfg.override(
model={"mass": 5.0, "metallicity": 0.001},
chemistry={"preset": "sollo09"},
)
Each keyword names a config section (model, chemistry,
grid, parameters, plot) and maps to a dict of field
overrides that are shallow-merged over the existing values. Scalar
top-level fields (e.g. output_dir) may be passed directly.
The whole validation pipeline re-runs on the merged data, so the Lane-Emden grid is rebuilt and the composition re-scaled. The original config is left untouched; a new instance is returned.
Notes
presetandcustomare mutually exclusive: supplying one clears the other.- Changing
preset/custom/nameresetsburngen(unless you override it explicitly) so it is regenerated for the new composition.
to_toml
Serialise this config back to TOML, round-tripping load_config.
Only input-level fields are emitted (e.g. mass, preset,
scale_to_Z, initial_Y, parameter overrides). Derived values --
the resolved composition, the computed plot parameters, the Lane-Emden
grid -- are not written; they are reproduced when the file is reloaded.
Parameters
path: If given, the TOML is also written to this path.
Returns
str The TOML document text.
[model] — Star model
ModelConfig
pydantic-model
Bases: BaseModel
Basic (higher) star configuration.
Example: ``` [model] mass: 4 metallicity: 0.014 rotation: 0.9 force_hstat: true
Fields:
-
mass(float) -
metallicity(float) -
rotation(float) -
rotation_version(int) -
force_hstat(bool) -
u(float)
Validators:
-
validate_mass→mass
rotation
pydantic-field
Rotation rate parameter. >1e6: we use value directly. 0 < val < 1e6: scale with max rotation. val<0: use Z=0 fits.
rotation_version
pydantic-field
Algorithm to determine spin. 1: Heger 1998, 2: Woosley & Heger 2012
[chemistry] — Composition and network
ChemistryConfig
pydantic-model
Bases: BaseModel
Chemistry (network and materials) config
Example:
Fields:
-
name(Literal['solcomp', 'zero', 'mycomp']) -
preset(Optional[str]) -
custom(Optional[dict[str, float]]) -
scale_to_Z(bool) -
initial_Y(Optional[float]) -
num(Literal[1]) -
isenet(bool) -
coprocess(bool) -
use_burn(bool) -
burngen(Optional[str]) -
adaptive(bool) -
network_z_max(int)
Validators:
preset
pydantic-field
Name of preset composition (exclusive with custom). Requires $KEPLER_DATA to be set.
custom
pydantic-field
Custom ion abundances (exclusive with preset)
scale_to_Z
pydantic-field
Whether to scale the composition to the given metallicity. Setting with a preset will scale all mass fractions to this metallicity
initial_Y
pydantic-field
Optional target initial helium mass fraction Y. When set, the composition is scaled to this Y by drawing from (or adding to) hydrogen while preserving metals, instead of using the raw preset value. Independent of and applied after scale_to_Z.
coprocess
pydantic-field
Whether to enable BURN coprocessing (mapburn only). Default OFF because use_burn is generally on.
burngen
pydantic-field
BURN generator filepath. Automatically set to name of preset if preset is used.
[grid] — Lane-Emden grid overrides
GridConfig
pydantic-model
[parameters] — Runtime parameter overrides
ParameterConfig
pydantic-model
Bases: BaseModel
Controls for Kepler's adjustable runtime parameters.
Example
[parameters]
dtmax: 3e12 # 10^5yrs in seconds
iwinsize: 10240750 # XXXX by YYYY
tnmin: 1e4 # minimum temperature for which rezoning is considered
dnmin: 1e-4 # minimum density for which rezoning is considered
Config:
extra:allow
Fields:
-
parameters(dict[str, float | int | str])
[plot] — Plotting settings
PlotConfig
pydantic-model
Bases: BaseModel
Mongo plotting configuration.
Example: ``` [plot] window_width: 1024 window_height: 720 plot1: plot2:
Fields:
-
window_width(int) -
window_height(int) -
interval(int) -
xaxis(int) -
plot1(PlotMode) -
plot2(Optional[PlotMode]) -
plot3(Optional[PlotMode]) -
plot4(Optional[PlotMode]) -
isotopes(Optional[list[str]])