Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/private core module #787

Merged
merged 19 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
3aa2ee5
move core to _core
mgovers Oct 15, 2024
6ca7e5c
add deprecated core library wrapper
mgovers Oct 15, 2024
47c3c69
Merge branch 'feature/columnar-data-examples' into feature/private-co…
mgovers Oct 15, 2024
ee1cdf9
generate dataset_definitions
mgovers Oct 15, 2024
e1fccfc
Merge branch 'feature/columnar-data-examples' into feature/private-co…
mgovers Oct 17, 2024
7581ddd
Merge branch 'feature/columnar-data-examples' into feature/private-co…
mgovers Oct 18, 2024
9b65c0b
revert add temporary core wrapper
mgovers Oct 18, 2024
7c08190
rerun notebooks
mgovers Oct 18, 2024
e2772cc
Merge remote-tracking branch 'origin/feature/columnar-data-examples' …
mgovers Oct 21, 2024
0c7c82b
Merge remote-tracking branch 'origin/feature/columnar-data-examples' …
mgovers Oct 21, 2024
08da0c8
Merge remote-tracking branch 'origin/feature/columnar-data-examples' …
mgovers Oct 21, 2024
0c3fe98
Merge remote-tracking branch 'origin/main' into feature/private-core-…
mgovers Oct 29, 2024
dfa47cd
Merge remote-tracking branch 'origin/main' into feature/private-core-…
mgovers Nov 5, 2024
291d2a0
fix errors
mgovers Nov 5, 2024
e960e8c
Merge branch 'main' into feature/private-core-module
mgovers Nov 6, 2024
9198dcd
Merge remote-tracking branch 'origin/docs/col-update-optional-id' int…
mgovers Nov 6, 2024
faec0f6
Merge remote-tracking branch 'origin/main' into feature/private-core-…
mgovers Nov 7, 2024
4d3d984
Merge branch 'release/v1.10.0-rc' into feature/private-core-module
mgovers Nov 7, 2024
fd98e5e
Merge remote-tracking branch 'origin/release/v1.10.0-rc' into feature…
mgovers Nov 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/power_grid_model/core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
#
# SPDX-License-Identifier: MPL-2.0

"""
Power Grid Model core library

[deprecated]
"""
figueroa1395 marked this conversation as resolved.
Show resolved Hide resolved
38 changes: 38 additions & 0 deletions src/power_grid_model/core/buffer_handling.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
#
# SPDX-License-Identifier: MPL-2.0

"""
Power grid model buffer handler

[deprecated]
"""

from power_grid_model._core.buffer_handling import ( # pylint: disable=unused-import
VALIDATOR_MSG,
AttributeType,
BufferProperties,
CAttributeBuffer,
CBuffer,
ComponentData,
ComponentMetaData,
DenseBatchData,
IdxC,
IdxNp,
IdxPtr,
IndexPointer,
SingleComponentData,
SparseBatchArray,
SparseBatchData,
VoidPtr,
cast,
check_indptr_consistency,
create_buffer,
dataclass,
get_buffer_properties,
get_buffer_view,
is_columnar,
is_sparse,
np,
warnings,
)
27 changes: 27 additions & 0 deletions src/power_grid_model/core/data_handling.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
#
# SPDX-License-Identifier: MPL-2.0

"""
Data handling

[deprecated]
"""

from power_grid_model._core.data_handling import ( # pylint: disable=unused-import
CalculationType,
CConstDataset,
CMutableDataset,
ComponentAttributeMapping,
ComponentType,
Dataset,
DatasetType,
SingleDataset,
create_output_data,
get_output_type,
initialize_array,
prepare_input_view,
prepare_output_view,
prepare_update_view,
process_data_filter,
)
24 changes: 24 additions & 0 deletions src/power_grid_model/core/dataset_definitions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
#
# SPDX-License-Identifier: MPL-2.0

"""
Data types for power grid model dataset and component types.

[deprecated]
"""

from power_grid_model._core.dataset_definitions import ( # pylint: disable=unused-import
Any,
ComponentType,
ComponentTypeLike,
ComponentTypeVar,
DatasetType,
DatasetTypeLike,
DatasetTypeVar,
Enum,
EnumMeta,
Mapping,
TypeAlias,
TypeVar,
)
49 changes: 49 additions & 0 deletions src/power_grid_model/core/error_handling.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
#
# SPDX-License-Identifier: MPL-2.0

"""
Error handling

[deprecated]
"""

from power_grid_model._core.error_handling import ( # pylint: disable=unused-import
PGM_BATCH_ERROR,
PGM_NO_ERROR,
PGM_REGULAR_ERROR,
PGM_SERIALIZATION_ERROR,
VALIDATOR_MSG,
AutomaticTapCalculationError,
ConflictID,
ConflictVoltage,
IDNotFound,
IDWrongType,
IdxNp,
InvalidArguments,
InvalidBranch,
InvalidBranch3,
InvalidCalculationMethod,
InvalidMeasuredObject,
InvalidRegulatedObject,
InvalidShortCircuitPhaseOrType,
InvalidTransformerClock,
IterationDiverge,
MaxIterationReached,
MissingCaseForEnumError,
NotObservableError,
Optional,
PowerGridBatchError,
PowerGridDatasetError,
PowerGridError,
PowerGridNotImplementedError,
PowerGridSerializationError,
PowerGridUnreachableHitError,
SparseMatrixError,
assert_no_error,
find_error,
handle_errors,
np,
pgc,
re,
)
19 changes: 19 additions & 0 deletions src/power_grid_model/core/index_integer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
#
# SPDX-License-Identifier: MPL-2.0

"""
Definition of integers used by the calculation core

[deprecated]
"""

# define internal index integer
from ctypes import c_int32, c_int64

import numpy as np

IdxC = c_int64
IdxNp = np.int64
IdC = c_int32
IdNp = np.int32
18 changes: 18 additions & 0 deletions src/power_grid_model/core/options.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
#
# SPDX-License-Identifier: MPL-2.0

"""
Option class

[deprecated]
"""

from power_grid_model._core.options import ( # pylint: disable=unused-import
Any,
Callable,
Options,
OptionSetter,
OptionsPtr,
pgc,
)
51 changes: 51 additions & 0 deletions src/power_grid_model/core/power_grid_core.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
#
# SPDX-License-Identifier: MPL-2.0

"""
Loader for the dynamic library

[deprecated]
"""

from power_grid_model._core.power_grid_core import ( # pylint: disable=unused-import
CDLL,
POINTER,
AttributePtr,
Callable,
CharDoublePtr,
CharPtr,
ComponentPtr,
ConstDatasetPtr,
CStr,
CStrPtr,
DatasetInfoPtr,
DatasetPtr,
DeserializerPtr,
HandlePtr,
IdC,
IDPtr,
IdxC,
IdxDoublePtr,
IdxPtr,
ModelPtr,
MutableDatasetPtr,
Optional,
OptionsPtr,
Path,
PowerGridCore,
SerializerPtr,
VoidDoublePtr,
VoidPtr,
WritableDatasetPtr,
c_char,
c_char_p,
c_double,
c_size_t,
c_void_p,
chain,
make_c_binding,
platform,
power_grid_core,
signature,
)
46 changes: 46 additions & 0 deletions src/power_grid_model/core/power_grid_dataset.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
#
# SPDX-License-Identifier: MPL-2.0

"""
Power grid model raw dataset handler

[deprecated]
"""

from power_grid_model._core.power_grid_dataset import ( # pylint: disable=unused-import
VALIDATOR_MSG,
Any,
AttributeType,
BufferProperties,
CAttributeBuffer,
CBuffer,
CConstDataset,
CDatasetInfo,
CMutableDataset,
ComponentAttributeFilterOptions,
ComponentAttributeMapping,
ComponentData,
ComponentMetaData,
ComponentType,
ConstDatasetPtr,
CWritableDataset,
Dataset,
DatasetInfoPtr,
DatasetMetaData,
DatasetType,
Mapping,
MutableDatasetPtr,
Optional,
WritableDatasetPtr,
assert_no_error,
create_buffer,
get_buffer_properties,
get_buffer_view,
get_dataset_type,
is_columnar,
is_nan_or_equivalent,
pgc,
power_grid_meta_data,
process_data_filter,
)
32 changes: 32 additions & 0 deletions src/power_grid_model/core/power_grid_meta.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
#
# SPDX-License-Identifier: MPL-2.0

"""
Load meta data from C core and define numpy structured array

[deprecated]
"""

from power_grid_model._core.power_grid_meta import ( # pylint: disable=unused-import
Any,
AttributePtr,
ComponentMetaData,
ComponentPtr,
ComponentTypeLike,
ComponentTypeVar,
DatasetMetaData,
DatasetPtr,
DatasetType,
DatasetTypeLike,
DenseBatchArray,
IntEnum,
PGMCType,
PowerGridMetaData,
SingleArray,
dataclass,
initialize_array,
np,
pgc,
power_grid_meta_data,
)
44 changes: 44 additions & 0 deletions src/power_grid_model/core/power_grid_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
#
# SPDX-License-Identifier: MPL-2.0

"""
Main power grid model class

[deprecated]
"""

from power_grid_model._core.power_grid_model import ( # pylint: disable=unused-import
CalculationMethod,
CalculationType,
ComponentAttributeMapping,
ComponentType,
ComponentTypeLike,
ComponentTypeVar,
ConstDatasetPtr,
Dataset,
IdNp,
IDPtr,
IdxNp,
IdxPtr,
IntEnum,
ModelPtr,
Optional,
Options,
PowerGridBatchError,
PowerGridModel,
ShortCircuitVoltageScaling,
SingleDataset,
TapChangingStrategy,
Type,
assert_no_error,
compatibility_convert_row_columnar_dataset,
create_output_data,
get_output_type,
handle_errors,
np,
pgc,
prepare_input_view,
prepare_output_view,
prepare_update_view,
)
Loading