Skip to content

Commit

Permalink
Transfer the connectivity information from as list of ints
Browse files Browse the repository at this point in the history
Fix #126

Signed-off-by: Johannes Mueller <[email protected]>
  • Loading branch information
johannes-mueller committed Nov 11, 2024
1 parent 1a5cfcc commit 1b258f5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tools/odbclient/src/odbclient/odbclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
1 change: 1 addition & 0 deletions tools/odbclient/tests/test_odbclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions tools/odbserver/odbserver/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1b258f5

Please sign in to comment.