@@ -74,13 +74,16 @@ def test_request_noaa_data_basic(self):
74
74
and verify that the returned DataFrame and metadata have the
75
75
correct shape and columns.
76
76
"""
77
+ options = {
78
+ "proxy" : None ,
79
+ "write_json" : None ,
80
+ }
77
81
data , metadata = tidal .io .noaa .request_noaa_data (
78
82
station = "s08010" ,
79
83
parameter = "currents" ,
80
84
start_date = "20180101" ,
81
85
end_date = "20180102" ,
82
- proxy = None ,
83
- write_json = None ,
86
+ options = options ,
84
87
)
85
88
self .assertTrue (np .all (data .columns == ["s" , "d" , "b" ]))
86
89
self .assertEqual (data .shape , (183 , 3 ))
@@ -92,14 +95,17 @@ def test_request_noaa_data_basic_xarray(self):
92
95
and verify that the returned DataFrame and metadata have the
93
96
correct shape and columns.
94
97
"""
98
+ options = {
99
+ "proxy" : None ,
100
+ "write_json" : None ,
101
+ "to_pandas" : False ,
102
+ }
95
103
data = tidal .io .noaa .request_noaa_data (
96
104
station = "s08010" ,
97
105
parameter = "currents" ,
98
106
start_date = "20180101" ,
99
107
end_date = "20180102" ,
100
- proxy = None ,
101
- write_json = None ,
102
- to_pandas = False ,
108
+ options = options ,
103
109
)
104
110
# Check if the variable sets are equal
105
111
data_variables = list (data .variables )
@@ -117,13 +123,16 @@ def test_request_noaa_data_write_json(self):
117
123
and can be loaded back into a dictionary.
118
124
"""
119
125
test_json_file = "test_noaa_data.json"
126
+ options = {
127
+ "proxy" : None ,
128
+ "write_json" : test_json_file ,
129
+ }
120
130
_ , _ = tidal .io .noaa .request_noaa_data (
121
131
station = "s08010" ,
122
132
parameter = "currents" ,
123
133
start_date = "20180101" ,
124
134
end_date = "20180102" ,
125
- proxy = None ,
126
- write_json = test_json_file ,
135
+ options = options ,
127
136
)
128
137
self .assertTrue (os .path .isfile (test_json_file ))
129
138
@@ -142,29 +151,35 @@ def test_request_noaa_data_invalid_dates(self):
142
151
Test the request_noaa_data function with an invalid date format
143
152
and verify that it raises a ValueError.
144
153
"""
154
+ options = {
155
+ "proxy" : None ,
156
+ "write_json" : None ,
157
+ }
145
158
with self .assertRaises (ValueError ):
146
159
tidal .io .noaa .request_noaa_data (
147
160
station = "s08010" ,
148
161
parameter = "currents" ,
149
162
start_date = "2018-01-01" , # Invalid date format
150
163
end_date = "20180102" ,
151
- proxy = None ,
152
- write_json = None ,
164
+ options = options ,
153
165
)
154
166
155
167
def test_request_noaa_data_end_before_start (self ):
156
168
"""
157
169
Test the request_noaa_data function with the end date before
158
170
the start date and verify that it raises a ValueError.
159
171
"""
172
+ options = {
173
+ "proxy" : None ,
174
+ "write_json" : None ,
175
+ }
160
176
with self .assertRaises (ValueError ):
161
177
tidal .io .noaa .request_noaa_data (
162
178
station = "s08010" ,
163
179
parameter = "currents" ,
164
180
start_date = "20180102" ,
165
181
end_date = "20180101" , # End date before start date
166
- proxy = None ,
167
- write_json = None ,
182
+ options = options ,
168
183
)
169
184
170
185
0 commit comments