power-grid-model 1.11.48__py3-none-win_amd64.whl → 1.12.72__py3-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of power-grid-model might be problematic. Click here for more details.
- power_grid_model/__init__.py +54 -54
- power_grid_model/_core/__init__.py +3 -3
- power_grid_model/_core/buffer_handling.py +493 -487
- power_grid_model/_core/data_handling.py +195 -141
- power_grid_model/_core/data_types.py +143 -132
- power_grid_model/_core/dataset_definitions.py +109 -109
- power_grid_model/_core/enum.py +226 -226
- power_grid_model/_core/error_handling.py +206 -206
- power_grid_model/_core/errors.py +130 -130
- power_grid_model/_core/index_integer.py +17 -17
- power_grid_model/_core/options.py +71 -71
- power_grid_model/_core/power_grid_core.py +563 -563
- power_grid_model/_core/power_grid_dataset.py +535 -535
- power_grid_model/_core/power_grid_meta.py +257 -243
- power_grid_model/_core/power_grid_model.py +969 -686
- power_grid_model/_core/power_grid_model_c/__init__.py +3 -3
- power_grid_model/_core/power_grid_model_c/bin/power_grid_model_c.dll +0 -0
- power_grid_model/_core/power_grid_model_c/get_pgm_dll_path.py +63 -63
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/basics.h +255 -255
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/buffer.h +108 -108
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/dataset.h +316 -316
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/dataset_definitions.h +1052 -1052
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/handle.h +99 -99
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/meta_data.h +189 -189
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/model.h +125 -125
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/options.h +142 -142
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_c/serialization.h +118 -118
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_c.h +36 -36
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/basics.hpp +65 -65
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/buffer.hpp +61 -61
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/dataset.hpp +220 -220
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/handle.hpp +108 -108
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/meta_data.hpp +84 -84
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/model.hpp +63 -63
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/options.hpp +52 -52
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/serialization.hpp +124 -124
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp/utils.hpp +81 -81
- power_grid_model/_core/power_grid_model_c/include/power_grid_model_cpp.hpp +19 -19
- power_grid_model/_core/power_grid_model_c/lib/cmake/power_grid_model/power_grid_modelConfigVersion.cmake +3 -3
- power_grid_model/_core/power_grid_model_c/lib/power_grid_model_c.lib +0 -0
- power_grid_model/_core/serialization.py +317 -317
- power_grid_model/_core/typing.py +20 -20
- power_grid_model/_core/utils.py +798 -793
- power_grid_model/data_types.py +321 -321
- power_grid_model/enum.py +27 -27
- power_grid_model/errors.py +37 -37
- power_grid_model/typing.py +43 -43
- power_grid_model/utils.py +473 -469
- power_grid_model/validation/__init__.py +25 -25
- power_grid_model/validation/_rules.py +1171 -1176
- power_grid_model/validation/_validation.py +1172 -1172
- power_grid_model/validation/assertions.py +93 -93
- power_grid_model/validation/errors.py +602 -602
- power_grid_model/validation/utils.py +313 -314
- {power_grid_model-1.11.48.dist-info → power_grid_model-1.12.72.dist-info}/METADATA +4 -2
- power_grid_model-1.12.72.dist-info/RECORD +65 -0
- {power_grid_model-1.11.48.dist-info → power_grid_model-1.12.72.dist-info}/WHEEL +1 -1
- power_grid_model-1.11.48.dist-info/RECORD +0 -65
- {power_grid_model-1.11.48.dist-info → power_grid_model-1.12.72.dist-info}/entry_points.txt +0 -0
- {power_grid_model-1.11.48.dist-info → power_grid_model-1.12.72.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
// SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
|
|
2
|
-
//
|
|
3
|
-
// SPDX-License-Identifier: MPL-2.0
|
|
4
|
-
|
|
5
|
-
#pragma once
|
|
6
|
-
|
|
7
|
-
#ifndef POWER_GRID_MODEL_CPP_UTILS_HPP
|
|
8
|
-
#define POWER_GRID_MODEL_CPP_UTILS_HPP
|
|
9
|
-
|
|
10
|
-
#include "basics.hpp"
|
|
11
|
-
#include "handle.hpp"
|
|
12
|
-
#include "meta_data.hpp"
|
|
13
|
-
|
|
14
|
-
#include <array>
|
|
15
|
-
#include <complex>
|
|
16
|
-
#include <limits>
|
|
17
|
-
|
|
18
|
-
namespace power_grid_model_cpp {
|
|
19
|
-
inline bool is_nan(IntS const x) { return x == std::numeric_limits<IntS>::min(); }
|
|
20
|
-
inline bool is_nan(ID const x) { return x == std::numeric_limits<ID>::min(); }
|
|
21
|
-
inline bool is_nan(double const x) { return std::isnan(x); }
|
|
22
|
-
inline bool is_nan(std::complex<double> const& x) { return is_nan(x.real()) || is_nan(x.imag()); }
|
|
23
|
-
inline bool is_nan(std::array<double, 3> const& array) {
|
|
24
|
-
return is_nan(array[0]) || is_nan(array[1]) || is_nan(array[2]);
|
|
25
|
-
}
|
|
26
|
-
inline bool is_nan(std::array<std::complex<double>, 3> const& array) {
|
|
27
|
-
return is_nan(array[0]) || is_nan(array[1]) || is_nan(array[2]);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
constexpr double nan = std::numeric_limits<double>::quiet_NaN();
|
|
31
|
-
constexpr int8_t na_IntS = std::numeric_limits<int8_t>::min();
|
|
32
|
-
constexpr ID na_IntID = std::numeric_limits<ID>::min();
|
|
33
|
-
|
|
34
|
-
template <typename T> constexpr T nan_value() {
|
|
35
|
-
if constexpr (std::is_same_v<T, double>) {
|
|
36
|
-
return nan;
|
|
37
|
-
} else if constexpr (std::is_same_v<T, ID>) {
|
|
38
|
-
return na_IntID;
|
|
39
|
-
} else if constexpr (std::is_same_v<T, int8_t>) {
|
|
40
|
-
return na_IntS;
|
|
41
|
-
} else if constexpr (std::is_same_v<T, std::array<double, 3>>) {
|
|
42
|
-
return std::array<double, 3>{nan, nan, nan};
|
|
43
|
-
} else {
|
|
44
|
-
static_assert(false, "Unsupported type for nan_value");
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
class UnsupportedPGM_CType : public PowerGridError {
|
|
49
|
-
public:
|
|
50
|
-
UnsupportedPGM_CType()
|
|
51
|
-
: PowerGridError{[&]() {
|
|
52
|
-
using namespace std::string_literals;
|
|
53
|
-
return "Unsupported PGM_Ctype"s;
|
|
54
|
-
}()} {}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
template <class Functor, class... Args>
|
|
58
|
-
decltype(auto) pgm_type_func_selector(enum PGM_CType type, Functor&& f, Args&&... args) {
|
|
59
|
-
switch (type) {
|
|
60
|
-
case PGM_int32:
|
|
61
|
-
return std::forward<Functor>(f).template operator()<ID>(std::forward<Args>(args)...);
|
|
62
|
-
case PGM_int8:
|
|
63
|
-
return std::forward<Functor>(f).template operator()<IntS>(std::forward<Args>(args)...);
|
|
64
|
-
case PGM_double:
|
|
65
|
-
return std::forward<Functor>(f).template operator()<double>(std::forward<Args>(args)...);
|
|
66
|
-
case PGM_double3:
|
|
67
|
-
return std::forward<Functor>(f).template operator()<std::array<double, 3>>(std::forward<Args>(args)...);
|
|
68
|
-
default:
|
|
69
|
-
throw UnsupportedPGM_CType();
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
template <class Functor, class... Args>
|
|
74
|
-
decltype(auto) pgm_type_func_selector(MetaAttribute const* attribute, Functor&& f, Args&&... args) {
|
|
75
|
-
return pgm_type_func_selector(MetaData::attribute_ctype(attribute), std::forward<Functor>(f),
|
|
76
|
-
std::forward<Args>(args)...);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
} // namespace power_grid_model_cpp
|
|
80
|
-
|
|
81
|
-
#endif // POWER_GRID_MODEL_CPP_UTILS_HPP
|
|
1
|
+
// SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
|
|
5
|
+
#pragma once
|
|
6
|
+
|
|
7
|
+
#ifndef POWER_GRID_MODEL_CPP_UTILS_HPP
|
|
8
|
+
#define POWER_GRID_MODEL_CPP_UTILS_HPP
|
|
9
|
+
|
|
10
|
+
#include "basics.hpp"
|
|
11
|
+
#include "handle.hpp"
|
|
12
|
+
#include "meta_data.hpp"
|
|
13
|
+
|
|
14
|
+
#include <array>
|
|
15
|
+
#include <complex>
|
|
16
|
+
#include <limits>
|
|
17
|
+
|
|
18
|
+
namespace power_grid_model_cpp {
|
|
19
|
+
inline bool is_nan(IntS const x) { return x == std::numeric_limits<IntS>::min(); }
|
|
20
|
+
inline bool is_nan(ID const x) { return x == std::numeric_limits<ID>::min(); }
|
|
21
|
+
inline bool is_nan(double const x) { return std::isnan(x); }
|
|
22
|
+
inline bool is_nan(std::complex<double> const& x) { return is_nan(x.real()) || is_nan(x.imag()); }
|
|
23
|
+
inline bool is_nan(std::array<double, 3> const& array) {
|
|
24
|
+
return is_nan(array[0]) || is_nan(array[1]) || is_nan(array[2]);
|
|
25
|
+
}
|
|
26
|
+
inline bool is_nan(std::array<std::complex<double>, 3> const& array) {
|
|
27
|
+
return is_nan(array[0]) || is_nan(array[1]) || is_nan(array[2]);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
constexpr double nan = std::numeric_limits<double>::quiet_NaN();
|
|
31
|
+
constexpr int8_t na_IntS = std::numeric_limits<int8_t>::min();
|
|
32
|
+
constexpr ID na_IntID = std::numeric_limits<ID>::min();
|
|
33
|
+
|
|
34
|
+
template <typename T> constexpr T nan_value() {
|
|
35
|
+
if constexpr (std::is_same_v<T, double>) {
|
|
36
|
+
return nan;
|
|
37
|
+
} else if constexpr (std::is_same_v<T, ID>) {
|
|
38
|
+
return na_IntID;
|
|
39
|
+
} else if constexpr (std::is_same_v<T, int8_t>) {
|
|
40
|
+
return na_IntS;
|
|
41
|
+
} else if constexpr (std::is_same_v<T, std::array<double, 3>>) {
|
|
42
|
+
return std::array<double, 3>{nan, nan, nan};
|
|
43
|
+
} else {
|
|
44
|
+
static_assert(false, "Unsupported type for nan_value");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
class UnsupportedPGM_CType : public PowerGridError {
|
|
49
|
+
public:
|
|
50
|
+
UnsupportedPGM_CType()
|
|
51
|
+
: PowerGridError{[&]() {
|
|
52
|
+
using namespace std::string_literals;
|
|
53
|
+
return "Unsupported PGM_Ctype"s;
|
|
54
|
+
}()} {}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
template <class Functor, class... Args>
|
|
58
|
+
decltype(auto) pgm_type_func_selector(enum PGM_CType type, Functor&& f, Args&&... args) {
|
|
59
|
+
switch (type) {
|
|
60
|
+
case PGM_int32:
|
|
61
|
+
return std::forward<Functor>(f).template operator()<ID>(std::forward<Args>(args)...);
|
|
62
|
+
case PGM_int8:
|
|
63
|
+
return std::forward<Functor>(f).template operator()<IntS>(std::forward<Args>(args)...);
|
|
64
|
+
case PGM_double:
|
|
65
|
+
return std::forward<Functor>(f).template operator()<double>(std::forward<Args>(args)...);
|
|
66
|
+
case PGM_double3:
|
|
67
|
+
return std::forward<Functor>(f).template operator()<std::array<double, 3>>(std::forward<Args>(args)...);
|
|
68
|
+
default:
|
|
69
|
+
throw UnsupportedPGM_CType();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
template <class Functor, class... Args>
|
|
74
|
+
decltype(auto) pgm_type_func_selector(MetaAttribute const* attribute, Functor&& f, Args&&... args) {
|
|
75
|
+
return pgm_type_func_selector(MetaData::attribute_ctype(attribute), std::forward<Functor>(f),
|
|
76
|
+
std::forward<Args>(args)...);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
} // namespace power_grid_model_cpp
|
|
80
|
+
|
|
81
|
+
#endif // POWER_GRID_MODEL_CPP_UTILS_HPP
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
// SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
|
|
2
|
-
//
|
|
3
|
-
// SPDX-License-Identifier: MPL-2.0
|
|
4
|
-
|
|
5
|
-
#pragma once
|
|
6
|
-
#ifndef POWER_GRID_MODEL_CPP_HPP
|
|
7
|
-
#define POWER_GRID_MODEL_CPP_HPP
|
|
8
|
-
|
|
9
|
-
#include "power_grid_model_cpp/basics.hpp"
|
|
10
|
-
#include "power_grid_model_cpp/buffer.hpp"
|
|
11
|
-
#include "power_grid_model_cpp/dataset.hpp"
|
|
12
|
-
#include "power_grid_model_cpp/handle.hpp"
|
|
13
|
-
#include "power_grid_model_cpp/meta_data.hpp"
|
|
14
|
-
#include "power_grid_model_cpp/model.hpp"
|
|
15
|
-
#include "power_grid_model_cpp/options.hpp"
|
|
16
|
-
#include "power_grid_model_cpp/serialization.hpp"
|
|
17
|
-
#include "power_grid_model_cpp/utils.hpp"
|
|
18
|
-
|
|
19
|
-
#endif // POWER_GRID_MODEL_CPP_HPP
|
|
1
|
+
// SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
|
|
5
|
+
#pragma once
|
|
6
|
+
#ifndef POWER_GRID_MODEL_CPP_HPP
|
|
7
|
+
#define POWER_GRID_MODEL_CPP_HPP
|
|
8
|
+
|
|
9
|
+
#include "power_grid_model_cpp/basics.hpp"
|
|
10
|
+
#include "power_grid_model_cpp/buffer.hpp"
|
|
11
|
+
#include "power_grid_model_cpp/dataset.hpp"
|
|
12
|
+
#include "power_grid_model_cpp/handle.hpp"
|
|
13
|
+
#include "power_grid_model_cpp/meta_data.hpp"
|
|
14
|
+
#include "power_grid_model_cpp/model.hpp"
|
|
15
|
+
#include "power_grid_model_cpp/options.hpp"
|
|
16
|
+
#include "power_grid_model_cpp/serialization.hpp"
|
|
17
|
+
#include "power_grid_model_cpp/utils.hpp"
|
|
18
|
+
|
|
19
|
+
#endif // POWER_GRID_MODEL_CPP_HPP
|
|
@@ -9,19 +9,19 @@
|
|
|
9
9
|
# The variable CVF_VERSION must be set before calling configure_file().
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
set(PACKAGE_VERSION "1.
|
|
12
|
+
set(PACKAGE_VERSION "1.12.72")
|
|
13
13
|
|
|
14
14
|
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
|
|
15
15
|
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
|
16
16
|
else()
|
|
17
17
|
|
|
18
|
-
if("1.
|
|
18
|
+
if("1.12.72" MATCHES "^([0-9]+)\\.")
|
|
19
19
|
set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
|
20
20
|
if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
|
|
21
21
|
string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
|
|
22
22
|
endif()
|
|
23
23
|
else()
|
|
24
|
-
set(CVF_VERSION_MAJOR "1.
|
|
24
|
+
set(CVF_VERSION_MAJOR "1.12.72")
|
|
25
25
|
endif()
|
|
26
26
|
|
|
27
27
|
if(PACKAGE_FIND_VERSION_RANGE)
|
|
Binary file
|