tephpy.exceptions#
The public tephpy exception hierarchy (spec §6).
What tephpy raises about your data and its surroundings — the units it
carries, its physical consistency, the source it was read from, the
configuration file in force — derives from TephpyError, so one
except TephpyError covers that whole subject. Units problems raise
TephpyUnitsError; physically impossible data raises a
TephpyValidationError subclass carrying the offending level
indices. Validation happens at ingest (Sounding construction), not
mid-plot.
Ordinary argument mistakes stay outside the hierarchy and raise the builtin
Python exceptions, because that is the vocabulary a caller already knows: an
unrecognised sample name is a ValueError, an unknown keyword or
configuration section a TypeError, a missing DataFrame column a
KeyError. except TephpyError is therefore the domain net, not a
catch-all for every way a call can be wrong.
Configuration-file problems are the one place tephpy also warns:
TephpyConfigWarning is a UserWarning, not a
TephpyError, because an unusable configuration file degrades to
the hardwired defaults instead of stopping the import (configfile spec §5).
Notes#
Added in version 0.1.0.
Exceptions#
Root of the tephpy exception hierarchy. |
|
Missing, ambiguous, unparsable, or wrong-dimension units (spec §5). |
|
Physically impossible input, identified by level indices (spec §6). |
|
Pressure is not strictly monotonic (spec §3.4). |
|
Dewpoint exceeds temperature at one or more levels (spec §3.4). |
|
The sounding lacks a field the requested operation needs (spec §6). |
|
A reader could not fetch or make sense of its source (spec §6). |
|
The profile tops out at or below the parcel's LCL (spec §6). |
|
A configuration file could not be read or made sense of. |
|
A configuration file was used, but something in it was ignored. |
Module Contents#
- exception tephpy.exceptions.TephpyError[source]#
Bases:
ExceptionRoot of the tephpy exception hierarchy.
Notes
Added in version 0.1.0.
- exception tephpy.exceptions.TephpyUnitsError[source]#
Bases:
TephpyErrorMissing, ambiguous, unparsable, or wrong-dimension units (spec §5).
Notes
Added in version 0.1.0.
- exception tephpy.exceptions.TephpyValidationError(message: str, *, levels: tuple[int, ...] = ())[source]#
Bases:
TephpyErrorPhysically impossible input, identified by level indices (spec §6).
- Parameters:
- Attributes:
Notes
Added in version 0.1.0.
- levels = ()#
- exception tephpy.exceptions.NonMonotonicPressureError(message: str, *, levels: tuple[int, ...] = ())[source]#
Bases:
TephpyValidationErrorPressure is not strictly monotonic (spec §3.4).
Notes
Added in version 0.1.0.
- exception tephpy.exceptions.DewpointExceedsTemperatureError(message: str, *, levels: tuple[int, ...] = ())[source]#
Bases:
TephpyValidationErrorDewpoint exceeds temperature at one or more levels (spec §3.4).
Equality — saturation — is physical and accepted; only strict excess is rejected.
Notes
Added in version 0.1.0.
- exception tephpy.exceptions.MissingDataError(message: str, *, levels: tuple[int, ...] = ())[source]#
Bases:
TephpyValidationErrorThe sounding lacks a field the requested operation needs (spec §6).
Raised at the operation’s boundary — the earliest point the need is knowable — e.g. parcel analysis without dewpoint, or (in a later release) wind barbs without wind.
Notes
Added in version 0.1.0.
- exception tephpy.exceptions.TephpyIOError[source]#
Bases:
TephpyErrorA reader could not fetch or make sense of its source (spec §6).
Network failures, HTTP errors, the archive’s “no data” replies, a malformed or unrecognisable file, and an ambiguous read (an IGRA station file holding many soundings with no
time=selector) all raise this, summarising the upstream response or file state.Notes
Added in version 0.1.0.
- exception tephpy.exceptions.ProfileTooShortError(message: str, *, levels: tuple[int, ...] = ())[source]#
Bases:
TephpyValidationErrorThe profile tops out at or below the parcel’s LCL (spec §6).
No moist ascent exists, so every parcel-derived quantity would be meaningless;
calc.parcel_pathandcalc.indicesboth raise this. The LCL tested is the one the path would use — the corrected one when a cloud-base correction is requested.Notes
Added in version 0.1.0.
- exception tephpy.exceptions.TephpyConfigError[source]#
Bases:
TephpyErrorA configuration file could not be read or made sense of.
A malformed YAML document, a top-level entry that is not a mapping, an unknown configuration section, and a
$TEPHPYRCnaming a file that does not exist all raise this. Raised only when the file was asked for explicitly; the import-time auto-load warns instead (configfile spec §5).Notes
Added in version 0.1.0.
- exception tephpy.exceptions.TephpyConfigWarning[source]#
Bases:
UserWarningA configuration file was used, but something in it was ignored.
An unknown option, an option whose value is an explicit null, and any failure during the import-time auto-load warn rather than raise, so a typo in a configuration file cannot make
tephpyunimportable (configfile spec §5).Notes
Added in version 0.1.0.