Application
Module for Application class
Classes
Application
Application
Application for running command-line
Source code in decoimpact/business/application.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
__init__(logger: ILogger, da_layer: IDataAccessLayer, model_builder: IModelBuilder)
Creates an application based on provided logger, data-access layer and model builder
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
logger |
ILogger
|
Logger that takes care of logging |
required |
da_layer |
IDataAccessLayer
|
data-access layer for reading/writing |
required |
model_builder |
IModelBuilder
|
builder for creating a model based on |
required |
Source code in decoimpact/business/application.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
run(input_path: Path)
Runs application
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_path |
Path
|
path to input file |
required |
Source code in decoimpact/business/application.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
IDataAccessLayer
Bases: ABC
Interface for the data layer
Source code in decoimpact/data/api/i_data_access_layer.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | |
read_input_dataset(dataset_data: IDatasetData) -> _xr.Dataset
abstractmethod
Uses the provided dataset_data to create/read a xarray Dataset
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset_data |
IDatasetData
|
dataset data for creating an xarray dataset |
required |
Returns:
| Type | Description |
|---|---|
_xr.Dataset
|
_xr.Dataset: Dataset based on provided dataset_data |
Source code in decoimpact/data/api/i_data_access_layer.py
38 39 40 41 42 43 44 45 46 47 48 | |
read_input_file(path: Path) -> IModelData
abstractmethod
Reads input file from provided path
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path |
str
|
path to input file |
required |
Returns:
| Name | Type | Description |
|---|---|---|
IModelData |
IModelData
|
Data regarding model |
Source code in decoimpact/data/api/i_data_access_layer.py
27 28 29 30 31 32 33 34 35 36 | |
write_output_file(dataset: _xr.Dataset, path: Path) -> None
abstractmethod
Write output files to provided path
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset |
XArray dataset
|
dataset to write |
required |
path |
str
|
path to output file |
required |
Returns:
| Type | Description |
|---|---|
None
|
None |
Source code in decoimpact/data/api/i_data_access_layer.py
50 51 52 53 54 55 56 57 58 59 60 | |
ILogger
Bases: ABC
Interface for a Logger
Source code in decoimpact/crosscutting/i_logger.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
log_debug(message: str) -> None
abstractmethod
Logs a debug message
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message |
str
|
message to log |
required |
Source code in decoimpact/crosscutting/i_logger.py
45 46 47 48 49 50 51 | |
log_error(message: str) -> None
abstractmethod
Logs an error message
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message |
str
|
message to log |
required |
Source code in decoimpact/crosscutting/i_logger.py
21 22 23 24 25 26 27 | |
log_info(message: str) -> None
abstractmethod
Logs a info message
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message |
str
|
message to log |
required |
Source code in decoimpact/crosscutting/i_logger.py
37 38 39 40 41 42 43 | |
log_warning(message: str) -> None
abstractmethod
Logs a warning message
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message |
str
|
message to log |
required |
Source code in decoimpact/crosscutting/i_logger.py
29 30 31 32 33 34 35 | |
IModelBuilder
Bases: ABC
Factory for creating models
Source code in decoimpact/business/workflow/i_model_builder.py
22 23 24 25 26 27 28 29 30 31 | |
build_model(model_data: IModelData) -> IModel
abstractmethod
Creates an model based on model data
Returns:
| Name | Type | Description |
|---|---|---|
IModel |
IModel
|
instance of a model based on model data |
Source code in decoimpact/business/workflow/i_model_builder.py
25 26 27 28 29 30 31 | |
IModelData
Bases: ABC
Interface for the model data
Source code in decoimpact/data/api/i_model_data.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
datasets: List[IDatasetData]
abstractmethod
property
Datasets of the model
name: str
abstractmethod
property
Name of the model
output_path: Path
abstractmethod
property
Model path to the output file
rules: List[IRuleData]
abstractmethod
property
Rules of the model