@@ -21,7 +21,7 @@ def test_surface_input_file():
21
21
Run surface by passing in a filename
22
22
"""
23
23
fname = which ("@tut_ship.xyz" , download = "c" )
24
- output = surface (data = fname , spacing = "5m" , region = " 245/ 255/20/30" )
24
+ output = surface (data = fname , spacing = "5m" , region = [ 245 , 255 , 20 , 30 ] )
25
25
assert isinstance (output , xr .Dataset )
26
26
return output
27
27
@@ -32,7 +32,7 @@ def test_surface_input_data_array():
32
32
"""
33
33
ship_data = load_sample_bathymetry ()
34
34
data = ship_data .values # convert pandas.DataFrame to numpy.ndarray
35
- output = surface (data = data , spacing = "5m" , region = " 245/ 255/20/30" )
35
+ output = surface (data = data , spacing = "5m" , region = [ 245 , 255 , 20 , 30 ] )
36
36
assert isinstance (output , xr .Dataset )
37
37
return output
38
38
@@ -47,7 +47,7 @@ def test_surface_input_xyz():
47
47
y = ship_data .latitude ,
48
48
z = ship_data .bathymetry ,
49
49
spacing = "5m" ,
50
- region = " 245/ 255/20/30" ,
50
+ region = [ 245 , 255 , 20 , 30 ] ,
51
51
)
52
52
assert isinstance (output , xr .Dataset )
53
53
return output
@@ -63,7 +63,7 @@ def test_surface_input_xy_no_z():
63
63
x = ship_data .longitude ,
64
64
y = ship_data .latitude ,
65
65
spacing = "5m" ,
66
- region = " 245/ 255/20/30" ,
66
+ region = [ 245 , 255 , 20 , 30 ] ,
67
67
)
68
68
69
69
@@ -75,7 +75,7 @@ def test_surface_wrong_kind_of_input():
75
75
data = ship_data .bathymetry .to_xarray () # convert pandas.Series to xarray.DataArray
76
76
assert data_kind (data ) == "grid"
77
77
with pytest .raises (GMTInvalidInput ):
78
- surface (data = data , spacing = "5m" , region = " 245/ 255/20/30" )
78
+ surface (data = data , spacing = "5m" , region = [ 245 , 255 , 20 , 30 ] )
79
79
80
80
81
81
def test_surface_with_outfile_param ():
@@ -86,7 +86,7 @@ def test_surface_with_outfile_param():
86
86
data = ship_data .values # convert pandas.DataFrame to numpy.ndarray
87
87
try :
88
88
output = surface (
89
- data = data , spacing = "5m" , region = " 245/ 255/20/30" , outfile = TEMP_GRID
89
+ data = data , spacing = "5m" , region = [ 245 , 255 , 20 , 30 ] , outfile = TEMP_GRID
90
90
)
91
91
assert output is None # check that output is None since outfile is set
92
92
assert os .path .exists (path = TEMP_GRID ) # check that outfile exists at path
@@ -104,7 +104,7 @@ def test_surface_short_aliases():
104
104
ship_data = load_sample_bathymetry ()
105
105
data = ship_data .values # convert pandas.DataFrame to numpy.ndarray
106
106
try :
107
- output = surface (data = data , I = "5m" , R = " 245/ 255/20/30" , G = TEMP_GRID )
107
+ output = surface (data = data , I = "5m" , R = [ 245 , 255 , 20 , 30 ] , G = TEMP_GRID )
108
108
assert output is None # check that output is None since outfile is set
109
109
assert os .path .exists (path = TEMP_GRID ) # check that outfile exists at path
110
110
grid = xr .open_dataset (TEMP_GRID )
0 commit comments