Skip to content

Commit a3a86ac

Browse files
Merge pull request #127 from boschresearch/126-connectivity-dtype
2 parents 1a5cfcc + 1b258f5 commit a3a86ac

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
In this file noteworthy changes of new releases of pyLife are documented since
44
2.0.0.
55

6+
## Unreleased
7+
8+
### Minor improvments
9+
10+
* Connectivity information is now transfered from odbserver to odbclient as
11+
ints.
12+
613

714
## pylife-2.1.3
815

tools/odbclient/src/odbclient/odbclient.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def element_connectivity(self, instance_name, elset_name=''):
226226
return pd.DataFrame(
227227
{
228228
'connectivity': [
229-
conn[conn >= -0].astype(np.int64).tolist() for conn in connectivity
229+
conn[conn >= -0].tolist() for conn in connectivity
230230
]
231231
},
232232
index=pd.Index(index, name='element_id', dtype=np.int64),

tools/odbclient/tests/test_odbclient.py

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ def test_element_connectivity(client):
113113
expected.index.names = ["element_id"]
114114

115115
result = client.element_connectivity('PART-1-1')
116+
assert isinstance(result.loc[1, "connectivity"][0], int)
116117

117118
pd.testing.assert_frame_equal(result, expected)
118119

tools/odbserver/odbserver/interface.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ def connectivity(self, instance_name, element_set_name):
7676
else:
7777
raise KeyError(element_set_name)
7878

79-
index = np.empty(len(elements), dtype=np.int)
80-
connectivity = -np.ones((len(elements), 20))
79+
index = np.empty(len(elements), dtype=np.int64)
80+
connectivity = -np.ones((len(elements), 20), dtype=np.int64)
8181
for i, el in enumerate(elements):
8282
index[i] = el.label
8383
conns = list(el.connectivity)

0 commit comments

Comments
 (0)