Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Coline PILOQUET <coline.piloquet@rte-france.com>
  • Loading branch information
colinepiloquet committed Jul 26, 2024
1 parent f64b069 commit 29b45d3
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cpp/lib/pybind11
Submodule pybind11 updated 37 files
+1 −1 .github/workflows/configure.yml
+9 −9 .pre-commit-config.yaml
+3 −3 CMakeLists.txt
+1 −1 docs/advanced/embedding.rst
+2 −2 docs/changelog.rst
+3 −3 docs/compiling.rst
+14 −14 include/pybind11/buffer_info.h
+8 −9 include/pybind11/detail/common.h
+3 −2 include/pybind11/detail/descr.h
+4 −4 include/pybind11/detail/internals.h
+4 −4 include/pybind11/detail/type_caster_base.h
+1 −2 include/pybind11/stl_bind.h
+1 −1 pybind11/_version.py
+2 −2 pybind11/setup_helpers.py
+1 −1 pyproject.toml
+3 −3 tests/CMakeLists.txt
+9 −14 tests/test_builtin_casters.cpp
+2 −4 tests/test_call_policies.cpp
+1 −2 tests/test_class.cpp
+3 −3 tests/test_cmake_build/installed_embed/CMakeLists.txt
+3 −3 tests/test_cmake_build/installed_function/CMakeLists.txt
+3 −3 tests/test_cmake_build/installed_target/CMakeLists.txt
+3 −3 tests/test_cmake_build/subdirectory_embed/CMakeLists.txt
+3 −3 tests/test_cmake_build/subdirectory_function/CMakeLists.txt
+3 −3 tests/test_cmake_build/subdirectory_target/CMakeLists.txt
+1 −2 tests/test_copy_move.cpp
+4 −8 tests/test_custom_type_casters.cpp
+15 −27 tests/test_docstring_options.cpp
+2 −4 tests/test_eigen_matrix.cpp
+1 −2 tests/test_eigen_tensor.inl
+9 −9 tests/test_iostream.py
+5 −10 tests/test_kwargs_and_defaults.cpp
+1 −2 tests/test_methods_and_attributes.cpp
+7 −12 tests/test_numpy_array.cpp
+1 −3 tests/test_numpy_dtypes.py
+3 −5 tests/test_stl.cpp
+2 −3 tests/test_stl_binders.cpp
8 changes: 4 additions & 4 deletions tests/test_java_perunit.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,17 @@ def test_dangling_lines_per_unit():

expected = pd.DataFrame(index=pd.Series(name='id', data=['DL']),
columns=['name', 'r', 'x', 'g', 'b', 'p0', 'q0', 'p', 'q', 'i', 'voltage_level_id',
'bus_id', 'connected', 'pairing_key', 'ucte_xnode_code', 'tie_line_id'],
'bus_id', 'connected', 'pairing_key', 'tie_line_id'],
data=[['', 0.1, 0.01, 0.01, 0.001, 0.5, 0.3, 0.5482, 0.3029, 0.6263, 'VL', 'VL_0',
True, '', '', '']])
True, '','']])
dangling_lines = n.get_dangling_lines()
pd.testing.assert_frame_equal(expected, dangling_lines, check_dtype=False, atol=10 ** -4)
n.update_dangling_lines(pd.DataFrame(index=['DL'], columns=['p0', 'q0'], data=[[0.75, 0.25]]))
expected = pd.DataFrame(index=pd.Series(name='id', data=['DL']),
columns=['name', 'r', 'x', 'g', 'b', 'p0', 'q0', 'p', 'q', 'i', 'voltage_level_id',
'bus_id', 'connected', 'pairing_key', 'ucte_xnode_code', 'tie_line_id'],
'bus_id', 'connected', 'pairing_key', 'tie_line_id'],
data=[['', 0.1, 0.01, 0.01, 0.001, 0.75, 0.25, 0.5482, 0.3029, 0.6263, 'VL', 'VL_0',
True, '', '', '']])
True, '', '']])
dangling_lines = n.get_dangling_lines()
pd.testing.assert_frame_equal(expected, dangling_lines, check_dtype=False, atol=10 ** -4)

Expand Down
8 changes: 4 additions & 4 deletions tests/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -992,18 +992,18 @@ def test_dangling_lines():
expected = pd.DataFrame(index=pd.Series(name='id', data=['DL']),
columns=['name', 'r', 'x', 'g', 'b', 'p0', 'q0', 'p', 'q', 'i', 'voltage_level_id',
'bus_id',
'connected', 'pairing_key', 'ucte_xnode_code', 'tie_line_id'],
'connected', 'pairing_key', 'tie_line_id'],
data=[['', 10.0, 1.0, 0.0001, 0.00001, 50.0, 30.0, nan, nan, nan, 'VL', 'VL_0', True,
'', '', '']])
'', '']])
pd.testing.assert_frame_equal(expected, n.get_dangling_lines(), check_dtype=False)
n.update_dangling_lines(
pd.DataFrame(index=['DL'], columns=['r', 'x', 'g', 'b', 'p0', 'q0', 'connected'],
data=[[11.0, 1.1, 0.0002, 0.00002, 40.0, 40.0, False]]))
updated = pd.DataFrame(index=pd.Series(name='id', data=['DL']),
columns=['name', 'r', 'x', 'g', 'b', 'p0', 'q0', 'p', 'q', 'i', 'voltage_level_id',
'bus_id', 'connected', 'pairing_key', 'ucte_xnode_code', 'tie_line_id'],
'bus_id', 'connected', 'pairing_key', 'tie_line_id'],
data=[['', 11.0, 1.1, 0.0002, 0.00002, 40.0, 40.0, nan, nan, nan, 'VL', '', False,
'', '', '']])
'', '']])
pd.testing.assert_frame_equal(updated, n.get_dangling_lines(), check_dtype=False)
n = util.create_dangling_lines_network()
dangling_lines = n.get_dangling_lines(attributes=['bus_breaker_bus_id', 'node'])
Expand Down
4 changes: 2 additions & 2 deletions tests/test_network_elements_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ def test_deprecated_ucte_xnode_code_kwargs():
ucte_xnode_code=['XNODE1', 'XNODE'])
assert 'DL_TEST' in network.get_dangling_lines().index
assert 'DL_TEST2' in network.get_dangling_lines().index
assert 'ucte_xnode_code' in network.get_dangling_lines().columns
assert 'ucte_xnode_code' in network.get_dangling_lines(all_attributes=True).columns


def test_deprecated_ucte_xnode_code_dataframe():
Expand All @@ -939,7 +939,7 @@ def test_deprecated_ucte_xnode_code_dataframe():
index='id'))
assert 'DL_TEST' in network.get_dangling_lines().index
assert 'DL_TEST2' in network.get_dangling_lines().index
assert 'ucte_xnode_code' in network.get_dangling_lines().columns
assert 'ucte_xnode_code' in network.get_dangling_lines(all_attributes=True).columns


def test_3_windings_transformers_creation():
Expand Down
8 changes: 4 additions & 4 deletions tests/test_per_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,17 +199,17 @@ def test_dangling_lines_per_unit():

expected = pd.DataFrame(index=pd.Series(name='id', data=['DL']),
columns=['name', 'r', 'x', 'g', 'b', 'p0', 'q0', 'p', 'q', 'i', 'voltage_level_id',
'bus_id', 'connected', 'pairing_key', 'ucte_xnode_code', 'tie_line_id'],
'bus_id', 'connected', 'pairing_key', 'tie_line_id'],
data=[['', 0.1, 0.01, 0.01, 0.001, 0.5, 0.3, 0.5482, 0.3029, 0.6263, 'VL', 'VL_0',
True, '', '', '']])
True, '', '']])
dangling_lines = n.get_dangling_lines()
pd.testing.assert_frame_equal(expected, dangling_lines, check_dtype=False, atol=10 ** -4)
n.update_dangling_lines(pd.DataFrame(index=['DL'], columns=['p0', 'q0'], data=[[0.75, 0.25]]))
expected = pd.DataFrame(index=pd.Series(name='id', data=['DL']),
columns=['name', 'r', 'x', 'g', 'b', 'p0', 'q0', 'p', 'q', 'i', 'voltage_level_id',
'bus_id', 'connected', 'pairing_key', 'ucte_xnode_code', 'tie_line_id'],
'bus_id', 'connected', 'pairing_key', 'tie_line_id'],
data=[['', 0.1, 0.01, 0.01, 0.001, 0.75, 0.25, 0.5482, 0.3029, 0.6263, 'VL', 'VL_0',
True, '', '', '']])
True, '', '']])
dangling_lines = n.get_dangling_lines()
pd.testing.assert_frame_equal(expected, dangling_lines, check_dtype=False, atol=10 ** -4)

Expand Down

0 comments on commit 29b45d3

Please sign in to comment.