Skip to content

error

Exceptions raised by StagPy.

StagpyError

Bases: Exception

Base class for exceptions raised by StagPy.

Note

All exceptions derive from this class. To catch any error that might be raised by StagPy due to invalid requests/missing data, you only need to catch this exception.

NoSnapshotError

Bases: StagpyError

Raised when no snapshot can be found.

Attributes:

Name Type Description
sdat StagyyData

the StagyyData for which no snapshot was found.

NoGeomError

Bases: StagpyError

Raised when no geometry info can be found.

Attributes:

Name Type Description
step Step

the Step for which no geometry was found.

NoTimeError

Bases: StagpyError

Raised when no time can be found for a step.

Attributes:

Name Type Description
step Step

the Step instance for which no geometry was found.

NoRefstateError

Bases: StagpyError

Raised when no refstate output can be found.

Attributes:

Name Type Description
sdat StagyyData

the StagyyData instance for which no refstate was found.

NoParFileError

Bases: StagpyError

Raised when no par file can be found.

Attributes:

Name Type Description
parfile PathLike

the expected path of the par file.

NotAvailableError

Bases: StagpyError

Raised when a feature is not available yet.

ParsingError

Bases: StagpyError

Raised when a parsing error occurs.

Attributes:

Name Type Description
file PathLike

path of the file where a parsing problem was encountered.

msg str

error message.

InvalidTimestepError

Bases: StagpyError, KeyError

Raised when invalid time step is requested.

Attributes:

Name Type Description
sdat StagyyData

the StagyyData instance to which the request was made.

istep int

the invalid time step index.

msg str

the error message.

InvalidSnapshotError

Bases: StagpyError, KeyError

Raised when invalid snapshot is requested.

Attributes:

Name Type Description
sdat StagyyData

the StagyyData instance to which the request was made.

isnap int

the invalid snapshot index.

msg str

the error message.

InvalidTimeFractionError

Bases: StagpyError

Raised when invalid fraction of series is requested.

Attributes:

Name Type Description
fraction float

the invalid fraction.

InvalidNfieldsError

Bases: StagpyError

Raised when invalid nfields_max is requested.

Attributes:

Name Type Description
nfields int

the invalid number of field.

InvalidZoomError

Bases: StagpyError

Raised when invalid zoom is requested.

Attributes:

Name Type Description
zoom float

the invalid zoom level.

MissingDataError

Bases: StagpyError, KeyError

Raised when requested data is not present in output.

UnknownVarError

Bases: StagpyError, KeyError

Raised when invalid var is requested.

Attributes:

Name Type Description
varname str

the invalid var name.

UnknownFieldVarError

Bases: UnknownVarError

Raised when invalid field var is requested.

UnknownRprofVarError

Bases: UnknownVarError

Raised when invalid rprof var is requested.

UnknownTimeVarError

Bases: UnknownVarError

Raised when invalid time var is requested.