Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 3, 2025
1 parent a60d434 commit 23a0b99
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
1 change: 1 addition & 0 deletions src/alfasim_sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Top-level package for alfasim-sdk."""

import pluggy

from alfasim_sdk._internal import version
Expand Down
12 changes: 6 additions & 6 deletions src/alfasim_sdk/_internal/alfacase/case_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -3405,7 +3405,7 @@ class PvtModelsDescription:

@staticmethod
def get_pvt_file_and_model_name(
value: Union[str, Path]
value: Union[str, Path],
) -> Tuple[Path, Optional[str]]:
"""
Parse the value provided from the user to get the path for the pvt file and if defined, the pvt model.
Expand Down Expand Up @@ -3434,11 +3434,11 @@ class TracersDescription:
.. include:: /alfacase_definitions/TracersDescription.txt
"""

constant_coefficients: Dict[
str, TracerModelConstantCoefficientsDescription
] = attr.ib(
default=attr.Factory(dict),
validator=dict_of(TracerModelConstantCoefficientsDescription),
constant_coefficients: Dict[str, TracerModelConstantCoefficientsDescription] = (
attr.ib(
default=attr.Factory(dict),
validator=dict_of(TracerModelConstantCoefficientsDescription),
)
)


Expand Down
32 changes: 16 additions & 16 deletions src/alfasim_sdk/result_reader/aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ def map_meta_items(
}

def map_historic_data_infos(
infos: List[Dict[str, Any]]
infos: List[Dict[str, Any]],
) -> List[HistoricDataCurveMetadata]:
return [HistoricDataCurveMetadata.from_dict(info) for info in infos]

Expand Down Expand Up @@ -1670,21 +1670,21 @@ def _read_time_sets(
_TREND_ID_ATTR: [initial_trends_time_step_index, final_trends_time_step_index],
}
if initial_profiles_time_step_index is None:
time_step_index_range_to_read[_PROFILE_ID_ATTR][
0
] = result_metadata.time_steps_boundaries[0][0]
time_step_index_range_to_read[_PROFILE_ID_ATTR][0] = (
result_metadata.time_steps_boundaries[0][0]
)
if final_profiles_time_step_index is None:
time_step_index_range_to_read[_PROFILE_ID_ATTR][
1
] = result_metadata.time_steps_boundaries[1][0]
time_step_index_range_to_read[_PROFILE_ID_ATTR][1] = (
result_metadata.time_steps_boundaries[1][0]
)
if initial_trends_time_step_index is None:
time_step_index_range_to_read[_TREND_ID_ATTR][
0
] = result_metadata.time_steps_boundaries[0][1]
time_step_index_range_to_read[_TREND_ID_ATTR][0] = (
result_metadata.time_steps_boundaries[0][1]
)
if final_trends_time_step_index is None:
time_step_index_range_to_read[_TREND_ID_ATTR][
1
] = result_metadata.time_steps_boundaries[1][1]
time_step_index_range_to_read[_TREND_ID_ATTR][1] = (
result_metadata.time_steps_boundaries[1][1]
)

cache = {}
for time_set_key in time_sets_key_list:
Expand Down Expand Up @@ -1756,7 +1756,7 @@ def _read_time_set(


def _concatenate_values(
data_dict: Dict[Any, List[numpy.ndarray]]
data_dict: Dict[Any, List[numpy.ndarray]],
) -> Dict[Any, numpy.ndarray]:
"""
Concatenate the values in the given dict.
Expand All @@ -1772,7 +1772,7 @@ def _concatenate_values(


def map_output_key_to_time_set_key(
all_metadata: Dict[int, Dict]
all_metadata: Dict[int, Dict],
) -> Dict[OutputKeyType, TimeSetKeyType]:
"""
Operates on the complete metadata mapping "output key"s to they respective "time set key".
Expand All @@ -1791,7 +1791,7 @@ def map_output_key_to_time_set_key(


def map_base_time_set_to_time_set_keys(
output_key_to_time_set_key_dict: Dict[OutputKeyType, TimeSetKeyType]
output_key_to_time_set_key_dict: Dict[OutputKeyType, TimeSetKeyType],
) -> Dict[int, Tuple[TimeSetKeyType, ...]]:
"""
Maps base time steps to the "time set key"s where they are found.
Expand Down
3 changes: 1 addition & 2 deletions tests/test_alfasim_sdk_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ def test_get_metadata() -> None:
from alfasim_sdk._internal.alfasim_sdk_utils import get_metadata

@data_model(icon="model.png", caption="PLUGIN DEV MODEL")
class Model:
...
class Model: ...

assert get_metadata(Model)["caption"] == "PLUGIN DEV MODEL"
assert get_metadata(Model)["icon"] == "model.png"

0 comments on commit 23a0b99

Please sign in to comment.