From 33d0832c44eabed665d71a3f7992338eeb727575 Mon Sep 17 00:00:00 2001 From: Laurynas Jagutis Date: Tue, 3 Dec 2024 13:35:22 +0100 Subject: [PATCH 1/5] homogenize Signed-off-by: Laurynas Jagutis --- .../pgm_vnf_converter.hpp} | 6 ++--- .../CMakeLists.txt | 4 ++-- .../include/power_grid_model_io_native_c.h | 2 +- .../power_grid_model_io_native_c/basics.h | 4 ++-- ...nf_pgm_converter.h => pgm_vnf_converter.h} | 24 +++++++++---------- ...gm_converter.cpp => pgm_vnf_converter.cpp} | 14 +++++------ setup.py | 2 +- ...{vnf_converter.py => pgm_vnf_converter.py} | 6 ++--- .../_core/power_grid_model_io_core.py | 6 ++--- tests/c_api_tests/CMakeLists.txt | 2 +- ...r.cpp => test_c_api_pgm_vnf_converter.cpp} | 16 ++++++------- .../cpp_unit_tests/test_pgm_vnf_converter.cpp | 2 +- tests/unit/test_vnf_converter.py | 2 +- 13 files changed, 45 insertions(+), 45 deletions(-) rename power_grid_model_io_native_c/power_grid_model_io_native/include/power_grid_model_io_native/{vnf_converter/vnf_pgm_converter.hpp => pgm_vnf_converter/pgm_vnf_converter.hpp} (97%) rename power_grid_model_io_native_c/power_grid_model_io_native_c/include/power_grid_model_io_native_c/{vnf_pgm_converter.h => pgm_vnf_converter.h} (51%) rename power_grid_model_io_native_c/power_grid_model_io_native_c/src/{vnf_pgm_converter.cpp => pgm_vnf_converter.cpp} (73%) rename src/power_grid_model_io_native/_core/{vnf_converter.py => pgm_vnf_converter.py} (83%) rename tests/c_api_tests/{test_c_api_vnf_converter.cpp => test_c_api_pgm_vnf_converter.cpp} (75%) diff --git a/power_grid_model_io_native_c/power_grid_model_io_native/include/power_grid_model_io_native/vnf_converter/vnf_pgm_converter.hpp b/power_grid_model_io_native_c/power_grid_model_io_native/include/power_grid_model_io_native/pgm_vnf_converter/pgm_vnf_converter.hpp similarity index 97% rename from power_grid_model_io_native_c/power_grid_model_io_native/include/power_grid_model_io_native/vnf_converter/vnf_pgm_converter.hpp rename to power_grid_model_io_native_c/power_grid_model_io_native/include/power_grid_model_io_native/pgm_vnf_converter/pgm_vnf_converter.hpp index ce51ec2..813c6f3 100644 --- a/power_grid_model_io_native_c/power_grid_model_io_native/include/power_grid_model_io_native/vnf_converter/vnf_pgm_converter.hpp +++ b/power_grid_model_io_native_c/power_grid_model_io_native/include/power_grid_model_io_native/pgm_vnf_converter/pgm_vnf_converter.hpp @@ -3,8 +3,8 @@ // SPDX-License-Identifier: MPL-2.0 #pragma once -#ifndef POWER_GRID_MODEL_IO_NATIVE_C_VNF_PGM_CONVERTER_HPP -#define POWER_GRID_MODEL_IO_NATIVE_C_VNF_PGM_CONVERTER_HPP +#ifndef POWER_GRID_MODEL_IO_NATIVE_C_PGM_VNF_CONVERTER_HPP +#define POWER_GRID_MODEL_IO_NATIVE_C_PGM_VNF_CONVERTER_HPP #include #include @@ -178,4 +178,4 @@ inline std::string const& convert_input_wrapper(PgmVnfConverter* obj) { } // namespace power_grid_model_io_native -#endif // POWER_GRID_MODEL_IO_NATIVE_C_VNF_PGM_CONVERTER_HPP +#endif // POWER_GRID_MODEL_IO_NATIVE_C_PGM_VNF_CONVERTER_HPP diff --git a/power_grid_model_io_native_c/power_grid_model_io_native_c/CMakeLists.txt b/power_grid_model_io_native_c/power_grid_model_io_native_c/CMakeLists.txt index 13ea773..7cb7139 100644 --- a/power_grid_model_io_native_c/power_grid_model_io_native_c/CMakeLists.txt +++ b/power_grid_model_io_native_c/power_grid_model_io_native_c/CMakeLists.txt @@ -5,7 +5,7 @@ # C API library add_library(power_grid_model_io_native_c SHARED "src/handle.cpp" - "src/vnf_pgm_converter.cpp" + "src/pgm_vnf_converter.cpp" ) target_include_directories(power_grid_model_io_native_c PUBLIC @@ -16,7 +16,7 @@ target_include_directories(power_grid_model_io_native_c PUBLIC set(PGM_IO_NATIVE_PUBLIC_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/include/power_grid_model_io_native_c/basics.h" "${CMAKE_CURRENT_SOURCE_DIR}/include/power_grid_model_io_native_c/handle.h" - "${CMAKE_CURRENT_SOURCE_DIR}/include/power_grid_model_io_native_c/vnf_pgm_converter.h" + "${CMAKE_CURRENT_SOURCE_DIR}/include/power_grid_model_io_native_c/pgm_vnf_converter.h" "${CMAKE_CURRENT_SOURCE_DIR}/include/power_grid_model_io_native_c.h" ) diff --git a/power_grid_model_io_native_c/power_grid_model_io_native_c/include/power_grid_model_io_native_c.h b/power_grid_model_io_native_c/power_grid_model_io_native_c/include/power_grid_model_io_native_c.h index 6eecc9f..bca7b34 100644 --- a/power_grid_model_io_native_c/power_grid_model_io_native_c/include/power_grid_model_io_native_c.h +++ b/power_grid_model_io_native_c/power_grid_model_io_native_c/include/power_grid_model_io_native_c.h @@ -18,6 +18,6 @@ #include "power_grid_model_io_native_c/basics.h" #include "power_grid_model_io_native_c/handle.h" -#include "power_grid_model_io_native_c/vnf_pgm_converter.h" +#include "power_grid_model_io_native_c/pgm_vnf_converter.h" #endif // POWER_GRID_MODEL_IO_NATIVE_C_H diff --git a/power_grid_model_io_native_c/power_grid_model_io_native_c/include/power_grid_model_io_native_c/basics.h b/power_grid_model_io_native_c/power_grid_model_io_native_c/include/power_grid_model_io_native_c/basics.h index d565c59..60d9292 100644 --- a/power_grid_model_io_native_c/power_grid_model_io_native_c/include/power_grid_model_io_native_c/basics.h +++ b/power_grid_model_io_native_c/power_grid_model_io_native_c/include/power_grid_model_io_native_c/basics.h @@ -65,10 +65,10 @@ typedef int32_t PGM_IO_ID; // typedef struct PGM_IO_VnfConverter PGM_IO_VnfConverter; /** - * @brief Opaque struct for the VnfConverter class. + * @brief Opaque struct for the PgmVnfConverter class. * */ -typedef struct PGM_IO_VnfPgmConverter PGM_IO_VnfPgmConverter; +typedef struct PGM_IO_PgmVnfConverter PGM_IO_PgmVnfConverter; /** * @brief Opaque struct for the handle class. diff --git a/power_grid_model_io_native_c/power_grid_model_io_native_c/include/power_grid_model_io_native_c/vnf_pgm_converter.h b/power_grid_model_io_native_c/power_grid_model_io_native_c/include/power_grid_model_io_native_c/pgm_vnf_converter.h similarity index 51% rename from power_grid_model_io_native_c/power_grid_model_io_native_c/include/power_grid_model_io_native_c/vnf_pgm_converter.h rename to power_grid_model_io_native_c/power_grid_model_io_native_c/include/power_grid_model_io_native_c/pgm_vnf_converter.h index cf72762..a682083 100644 --- a/power_grid_model_io_native_c/power_grid_model_io_native_c/include/power_grid_model_io_native_c/vnf_pgm_converter.h +++ b/power_grid_model_io_native_c/power_grid_model_io_native_c/include/power_grid_model_io_native_c/pgm_vnf_converter.h @@ -3,8 +3,8 @@ // SPDX-License-Identifier: MPL-2.0 #pragma once -#ifndef POWER_GRID_MODEL_IO_NATIVE_C_VNF_PGM_CONVERTER_H -#define POWER_GRID_MODEL_IO_NATIVE_C_VNF_PGM_CONVERTER_H +#ifndef POWER_GRID_MODEL_IO_NATIVE_C_PGM_VNF_CONVERTER_H +#define POWER_GRID_MODEL_IO_NATIVE_C_PGM_VNF_CONVERTER_H #include "basics.h" @@ -13,32 +13,32 @@ extern "C" { #endif /** - * @brief Create the PGM_IO_VnfPgmConverter + * @brief Create the PGM_IO_PgmVnfConverter * @param handle * @param file_buffer A pointer to the null-terminated C string. - * @return The pointer to a PGM_IO_VnfPgmConverter instance. The instance must be freed by + * @return The pointer to a PGM_IO_PgmVnfConverter instance. The instance must be freed by * PGM_IO_destroy_vnf_converter. */ -PGM_IO_API PGM_IO_VnfPgmConverter* PGM_IO_create_vnf_converter(PGM_IO_Handle* handle, char const* file_buffer, +PGM_IO_API PGM_IO_PgmVnfConverter* PGM_IO_create_pgm_vnf_converter(PGM_IO_Handle* handle, char const* file_buffer, PGM_IO_ExperimentalFeatures experimental_features); /** * @brief Retrieve the transformed input data from .vnf format to PGM format * @param handle - * @param converter_ptr A pointer to a PGM_IO_VnfPgmConverter instace. + * @param converter_ptr A pointer to a PGM_IO_PgmVnfConverter instace. * @return The pointer to the json string instance that holds data in PGM format. */ -PGM_IO_API char const* PGM_IO_vnf_pgm_converter_get_input_data(PGM_IO_Handle* handle, - PGM_IO_VnfPgmConverter* converter_ptr); +PGM_IO_API char const* PGM_IO_pgm_vnf_converter_get_input_data(PGM_IO_Handle* handle, + PGM_IO_PgmVnfConverter* converter_ptr); /** - * @brief Destroy the PGM_IO_VnfPgmConverter and free up the memory that was dedicated to it. - * @param converter_ptr A pointer to a PGM_IO_VnfPgmConverter instance. + * @brief Destroy the PGM_IO_PgmVnfConverter and free up the memory that was dedicated to it. + * @param converter_ptr A pointer to a PGM_IO_PgmVnfConverter instance. */ -PGM_IO_API void PGM_IO_destroy_vnf_converter(PGM_IO_VnfPgmConverter* converter_ptr); +PGM_IO_API void PGM_IO_destroy_pgm_vnf_converter(PGM_IO_PgmVnfConverter* converter_ptr); #ifdef __cplusplus } #endif -#endif // POWER_GRID_MODEL_IO_NATIVE_C_VNF_PGM_CONVERTER_H +#endif // POWER_GRID_MODEL_IO_NATIVE_C_PGM_VNF_CONVERTER_H diff --git a/power_grid_model_io_native_c/power_grid_model_io_native_c/src/vnf_pgm_converter.cpp b/power_grid_model_io_native_c/power_grid_model_io_native_c/src/pgm_vnf_converter.cpp similarity index 73% rename from power_grid_model_io_native_c/power_grid_model_io_native_c/src/vnf_pgm_converter.cpp rename to power_grid_model_io_native_c/power_grid_model_io_native_c/src/pgm_vnf_converter.cpp index 52f3c2c..a926518 100644 --- a/power_grid_model_io_native_c/power_grid_model_io_native_c/src/vnf_pgm_converter.cpp +++ b/power_grid_model_io_native_c/power_grid_model_io_native_c/src/pgm_vnf_converter.cpp @@ -5,22 +5,22 @@ #define PGM_IO_DLL_EXPORTS #include -#include +#include #include "handle.hpp" #include -#include +#include #include #include namespace pgm_io = power_grid_model_io_native; -struct PGM_IO_VnfPgmConverter : public pgm_io::PgmVnfConverter { +struct PGM_IO_PgmVnfConverter : public pgm_io::PgmVnfConverter { using PgmVnfConverter::PgmVnfConverter; }; -PGM_IO_VnfPgmConverter* PGM_IO_create_vnf_converter(PGM_IO_Handle* handle, char const* file_buffer, +PGM_IO_PgmVnfConverter* PGM_IO_create_pgm_vnf_converter(PGM_IO_Handle* handle, char const* file_buffer, PGM_IO_ExperimentalFeatures experimental_features) { return call_with_catch( handle, @@ -37,16 +37,16 @@ PGM_IO_VnfPgmConverter* PGM_IO_create_vnf_converter(PGM_IO_Handle* handle, char default: throw power_grid_model::MissingCaseForEnumError{"PGM_IO_create_vnf_converter", experimental_features}; } - auto* converter = new PGM_IO_VnfPgmConverter(file_buffer, experimental_feature); + auto* converter = new PGM_IO_PgmVnfConverter(file_buffer, experimental_feature); parse_vnf_file_wrapper(converter); return converter; }, PGM_IO_regular_error); } -char const* PGM_IO_vnf_pgm_converter_get_input_data(PGM_IO_Handle* handle, PGM_IO_VnfPgmConverter* converter_ptr) { +char const* PGM_IO_pgm_vnf_converter_get_input_data(PGM_IO_Handle* handle, PGM_IO_PgmVnfConverter* converter_ptr) { return call_with_catch( handle, [converter_ptr] { return convert_input_wrapper(converter_ptr).c_str(); }, PGM_IO_regular_error); } -void PGM_IO_destroy_vnf_converter(PGM_IO_VnfPgmConverter* converter_ptr) { delete converter_ptr; } +void PGM_IO_destroy_pgm_vnf_converter(PGM_IO_PgmVnfConverter* converter_ptr) { delete converter_ptr; } diff --git a/setup.py b/setup.py index f52707d..af6e489 100644 --- a/setup.py +++ b/setup.py @@ -178,7 +178,7 @@ def generate_build_ext(pkg_dir: Path, pkg_name: str): libraries: list[str] = [] sources = [ str(pgm_io_c / pgm_io_c / "src" / "handle.cpp"), - str(pgm_io_c / pgm_io_c / "src" / "vnf_pgm_converter.cpp"), + str(pgm_io_c / pgm_io_c / "src" / "pgm_vnf_converter.cpp"), ] # macro define_macros = [ diff --git a/src/power_grid_model_io_native/_core/vnf_converter.py b/src/power_grid_model_io_native/_core/pgm_vnf_converter.py similarity index 83% rename from src/power_grid_model_io_native/_core/vnf_converter.py rename to src/power_grid_model_io_native/_core/pgm_vnf_converter.py index 17b4337..7ca7877 100644 --- a/src/power_grid_model_io_native/_core/vnf_converter.py +++ b/src/power_grid_model_io_native/_core/pgm_vnf_converter.py @@ -23,14 +23,14 @@ def __new__( ): instance = super().__new__(cls) - instance._pgm_vnf_converter = pgmic.create_vnf_converter(string_buffer, experimental_feature) + instance._pgm_vnf_converter = pgmic.create_pgm_vnf_converter(string_buffer, experimental_feature) assert_no_error() return instance def __del__(self): if hasattr(self, "_pgm_vnf_converter"): - pgmic.destroy_vnf_converter(self._pgm_vnf_converter) + pgmic.destroy_pgm_vnf_converter(self._pgm_vnf_converter) def get_pgm_input_data(self): """A function of the PgmVnfConverter class which will convert and return the data in PGM format @@ -38,7 +38,7 @@ def get_pgm_input_data(self): Returns: str: json data in PGM format """ - pgm_data = pgmic.vnf_pgm_converter_get_input_data(self._pgm_vnf_converter) + pgm_data = pgmic.pgm_vnf_converter_get_input_data(self._pgm_vnf_converter) assert_no_error() self._serialized_data = pgm_data return self._serialized_data diff --git a/src/power_grid_model_io_native/_core/power_grid_model_io_core.py b/src/power_grid_model_io_native/_core/power_grid_model_io_core.py index 920360b..18e653c 100644 --- a/src/power_grid_model_io_native/_core/power_grid_model_io_core.py +++ b/src/power_grid_model_io_native/_core/power_grid_model_io_core.py @@ -146,15 +146,15 @@ def error_message(self) -> str: # type: ignore[empty-body] pass # pragma: no cover @make_c_binding - def create_vnf_converter(self, data: str, experim_feature: int) -> PgmVnfConverterPtr: # type: ignore[empty-body] + def create_pgm_vnf_converter(self, data: str, experim_feature: int) -> PgmVnfConverterPtr: # type: ignore[empty-body] pass # pragma: no cover @make_c_binding - def vnf_pgm_converter_get_input_data(self, pgmvnfconverter: PgmVnfConverterPtr) -> str: # type: ignore[empty-body] + def pgm_vnf_converter_get_input_data(self, pgmvnfconverter: PgmVnfConverterPtr) -> str: # type: ignore[empty-body] pass # pragma: no cover @make_c_binding - def destroy_vnf_converter(self, pgmvnfconverter: PgmVnfConverterPtr) -> None: # type: ignore[empty-body] + def destroy_pgm_vnf_converter(self, pgmvnfconverter: PgmVnfConverterPtr) -> None: # type: ignore[empty-body] pass # pragma: no cover diff --git a/tests/c_api_tests/CMakeLists.txt b/tests/c_api_tests/CMakeLists.txt index 80e418f..6b6ac08 100644 --- a/tests/c_api_tests/CMakeLists.txt +++ b/tests/c_api_tests/CMakeLists.txt @@ -5,7 +5,7 @@ set(PROJECT_SOURCES "test_c_api.cpp" "test_entry_point.cpp" - "test_c_api_vnf_converter.cpp" + "test_c_api_pgm_vnf_converter.cpp" ) add_executable(power_grid_model_io_native_c_api_tests ${PROJECT_SOURCES}) diff --git a/tests/c_api_tests/test_c_api_vnf_converter.cpp b/tests/c_api_tests/test_c_api_pgm_vnf_converter.cpp similarity index 75% rename from tests/c_api_tests/test_c_api_vnf_converter.cpp rename to tests/c_api_tests/test_c_api_pgm_vnf_converter.cpp index d7d14be..075cb42 100644 --- a/tests/c_api_tests/test_c_api_vnf_converter.cpp +++ b/tests/c_api_tests/test_c_api_pgm_vnf_converter.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include @@ -22,18 +22,18 @@ TEST_CASE("Test PGM_IO_create_vnf_converter") { SUBCASE("Test PGM_IO_create_vnf_converter without experimental feature flag") { PGM_IO_Handle* handle = PGM_IO_create_handle(); - auto converter = PGM_IO_create_vnf_converter(handle, "", experimental_feature_flag); + auto converter = PGM_IO_create_pgm_vnf_converter(handle, "", experimental_feature_flag); CHECK(PGM_IO_error_code(handle) == PGM_IO_regular_error); - PGM_IO_destroy_vnf_converter(converter); + PGM_IO_destroy_pgm_vnf_converter(converter); PGM_IO_destroy_handle(handle); } SUBCASE("Test PGM_IO_create_vnf_converter with experimental feature flag") { PGM_IO_Handle* handle = PGM_IO_create_handle(); experimental_feature_flag = PGM_IO_experimental_features_enabled; - auto converter = PGM_IO_create_vnf_converter(handle, "", experimental_feature_flag); + auto converter = PGM_IO_create_pgm_vnf_converter(handle, "", experimental_feature_flag); CHECK(converter != nullptr); - PGM_IO_destroy_vnf_converter(converter); + PGM_IO_destroy_pgm_vnf_converter(converter); PGM_IO_destroy_handle(handle); } } @@ -42,14 +42,14 @@ TEST_CASE("Test PGM_IO_get_vnf_input_data") { PGM_IO_Handle* handle = PGM_IO_create_handle(); PGM_IO_ExperimentalFeatures experimental_feature_flag = PGM_IO_experimental_features_enabled; - auto converter = PGM_IO_create_vnf_converter(handle, "", experimental_feature_flag); + auto converter = PGM_IO_create_pgm_vnf_converter(handle, "", experimental_feature_flag); CHECK(converter != nullptr); - auto json_result = PGM_IO_vnf_pgm_converter_get_input_data(handle, converter); + auto json_result = PGM_IO_pgm_vnf_converter_get_input_data(handle, converter); std::string_view json_string = R"({"version":"1.0","type":"input","is_batch":false,"attributes":{},"data":{}})"; CHECK(json_string == json_result); - PGM_IO_destroy_vnf_converter(converter); + PGM_IO_destroy_pgm_vnf_converter(converter); PGM_IO_destroy_handle(handle); } diff --git a/tests/cpp_unit_tests/test_pgm_vnf_converter.cpp b/tests/cpp_unit_tests/test_pgm_vnf_converter.cpp index 245bf50..b9994b5 100644 --- a/tests/cpp_unit_tests/test_pgm_vnf_converter.cpp +++ b/tests/cpp_unit_tests/test_pgm_vnf_converter.cpp @@ -3,7 +3,7 @@ // SPDX-License-Identifier: MPL-2.0 #include -#include +#include #include #include diff --git a/tests/unit/test_vnf_converter.py b/tests/unit/test_vnf_converter.py index 140c9d2..9e8e3c1 100644 --- a/tests/unit/test_vnf_converter.py +++ b/tests/unit/test_vnf_converter.py @@ -5,7 +5,7 @@ import pytest from power_grid_model_io_native._core.error_handling import InvalidArguments, assert_no_error -from power_grid_model_io_native._core.vnf_converter import PgmVnfConverter +from power_grid_model_io_native._core.pgm_vnf_converter import PgmVnfConverter def test_pgmvnfconverter_constructor_without_experimental_features(): From cb439caf96b0656554064953ede65ad2ba006a4b Mon Sep 17 00:00:00 2001 From: Laurynas Jagutis Date: Tue, 3 Dec 2024 13:53:12 +0100 Subject: [PATCH 2/5] make a line shorter Signed-off-by: Laurynas Jagutis --- .../_core/power_grid_model_io_core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/power_grid_model_io_native/_core/power_grid_model_io_core.py b/src/power_grid_model_io_native/_core/power_grid_model_io_core.py index 18e653c..b84df2c 100644 --- a/src/power_grid_model_io_native/_core/power_grid_model_io_core.py +++ b/src/power_grid_model_io_native/_core/power_grid_model_io_core.py @@ -146,7 +146,7 @@ def error_message(self) -> str: # type: ignore[empty-body] pass # pragma: no cover @make_c_binding - def create_pgm_vnf_converter(self, data: str, experim_feature: int) -> PgmVnfConverterPtr: # type: ignore[empty-body] + def create_pgm_vnf_converter(self, data: str, exp_feature: int) -> PgmVnfConverterPtr: # type: ignore[empty-body] pass # pragma: no cover @make_c_binding From c2ebbbf1ba1c4cb22233e397f075a3f9939bc4cb Mon Sep 17 00:00:00 2001 From: Laurynas Jagutis Date: Tue, 3 Dec 2024 13:59:32 +0100 Subject: [PATCH 3/5] reformat Signed-off-by: Laurynas Jagutis --- .../include/power_grid_model_io_native_c/pgm_vnf_converter.h | 4 ++-- .../power_grid_model_io_native_c/src/pgm_vnf_converter.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/power_grid_model_io_native_c/power_grid_model_io_native_c/include/power_grid_model_io_native_c/pgm_vnf_converter.h b/power_grid_model_io_native_c/power_grid_model_io_native_c/include/power_grid_model_io_native_c/pgm_vnf_converter.h index a682083..56d1c2d 100644 --- a/power_grid_model_io_native_c/power_grid_model_io_native_c/include/power_grid_model_io_native_c/pgm_vnf_converter.h +++ b/power_grid_model_io_native_c/power_grid_model_io_native_c/include/power_grid_model_io_native_c/pgm_vnf_converter.h @@ -20,10 +20,10 @@ extern "C" { * PGM_IO_destroy_vnf_converter. */ PGM_IO_API PGM_IO_PgmVnfConverter* PGM_IO_create_pgm_vnf_converter(PGM_IO_Handle* handle, char const* file_buffer, - PGM_IO_ExperimentalFeatures experimental_features); + PGM_IO_ExperimentalFeatures experimental_features); /** - * @brief Retrieve the transformed input data from .vnf format to PGM format + * @brief Retrieve the transformed input data from .vnf format to PGM format. * @param handle * @param converter_ptr A pointer to a PGM_IO_PgmVnfConverter instace. * @return The pointer to the json string instance that holds data in PGM format. diff --git a/power_grid_model_io_native_c/power_grid_model_io_native_c/src/pgm_vnf_converter.cpp b/power_grid_model_io_native_c/power_grid_model_io_native_c/src/pgm_vnf_converter.cpp index a926518..c47c990 100644 --- a/power_grid_model_io_native_c/power_grid_model_io_native_c/src/pgm_vnf_converter.cpp +++ b/power_grid_model_io_native_c/power_grid_model_io_native_c/src/pgm_vnf_converter.cpp @@ -19,9 +19,9 @@ namespace pgm_io = power_grid_model_io_native; struct PGM_IO_PgmVnfConverter : public pgm_io::PgmVnfConverter { using PgmVnfConverter::PgmVnfConverter; }; - +// PGM_IO_PgmVnfConverter* PGM_IO_create_pgm_vnf_converter(PGM_IO_Handle* handle, char const* file_buffer, - PGM_IO_ExperimentalFeatures experimental_features) { + PGM_IO_ExperimentalFeatures experimental_features) { return call_with_catch( handle, [file_buffer, experimental_features] { From 40315d0ef9f8a476efe215a0cda5ebb62b83c4d9 Mon Sep 17 00:00:00 2001 From: Laurynas Jagutis Date: Fri, 6 Dec 2024 15:01:41 +0100 Subject: [PATCH 4/5] remove unused comment, write out full name of var Signed-off-by: Laurynas Jagutis --- .../power_grid_model_io_native_c/src/pgm_vnf_converter.cpp | 2 +- .../_core/power_grid_model_io_core.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/power_grid_model_io_native_c/power_grid_model_io_native_c/src/pgm_vnf_converter.cpp b/power_grid_model_io_native_c/power_grid_model_io_native_c/src/pgm_vnf_converter.cpp index c47c990..78ca0fa 100644 --- a/power_grid_model_io_native_c/power_grid_model_io_native_c/src/pgm_vnf_converter.cpp +++ b/power_grid_model_io_native_c/power_grid_model_io_native_c/src/pgm_vnf_converter.cpp @@ -19,7 +19,7 @@ namespace pgm_io = power_grid_model_io_native; struct PGM_IO_PgmVnfConverter : public pgm_io::PgmVnfConverter { using PgmVnfConverter::PgmVnfConverter; }; -// + PGM_IO_PgmVnfConverter* PGM_IO_create_pgm_vnf_converter(PGM_IO_Handle* handle, char const* file_buffer, PGM_IO_ExperimentalFeatures experimental_features) { return call_with_catch( diff --git a/src/power_grid_model_io_native/_core/power_grid_model_io_core.py b/src/power_grid_model_io_native/_core/power_grid_model_io_core.py index b84df2c..c3a2b23 100644 --- a/src/power_grid_model_io_native/_core/power_grid_model_io_core.py +++ b/src/power_grid_model_io_native/_core/power_grid_model_io_core.py @@ -146,7 +146,7 @@ def error_message(self) -> str: # type: ignore[empty-body] pass # pragma: no cover @make_c_binding - def create_pgm_vnf_converter(self, data: str, exp_feature: int) -> PgmVnfConverterPtr: # type: ignore[empty-body] + def create_pgm_vnf_converter(self, data: str, experimental_features: int) -> PgmVnfConverterPtr: # type: ignore[empty-body] pass # pragma: no cover @make_c_binding From a7591e1f8a895da379a6d9079f021234b25509b8 Mon Sep 17 00:00:00 2001 From: Laurynas Jagutis Date: Tue, 10 Dec 2024 09:18:32 +0100 Subject: [PATCH 5/5] test1 Signed-off-by: Laurynas Jagutis --- .../_core/power_grid_model_io_core.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/power_grid_model_io_native/_core/power_grid_model_io_core.py b/src/power_grid_model_io_native/_core/power_grid_model_io_core.py index c3a2b23..2581ff0 100644 --- a/src/power_grid_model_io_native/_core/power_grid_model_io_core.py +++ b/src/power_grid_model_io_native/_core/power_grid_model_io_core.py @@ -146,7 +146,9 @@ def error_message(self) -> str: # type: ignore[empty-body] pass # pragma: no cover @make_c_binding - def create_pgm_vnf_converter(self, data: str, experimental_features: int) -> PgmVnfConverterPtr: # type: ignore[empty-body] + def create_pgm_vnf_converter( # type: ignore[empty-body] + self, data: str, experimental_features: int + ) -> PgmVnfConverterPtr: pass # pragma: no cover @make_c_binding