Skip to content

Commit

Permalink
Merge pull request #759 from PowerGridModel/feature/remove-experiment…
Browse files Browse the repository at this point in the history
…al-columnar

remove experimental flag on columnar output
  • Loading branch information
mgovers authored Oct 1, 2024
2 parents 2c0f663 + 5f355f7 commit 2487f49
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
20 changes: 8 additions & 12 deletions src/power_grid_model/core/power_grid_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""
Main power grid model class
"""

from enum import IntEnum
from typing import Optional, Type

Expand Down Expand Up @@ -37,7 +38,6 @@
TapChangingStrategy,
_ExperimentalFeatures,
)
from power_grid_model.errors import PowerGridError
from power_grid_model.typing import ComponentAttributeMapping


Expand Down Expand Up @@ -229,7 +229,9 @@ def as_enum_value(key_enum: str, type_: Type[IntEnum]):

def _handle_errors(self, continue_on_batch_error: bool, batch_size: int, decode_error: bool):
self._batch_error = handle_errors(
continue_on_batch_error=continue_on_batch_error, batch_size=batch_size, decode_error=decode_error
continue_on_batch_error=continue_on_batch_error,
batch_size=batch_size,
decode_error=decode_error,
)

# pylint: disable=too-many-arguments
Expand All @@ -242,7 +244,7 @@ def _calculate_impl( # pylint: disable=too-many-positional-arguments
options: Options,
continue_on_batch_error: bool,
decode_error: bool,
experimental_features: _ExperimentalFeatures | str, # pylint: disable=too-many-arguments
experimental_features: _ExperimentalFeatures | str, # pylint: disable=too-many-arguments,unused-argument
):
"""
Core calculation routine
Expand All @@ -269,14 +271,6 @@ def _calculate_impl( # pylint: disable=too-many-positional-arguments
update_ptr = ConstDatasetPtr()
batch_size = 1

if experimental_features in [
_ExperimentalFeatures.disabled,
_ExperimentalFeatures.disabled.name,
] and isinstance(output_component_types, dict):
raise PowerGridError(
"Experimental features flag must be enabled when providing a dict for output_component_types"
)

output_data = self._construct_output(
output_component_types=output_component_types,
calculation_type=calculation_type,
Expand All @@ -299,7 +293,9 @@ def _calculate_impl( # pylint: disable=too-many-positional-arguments
)

self._handle_errors(
continue_on_batch_error=continue_on_batch_error, batch_size=batch_size, decode_error=decode_error
continue_on_batch_error=continue_on_batch_error,
batch_size=batch_size,
decode_error=decode_error,
)

output_data = compatibility_convert_row_columnar_dataset(
Expand Down
8 changes: 1 addition & 7 deletions tests/unit/test_error_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@

from power_grid_model import PowerGridModel
from power_grid_model.core.power_grid_meta import initialize_array
from power_grid_model.enum import (
CalculationMethod,
LoadGenType,
MeasuredTerminalType,
TapChangingStrategy,
_ExperimentalFeatures,
)
from power_grid_model.enum import CalculationMethod, LoadGenType, MeasuredTerminalType, TapChangingStrategy
from power_grid_model.errors import (
AutomaticTapCalculationError,
ConflictID,
Expand Down

0 comments on commit 2487f49

Please sign in to comment.