diff --git a/CHANGELOG.md b/CHANGELOG.md index 875f51c9..df352dcf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ In this file noteworthy changes of new releases of pyLife are documented since 2.0.0. +## Unreleased + +### Minor improvments + +* Connectivity information is now transfered from odbserver to odbclient as + ints. + ## pylife-2.1.3 diff --git a/tools/odbclient/src/odbclient/odbclient.py b/tools/odbclient/src/odbclient/odbclient.py index 5efa2f14..7a142665 100644 --- a/tools/odbclient/src/odbclient/odbclient.py +++ b/tools/odbclient/src/odbclient/odbclient.py @@ -226,7 +226,7 @@ def element_connectivity(self, instance_name, elset_name=''): return pd.DataFrame( { 'connectivity': [ - conn[conn >= -0].astype(np.int64).tolist() for conn in connectivity + conn[conn >= -0].tolist() for conn in connectivity ] }, index=pd.Index(index, name='element_id', dtype=np.int64), diff --git a/tools/odbclient/tests/test_odbclient.py b/tools/odbclient/tests/test_odbclient.py index 21665af4..edd5a775 100644 --- a/tools/odbclient/tests/test_odbclient.py +++ b/tools/odbclient/tests/test_odbclient.py @@ -113,6 +113,7 @@ def test_element_connectivity(client): expected.index.names = ["element_id"] result = client.element_connectivity('PART-1-1') + assert isinstance(result.loc[1, "connectivity"][0], int) pd.testing.assert_frame_equal(result, expected) diff --git a/tools/odbserver/odbserver/interface.py b/tools/odbserver/odbserver/interface.py index b8a45702..074b958e 100644 --- a/tools/odbserver/odbserver/interface.py +++ b/tools/odbserver/odbserver/interface.py @@ -76,8 +76,8 @@ def connectivity(self, instance_name, element_set_name): else: raise KeyError(element_set_name) - index = np.empty(len(elements), dtype=np.int) - connectivity = -np.ones((len(elements), 20)) + index = np.empty(len(elements), dtype=np.int64) + connectivity = -np.ones((len(elements), 20), dtype=np.int64) for i, el in enumerate(elements): index[i] = el.label conns = list(el.connectivity)