From 8558a4b984ca8dc46a93710a6d9784fd01e4777f Mon Sep 17 00:00:00 2001 From: Antonio Valentino Date: Sat, 1 Jul 2023 12:37:20 +0200 Subject: [PATCH 1/3] Fix tests on i386 --- datatree/tests/test_formatting.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/datatree/tests/test_formatting.py b/datatree/tests/test_formatting.py index d0e3e9fd..11779ffb 100644 --- a/datatree/tests/test_formatting.py +++ b/datatree/tests/test_formatting.py @@ -90,11 +90,13 @@ def test_diff_node_names(self): assert actual == expected def test_diff_node_data(self): - ds1 = Dataset({"u": 0, "v": 1}) - ds3 = Dataset({"w": 5}) + import numpy as np + + ds1 = Dataset({"u": np.int64(0), "v": np.int64(1)}) + ds3 = Dataset({"w": np.int64(5)}) dt_1 = DataTree.from_dict({"a": ds1, "a/b": ds3}) - ds2 = Dataset({"u": 0}) - ds4 = Dataset({"w": 6}) + ds2 = Dataset({"u": np.int64(0)}) + ds4 = Dataset({"w": np.int64(6)}) dt_2 = DataTree.from_dict({"a": ds2, "a/b": ds4}) expected = dedent( From 8d6404b7cfe2608e2a2e659d47222e66cbf42b61 Mon Sep 17 00:00:00 2001 From: Antonio Valentino Date: Sat, 1 Jul 2023 12:40:43 +0200 Subject: [PATCH 2/3] Update changelog --- docs/source/whats-new.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/source/whats-new.rst b/docs/source/whats-new.rst index e44dff08..0b11d6c1 100644 --- a/docs/source/whats-new.rst +++ b/docs/source/whats-new.rst @@ -32,6 +32,8 @@ Deprecations Bug fixes ~~~~~~~~~ +* Fix unittests on i386. + Documentation ~~~~~~~~~~~~~ From 022908877f23766445b9cc26710d579396922337 Mon Sep 17 00:00:00 2001 From: Tom Nicholas Date: Tue, 24 Oct 2023 01:15:46 -0400 Subject: [PATCH 3/3] Add comment explaining explicit cast --- datatree/tests/test_formatting.py | 1 + 1 file changed, 1 insertion(+) diff --git a/datatree/tests/test_formatting.py b/datatree/tests/test_formatting.py index 11779ffb..0f64644c 100644 --- a/datatree/tests/test_formatting.py +++ b/datatree/tests/test_formatting.py @@ -92,6 +92,7 @@ def test_diff_node_names(self): def test_diff_node_data(self): import numpy as np + # casting to int64 explicitly ensures that int64s are created on all architectures ds1 = Dataset({"u": np.int64(0), "v": np.int64(1)}) ds3 = Dataset({"w": np.int64(5)}) dt_1 = DataTree.from_dict({"a": ds1, "a/b": ds3})