pandas_openscm.db.path_handling#
Functionality for handling paths
In order to make our databases portable, we need to be a bit smarter than just using raw paths.
Classes:
| Name | Description |
|---|---|
DBPath |
Database-related path |
DBPath #
Database-related path
Carries the information required to write paths with certainty and keep the database portable.
Methods:
| Name | Description |
|---|---|
from_abs_path_and_db_dir |
Initialise from an absolute path and a database directory |
rel_db_validator |
Validate the value of |
Attributes:
| Name | Type | Description |
|---|---|---|
abs |
Path
|
The absolute path for the file |
rel_db |
Path
|
The path relative to the database's directory |
Source code in src/pandas_openscm/db/path_handling.py
rel_db
class-attribute
instance-attribute
#
The path relative to the database's directory
from_abs_path_and_db_dir
classmethod
#
Initialise from an absolute path and a database directory
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
abs
|
Path
|
Absolute path |
required |
db_dir
|
Path
|
Database directory |
required |
Returns:
| Type | Description |
|---|---|
DBPath
|
Initialised |
Source code in src/pandas_openscm/db/path_handling.py
rel_db_validator #
Validate the value of rel_db
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
attribute
|
Attribute[Any]
|
Attribute being set |
required |
value
|
Path
|
Value to use |
required |
Raises:
| Type | Description |
|---|---|
AssertionError
|
|