Skip to content
This repository was archived by the owner on Oct 24, 2024. It is now read-only.

Commit 86e9f59

Browse files
Bugfix/fix tests on i386 (#249)
* Fix tests on i386 * Update changelog * Add comment explaining explicit cast --------- Co-authored-by: Tom Nicholas <thomas.nicholas@columbia.edu> Co-authored-by: Tom Nicholas <tom@cworthy.org>
1 parent 89e5a14 commit 86e9f59

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

datatree/tests/test_formatting.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,14 @@ def test_diff_node_names(self):
9090
assert actual == expected
9191

9292
def test_diff_node_data(self):
93-
ds1 = Dataset({"u": 0, "v": 1})
94-
ds3 = Dataset({"w": 5})
93+
import numpy as np
94+
95+
# casting to int64 explicitly ensures that int64s are created on all architectures
96+
ds1 = Dataset({"u": np.int64(0), "v": np.int64(1)})
97+
ds3 = Dataset({"w": np.int64(5)})
9598
dt_1 = DataTree.from_dict({"a": ds1, "a/b": ds3})
96-
ds2 = Dataset({"u": 0})
97-
ds4 = Dataset({"w": 6})
99+
ds2 = Dataset({"u": np.int64(0)})
100+
ds4 = Dataset({"w": np.int64(6)})
98101
dt_2 = DataTree.from_dict({"a": ds2, "a/b": ds4})
99102

100103
expected = dedent(

docs/source/whats-new.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ Deprecations
3939
Bug fixes
4040
~~~~~~~~~
4141

42+
- Fix unittests on i386. (:pull:`249`)
43+
By `Antonio Valentino <https://github.com/avalentino>`_.
4244
- Ensure nodepath class is compatible with python 3.12 (:pull:`260`)
4345
By `Max Grover <https://github.com/mgrover1>`_.
4446

0 commit comments

Comments
 (0)