hydro.exchange.exceptions¶
Exceptions¶
This is the base exception which all the other exceptions derive from. |
|
Error raised when the bytes for some exchange file cannot be decoded as UTF-8. |
|
Error raised when the exchange file has a byte order mark. |
|
Error raised when the exchange file does not have the correct line endings. |
|
Error raised when the exchange file does not start with |
|
Erorr raised when |
|
Base exception for errors related to parameters and units. |
|
Error raised when the library does not have a definition for a parameter/unit pair in the exchange file. |
|
Error raised when there is a mismatch between the number of parameters and number of units in the exchange file. |
|
Error raised when the same parameter/unit pair occurs more than once in the excahnge file. |
|
Error raised when there exists a flag column with no corresponding parameter column. |
|
Error raised when there exists an error column with no corresponding parameter column. |
|
Error raised when a parameter has a flag column when it is not supposed to. |
|
Error raised if a flag column has a non empty units. |
|
Base exception for errors which occur when parsing the data porition of an exchange file. |
|
Error raised when the number of columns in a data line does not match the expected number of columns based on the parameter/unit lines. |
|
There is a mismatch between what the flag value expects, and the fill/data value. |
|
Error raised when there is no value for one (or more) of the following parameters. |
|
Error raised when there is a duplicate composite key in the exchange file. |
|
Error raised if values for latitude, longitude, or pressure are missing. |
|
Error raised if the reported latitude, longitude, and date (and time) vary for a single profile. |
|
Error raised when the merge_ex method is called on mixed ctd and bottle exchange types. |
|
Error raised if there are zip files inside the zip file that read exchange is trying to read. |
Module Contents¶
- exception hydro.exchange.exceptions.ExchangeError[source]¶
Bases:
ValueErrorThis is the base exception which all the other exceptions derive from. It is a subclass of ValueError.
- exception hydro.exchange.exceptions.ExchangeEncodingError[source]¶
Bases:
ExchangeErrorError raised when the bytes for some exchange file cannot be decoded as UTF-8.
- exception hydro.exchange.exceptions.ExchangeBOMError[source]¶
Bases:
ExchangeErrorError raised when the exchange file has a byte order mark.
- exception hydro.exchange.exceptions.ExchangeLEError[source]¶
Bases:
ExchangeErrorError raised when the exchange file does not have the correct line endings.
- exception hydro.exchange.exceptions.ExchangeMagicNumberError[source]¶
Bases:
ExchangeErrorError raised when the exchange file does not start with
BOTTLEorCTD.
- exception hydro.exchange.exceptions.ExchangeEndDataError[source]¶
Bases:
ExchangeErrorErorr raised when
END_DATAcannot be found in the exchange file.
- exception hydro.exchange.exceptions.ExchangeParameterError[source]¶
Bases:
ExchangeErrorBase exception for errors related to parameters and units.
- exception hydro.exchange.exceptions.ExchangeParameterUndefError(error_data)[source]¶
Bases:
ExchangeParameterErrorError raised when the library does not have a definition for a parameter/unit pair in the exchange file.
- exception hydro.exchange.exceptions.ExchangeParameterUnitAlignmentError[source]¶
Bases:
ExchangeParameterErrorError raised when there is a mismatch between the number of parameters and number of units in the exchange file.
- exception hydro.exchange.exceptions.ExchangeDuplicateParameterError[source]¶
Bases:
ExchangeParameterErrorError raised when the same parameter/unit pair occurs more than once in the excahnge file.
- exception hydro.exchange.exceptions.ExchangeOrphanFlagError[source]¶
Bases:
ExchangeParameterErrorError raised when there exists a flag column with no corresponding parameter column.
- exception hydro.exchange.exceptions.ExchangeOrphanErrorError[source]¶
Bases:
ExchangeParameterErrorError raised when there exists an error column with no corresponding parameter column.
- exception hydro.exchange.exceptions.ExchangeFlaglessParameterError[source]¶
Bases:
ExchangeParameterErrorError raised when a parameter has a flag column when it is not supposed to.
- exception hydro.exchange.exceptions.ExchangeFlagUnitError[source]¶
Bases:
ExchangeParameterErrorError raised if a flag column has a non empty units.
- exception hydro.exchange.exceptions.ExchangeDataError[source]¶
Bases:
ExchangeErrorBase exception for errors which occur when parsing the data porition of an exchange file.
- exception hydro.exchange.exceptions.ExchangeDataColumnAlignmentError[source]¶
Bases:
ExchangeDataErrorError raised when the number of columns in a data line does not match the expected number of columns based on the parameter/unit lines.
- exception hydro.exchange.exceptions.ExchangeDataFlagPairError(error_data)[source]¶
Bases:
ExchangeDataErrorThere is a mismatch between what the flag value expects, and the fill/data value.
Examples¶
something with a flag of
9has a non fill valuesomething with a flag of
2as a fill value instead of data
- Parameters:
error_data (xarray.Dataset)
- exception hydro.exchange.exceptions.ExchangeDataPartialKeyError[source]¶
Bases:
ExchangeDataErrorError raised when there is no value for one (or more) of the following parameters.
EXPOCODE
STNNBR
CASTNO
SAMPNO (only for bottle files)
CTDPRS (only for CTD files)
These form the “composite key” which uniquely identify the “row” of exchange data.
- exception hydro.exchange.exceptions.ExchangeDuplicateKeyError[source]¶
Bases:
ExchangeDataErrorError raised when there is a duplicate composite key in the exchange file.
This would occur if the exact values for the following parameters occur in more than one data row:
EXPOCODE
STNNBR
CASTNO
SAMPNO (only for bottle files)
CTDPRS (only for CTD files)
- exception hydro.exchange.exceptions.ExchangeDataPartialCoordinateError[source]¶
Bases:
ExchangeDataErrorError raised if values for latitude, longitude, or pressure are missing.
It is OK by the standard to omit the time of day.
- exception hydro.exchange.exceptions.ExchangeDataInconsistentCoordinateError[source]¶
Bases:
ExchangeDataErrorError raised if the reported latitude, longitude, and date (and time) vary for a single profile.
A “profile” in an exchange file is a grouping of data rows which all have the same EXPOCODE, STNNBR, and CASTNO. The SAMPNO/CTDPRS is allowed/requried to vary for a single profile and is what identifies samples within one profile.
- exception hydro.exchange.exceptions.ExchangeInconsistentMergeType[source]¶
Bases:
ExchangeErrorError raised when the merge_ex method is called on mixed ctd and bottle exchange types.
- exception hydro.exchange.exceptions.ExchangeRecursiveZip[source]¶
Bases:
ExchangeErrorError raised if there are zip files inside the zip file that read exchange is trying to read.