power-grid-model 1.12.58__py3-none-win_amd64.whl → 1.12.60__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 -493
- power_grid_model/_core/data_handling.py +141 -141
- power_grid_model/_core/data_types.py +132 -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 +243 -243
- power_grid_model/_core/power_grid_model.py +686 -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/serialization.py +317 -317
- power_grid_model/_core/typing.py +20 -20
- power_grid_model/_core/utils.py +798 -798
- 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 -473
- power_grid_model/validation/__init__.py +25 -25
- power_grid_model/validation/_rules.py +1171 -1171
- 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 -313
- {power_grid_model-1.12.58.dist-info → power_grid_model-1.12.60.dist-info}/METADATA +1 -1
- power_grid_model-1.12.60.dist-info/RECORD +65 -0
- power_grid_model-1.12.58.dist-info/RECORD +0 -65
- {power_grid_model-1.12.58.dist-info → power_grid_model-1.12.60.dist-info}/WHEEL +0 -0
- {power_grid_model-1.12.58.dist-info → power_grid_model-1.12.60.dist-info}/entry_points.txt +0 -0
- {power_grid_model-1.12.58.dist-info → power_grid_model-1.12.60.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
// SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
|
|
2
|
-
//
|
|
3
|
-
// SPDX-License-Identifier: MPL-2.0
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @brief header file which includes buffer functions
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
#pragma once
|
|
11
|
-
#ifndef POWER_GRID_MODEL_C_BUFFER_H
|
|
12
|
-
#define POWER_GRID_MODEL_C_BUFFER_H
|
|
13
|
-
|
|
14
|
-
#include "basics.h"
|
|
15
|
-
|
|
16
|
-
#ifdef __cplusplus
|
|
17
|
-
extern "C" {
|
|
18
|
-
#endif
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* @brief Create a buffer with certain size and component type.
|
|
22
|
-
*
|
|
23
|
-
* You can use this function to allocate a (row-based) component buffer.
|
|
24
|
-
* You can also use your own allocation function to do that
|
|
25
|
-
* with size and alignment obtained from PGM_meta_component_size() and PGM_meta_component_alignment().
|
|
26
|
-
* The buffer created by this function should be freed by PGM_destroy_buffer().
|
|
27
|
-
*
|
|
28
|
-
* It is recommended to call PGM_buffer_set_nan() after you create an input or update buffer.
|
|
29
|
-
* In this way all the attributes will be set to NaN.
|
|
30
|
-
* Additionally, if there is a new optional attribute added in the future,
|
|
31
|
-
* compatibility with your code is guaranteed: that optional attribute will be set to NaN
|
|
32
|
-
* and the default value will be used.
|
|
33
|
-
*
|
|
34
|
-
* @param handle
|
|
35
|
-
* @param component A component pointer.
|
|
36
|
-
* @param size The size of the buffer in terms of number of elements.
|
|
37
|
-
* @return A pointer to the buffer, or NULL if the input is invalid.
|
|
38
|
-
*/
|
|
39
|
-
PGM_API void* PGM_create_buffer(PGM_Handle* handle, PGM_MetaComponent const* component, PGM_Idx size);
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* @brief Destroy the buffer you created using PGM_create_buffer().
|
|
43
|
-
*
|
|
44
|
-
* NOTE: Do not call this function on the buffer you created using your own function.
|
|
45
|
-
*
|
|
46
|
-
* @param ptr The pointer to the buffer created using PGM_create_buffer().
|
|
47
|
-
*/
|
|
48
|
-
PGM_API void PGM_destroy_buffer(void* ptr);
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* @brief Set all the attributes of a buffer to NaN.
|
|
52
|
-
*
|
|
53
|
-
* @param handle
|
|
54
|
-
* @param component A component pointer.
|
|
55
|
-
* @param ptr pointer to buffer, created either by PGM_create_buffer() or your own function.
|
|
56
|
-
* @param buffer_offset The offset in the buffer where you begin to set nan, in terms of number of elements.
|
|
57
|
-
* @param size The size of the buffer in terms of number of elements.
|
|
58
|
-
*/
|
|
59
|
-
PGM_API void PGM_buffer_set_nan(PGM_Handle* handle, PGM_MetaComponent const* component, void* ptr,
|
|
60
|
-
PGM_Idx buffer_offset, PGM_Idx size);
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* @brief Set value of a certain attribute from an array to the component buffer.
|
|
64
|
-
*
|
|
65
|
-
* You can use this function to set value.
|
|
66
|
-
* You can also set value by proper pointer arithmetric and casting,
|
|
67
|
-
* using the offset information returned by PGM_meta_attribute_offset().
|
|
68
|
-
*
|
|
69
|
-
* @param handle
|
|
70
|
-
* @param attribute An attribute pointer.
|
|
71
|
-
* @param buffer_ptr A pointer to the buffer.
|
|
72
|
-
* @param src_ptr A pointer to the source array you want to retrieve the value from.
|
|
73
|
-
* @param buffer_offset The offset in the buffer where you begin to set value, in terms of number of elements
|
|
74
|
-
* @param size The size of the buffer in terms of number of elements.
|
|
75
|
-
* @param src_stride The stride of the source array in bytes.
|
|
76
|
-
* You can set it to -1, the default stride of the size of the attribute type (like sizeof(double)).
|
|
77
|
-
* If you set it to a positive number, the i-th set-value will retrieve the source data at
|
|
78
|
-
* (void const*)((char const*)src_ptr + i * src_stride)
|
|
79
|
-
*/
|
|
80
|
-
PGM_API void PGM_buffer_set_value(PGM_Handle* handle, PGM_MetaAttribute const* attribute, void* buffer_ptr,
|
|
81
|
-
void const* src_ptr, PGM_Idx buffer_offset, PGM_Idx size, PGM_Idx src_stride);
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* @brief Get value of a certain attribute from the component buffer to an array.
|
|
85
|
-
*
|
|
86
|
-
* You can use this function to get value.
|
|
87
|
-
* You can also get value by proper pointer arithmetric and casting,
|
|
88
|
-
* using the offset information returned by PGM_meta_attribute_offset().
|
|
89
|
-
*
|
|
90
|
-
* @param handle
|
|
91
|
-
* @param attribute An attribute pointer.
|
|
92
|
-
* @param buffer_ptr A pointer to the buffer.
|
|
93
|
-
* @param dest_ptr A pointer to the destination array you want to save the value to.
|
|
94
|
-
* @param buffer_offset The offset in the buffer where you begin to get value; in terms of number of elements.
|
|
95
|
-
* @param size The size of the buffer in terms of number of elements.
|
|
96
|
-
* @param dest_stride The stride of the destination array in bytes.
|
|
97
|
-
* You can set it to -1, the default stride of the size of the attribute type (like sizeof(double)).
|
|
98
|
-
* If you set it to a positive number, the i-th get-value will retrieve the source data at
|
|
99
|
-
* (void*)((char*)dest_ptr + i * dest_stride)
|
|
100
|
-
*/
|
|
101
|
-
PGM_API void PGM_buffer_get_value(PGM_Handle* handle, PGM_MetaAttribute const* attribute, void const* buffer_ptr,
|
|
102
|
-
void* dest_ptr, PGM_Idx buffer_offset, PGM_Idx size, PGM_Idx dest_stride);
|
|
103
|
-
|
|
104
|
-
#ifdef __cplusplus
|
|
105
|
-
}
|
|
106
|
-
#endif
|
|
107
|
-
|
|
108
|
-
#endif
|
|
1
|
+
// SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @brief header file which includes buffer functions
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#pragma once
|
|
11
|
+
#ifndef POWER_GRID_MODEL_C_BUFFER_H
|
|
12
|
+
#define POWER_GRID_MODEL_C_BUFFER_H
|
|
13
|
+
|
|
14
|
+
#include "basics.h"
|
|
15
|
+
|
|
16
|
+
#ifdef __cplusplus
|
|
17
|
+
extern "C" {
|
|
18
|
+
#endif
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @brief Create a buffer with certain size and component type.
|
|
22
|
+
*
|
|
23
|
+
* You can use this function to allocate a (row-based) component buffer.
|
|
24
|
+
* You can also use your own allocation function to do that
|
|
25
|
+
* with size and alignment obtained from PGM_meta_component_size() and PGM_meta_component_alignment().
|
|
26
|
+
* The buffer created by this function should be freed by PGM_destroy_buffer().
|
|
27
|
+
*
|
|
28
|
+
* It is recommended to call PGM_buffer_set_nan() after you create an input or update buffer.
|
|
29
|
+
* In this way all the attributes will be set to NaN.
|
|
30
|
+
* Additionally, if there is a new optional attribute added in the future,
|
|
31
|
+
* compatibility with your code is guaranteed: that optional attribute will be set to NaN
|
|
32
|
+
* and the default value will be used.
|
|
33
|
+
*
|
|
34
|
+
* @param handle
|
|
35
|
+
* @param component A component pointer.
|
|
36
|
+
* @param size The size of the buffer in terms of number of elements.
|
|
37
|
+
* @return A pointer to the buffer, or NULL if the input is invalid.
|
|
38
|
+
*/
|
|
39
|
+
PGM_API void* PGM_create_buffer(PGM_Handle* handle, PGM_MetaComponent const* component, PGM_Idx size);
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @brief Destroy the buffer you created using PGM_create_buffer().
|
|
43
|
+
*
|
|
44
|
+
* NOTE: Do not call this function on the buffer you created using your own function.
|
|
45
|
+
*
|
|
46
|
+
* @param ptr The pointer to the buffer created using PGM_create_buffer().
|
|
47
|
+
*/
|
|
48
|
+
PGM_API void PGM_destroy_buffer(void* ptr);
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @brief Set all the attributes of a buffer to NaN.
|
|
52
|
+
*
|
|
53
|
+
* @param handle
|
|
54
|
+
* @param component A component pointer.
|
|
55
|
+
* @param ptr pointer to buffer, created either by PGM_create_buffer() or your own function.
|
|
56
|
+
* @param buffer_offset The offset in the buffer where you begin to set nan, in terms of number of elements.
|
|
57
|
+
* @param size The size of the buffer in terms of number of elements.
|
|
58
|
+
*/
|
|
59
|
+
PGM_API void PGM_buffer_set_nan(PGM_Handle* handle, PGM_MetaComponent const* component, void* ptr,
|
|
60
|
+
PGM_Idx buffer_offset, PGM_Idx size);
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @brief Set value of a certain attribute from an array to the component buffer.
|
|
64
|
+
*
|
|
65
|
+
* You can use this function to set value.
|
|
66
|
+
* You can also set value by proper pointer arithmetric and casting,
|
|
67
|
+
* using the offset information returned by PGM_meta_attribute_offset().
|
|
68
|
+
*
|
|
69
|
+
* @param handle
|
|
70
|
+
* @param attribute An attribute pointer.
|
|
71
|
+
* @param buffer_ptr A pointer to the buffer.
|
|
72
|
+
* @param src_ptr A pointer to the source array you want to retrieve the value from.
|
|
73
|
+
* @param buffer_offset The offset in the buffer where you begin to set value, in terms of number of elements
|
|
74
|
+
* @param size The size of the buffer in terms of number of elements.
|
|
75
|
+
* @param src_stride The stride of the source array in bytes.
|
|
76
|
+
* You can set it to -1, the default stride of the size of the attribute type (like sizeof(double)).
|
|
77
|
+
* If you set it to a positive number, the i-th set-value will retrieve the source data at
|
|
78
|
+
* (void const*)((char const*)src_ptr + i * src_stride)
|
|
79
|
+
*/
|
|
80
|
+
PGM_API void PGM_buffer_set_value(PGM_Handle* handle, PGM_MetaAttribute const* attribute, void* buffer_ptr,
|
|
81
|
+
void const* src_ptr, PGM_Idx buffer_offset, PGM_Idx size, PGM_Idx src_stride);
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @brief Get value of a certain attribute from the component buffer to an array.
|
|
85
|
+
*
|
|
86
|
+
* You can use this function to get value.
|
|
87
|
+
* You can also get value by proper pointer arithmetric and casting,
|
|
88
|
+
* using the offset information returned by PGM_meta_attribute_offset().
|
|
89
|
+
*
|
|
90
|
+
* @param handle
|
|
91
|
+
* @param attribute An attribute pointer.
|
|
92
|
+
* @param buffer_ptr A pointer to the buffer.
|
|
93
|
+
* @param dest_ptr A pointer to the destination array you want to save the value to.
|
|
94
|
+
* @param buffer_offset The offset in the buffer where you begin to get value; in terms of number of elements.
|
|
95
|
+
* @param size The size of the buffer in terms of number of elements.
|
|
96
|
+
* @param dest_stride The stride of the destination array in bytes.
|
|
97
|
+
* You can set it to -1, the default stride of the size of the attribute type (like sizeof(double)).
|
|
98
|
+
* If you set it to a positive number, the i-th get-value will retrieve the source data at
|
|
99
|
+
* (void*)((char*)dest_ptr + i * dest_stride)
|
|
100
|
+
*/
|
|
101
|
+
PGM_API void PGM_buffer_get_value(PGM_Handle* handle, PGM_MetaAttribute const* attribute, void const* buffer_ptr,
|
|
102
|
+
void* dest_ptr, PGM_Idx buffer_offset, PGM_Idx size, PGM_Idx dest_stride);
|
|
103
|
+
|
|
104
|
+
#ifdef __cplusplus
|
|
105
|
+
}
|
|
106
|
+
#endif
|
|
107
|
+
|
|
108
|
+
#endif
|