35 lines
1.2 KiB
Diff
35 lines
1.2 KiB
Diff
From f41100ae4202dce5891854143ba3a31f4e2d5a6d Mon Sep 17 00:00:00 2001
|
|
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
|
Date: Tue, 14 Jan 2025 02:46:39 -0500
|
|
Subject: [PATCH 1/2] Fix test_doc_example on big-endian systems
|
|
|
|
... by using a fixed-endian input.
|
|
|
|
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
|
---
|
|
xarray/tests/test_datatree.py | 8 ++++++--
|
|
1 file changed, 6 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/xarray/tests/test_datatree.py b/xarray/tests/test_datatree.py
|
|
index 7b295128..21870050 100644
|
|
--- a/xarray/tests/test_datatree.py
|
|
+++ b/xarray/tests/test_datatree.py
|
|
@@ -1240,8 +1240,12 @@ class TestRepr:
|
|
)
|
|
def test_doc_example(self) -> None:
|
|
# regression test for https://github.com/pydata/xarray/issues/9499
|
|
- time = xr.DataArray(data=["2022-01", "2023-01"], dims="time")
|
|
- stations = xr.DataArray(data=list("abcdef"), dims="station")
|
|
+ time = xr.DataArray(
|
|
+ data=np.array(["2022-01", "2023-01"], dtype="<U7"), dims="time"
|
|
+ )
|
|
+ stations = xr.DataArray(
|
|
+ data=np.array(list("abcdef"), dtype="<U1"), dims="station"
|
|
+ )
|
|
lon = [-100, -80, -60]
|
|
lat = [10, 20, 30]
|
|
# Set up fake data
|
|
--
|
|
2.47.0
|
|
|