@@ -59,7 +59,7 @@ def test_clib_read_data_dataset():
59
59
60
60
with Session () as lib :
61
61
ds = lib .read_data (tmpfile .name , kind = "dataset" ).contents
62
- df = ds .to_dataframe (header = 0 )
62
+ df = ds .to_pandas (header = 0 )
63
63
expected_df = pd .DataFrame (
64
64
data = {
65
65
"x" : [1.0 , 4.0 , 7.0 , 10.0 ],
@@ -85,7 +85,7 @@ def test_clib_read_data_grid(expected_xrgrid):
85
85
"""
86
86
with Session () as lib :
87
87
grid = lib .read_data ("@static_earth_relief.nc" , kind = "grid" ).contents
88
- xrgrid = grid .to_dataarray ()
88
+ xrgrid = grid .to_xarray ()
89
89
xr .testing .assert_equal (xrgrid , expected_xrgrid )
90
90
assert grid .header .contents .n_bands == 1 # Explicitly check n_bands
91
91
@@ -113,7 +113,7 @@ def test_clib_read_data_grid_two_steps(expected_xrgrid):
113
113
lib .read_data (infile , kind = "grid" , mode = "GMT_DATA_ONLY" , data = data_ptr )
114
114
115
115
# Full check
116
- xrgrid = data_ptr .contents .to_dataarray ()
116
+ xrgrid = data_ptr .contents .to_xarray ()
117
117
xr .testing .assert_equal (xrgrid , expected_xrgrid )
118
118
119
119
@@ -126,7 +126,7 @@ def test_clib_read_data_grid_actual_image(expected_xrimage):
126
126
# Explicitly check n_bands. Only one band is read for 3-band images.
127
127
assert image .header .contents .n_bands == 1
128
128
129
- xrimage = image .to_dataarray ()
129
+ xrimage = image .to_xarray ()
130
130
assert xrimage .shape == (180 , 360 )
131
131
assert xrimage .coords ["x" ].data .min () == - 179.5
132
132
assert xrimage .coords ["x" ].data .max () == 179.5
@@ -153,7 +153,7 @@ def test_clib_read_data_image(expected_xrimage):
153
153
with Session () as lib :
154
154
image = lib .read_data ("@earth_day_01d" , kind = "image" ).contents
155
155
156
- xrimage = image .to_dataarray ()
156
+ xrimage = image .to_xarray ()
157
157
assert xrimage .shape == (3 , 180 , 360 )
158
158
assert xrimage .coords ["x" ].data .min () == - 179.5
159
159
assert xrimage .coords ["x" ].data .max () == 179.5
@@ -187,7 +187,7 @@ def test_clib_read_data_image_two_steps(expected_xrimage):
187
187
# Read the data
188
188
lib .read_data (infile , kind = "image" , mode = "GMT_DATA_ONLY" , data = data_ptr )
189
189
190
- xrimage = image .to_dataarray ()
190
+ xrimage = image .to_xarray ()
191
191
assert xrimage .shape == (3 , 180 , 360 )
192
192
assert xrimage .coords ["x" ].data .min () == - 179.5
193
193
assert xrimage .coords ["x" ].data .max () == 179.5
0 commit comments