graphcast.util.onto
¶
Utility ontology classes for file patterns and configurations.
This module provides data classes for managing file patterns and configurations used throughout the system. These classes support file discovery, pattern matching, and configuration management.
Key Components
- FilePattern: Configuration for file pattern matching
- Patterns: Collection of named file patterns
FilePattern
dataclass
¶
Bases: BaseDataclass
Configuration for file pattern matching.
This class defines a pattern for matching files, including a regular expression for matching filenames and a subdirectory path to search in.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
regex
|
str | None
|
Regular expression pattern for matching filenames |
None
|
sub_path
|
None | Path
|
Path to search for matching files (default: "./") |
lambda: Path('./')()
|
Attributes:
Name | Type | Description |
---|---|---|
regex |
str | None
|
Regular expression pattern |
sub_path |
None | Path
|
Path to search in |
Source code in graphcast/util/onto.py
__post_init__()
¶
Initialize and validate the file pattern.
Ensures that sub_path is a Path object and is not None.
Source code in graphcast/util/onto.py
Patterns
dataclass
¶
Bases: BaseDataclass
Collection of named file patterns.
This class manages a collection of file patterns, each associated with a name. It provides a way to organize and access multiple file patterns.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
patterns
|
dict[str, FilePattern]
|
Dictionary mapping names to FilePattern instances |
dict()
|
Attributes:
Name | Type | Description |
---|---|---|
patterns |
dict[str, FilePattern]
|
Dictionary of named file patterns |