Web forms (lazuli_exo.forms)

Web-form strings -> validated lazuli_exo.simulate() parameters.

Shared by every UI (local Flask demo, the Django simulators site) so that defaults, ranges, clamping and error messages live in one place. A UI passes its raw form/query mapping of strings to parse(); it gets typed values, fatal errors (the run cannot proceed) and non-fatal warnings (a value was replaced or clamped and the run proceeds).

Blank optional fields carry meaning: mu blank -> equilibrium-chemistry mu; log_p_cloud blank -> no deck; log_a_haze blank -> no haze. band is any sncosmo bandpass name or one of the J/H/Ks/V aliases; it is validated at simulate time.

class lazuli_exo.forms.ParseResult(values, errors, warnings)

Bases: tuple

errors

Alias for field number 1

values

Alias for field number 0

warnings

Alias for field number 2

lazuli_exo.forms.parse(data)[source]

Parse a mapping of form strings. Missing keys take their defaults.

lazuli_exo.forms.to_params(v)[source]

Typed form values -> the lazuli_exo.simulate() parameter dict.

lazuli_exo.forms.from_preset(planet, scenario='clear')[source]

Typed form values prefilled from a showcase planet + scenario.