errors
Custom exceptions for gwframe with helpful error messages.
ChannelNotFoundError ¶
ChannelNotFoundError(channels: str | list[str], available_channels: list[str], source: str | None = None)
Bases: ValueError
Raised when one or more requested channels are not found in a GWF file.
Provides suggestions for similar channel names and lists available channels.
Attributes:
| Name | Type | Description |
|---|---|---|
channels |
list[str]
|
The channel name(s) that were not found |
available_channels |
list[str]
|
List of all available channel names in the file |
source |
str or None
|
Source file path or description |
Source code in gwframe/errors.py
__str__ ¶
__str__() -> str
Generate helpful error message with suggestions.
Source code in gwframe/errors.py
FrameIndexError ¶
Bases: IndexError
Raised when requested frame index is out of range.
Attributes:
| Name | Type | Description |
|---|---|---|
frame_index |
int
|
The requested frame index |
num_frames |
int
|
Total number of frames in the file |
source |
str or None
|
Source file path or description |
Source code in gwframe/errors.py
__str__ ¶
__str__() -> str
Generate helpful error message.
Source code in gwframe/errors.py
InvalidTimeRangeError ¶
InvalidTimeRangeError(start: float, end: float, file_start: float, file_end: float, source: str | None = None)
Bases: ValueError
Raised when requested time range does not overlap with file data.
Attributes:
| Name | Type | Description |
|---|---|---|
start |
float
|
Requested start time (GPS seconds) |
end |
float
|
Requested end time (GPS seconds) |
file_start |
float
|
Actual start time of data in file (GPS seconds) |
file_end |
float
|
Actual end time of data in file (GPS seconds) |
source |
str or None
|
Source file path or description |
Source code in gwframe/errors.py
__str__ ¶
__str__() -> str
Generate helpful error message.