Skip to content

Commit 77c0f81

Browse files
Appease the linter
1 parent c1df9a7 commit 77c0f81

File tree

1 file changed

+132
-134
lines changed

1 file changed

+132
-134
lines changed

pvlib/tests/test_tools.py

Lines changed: 132 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -150,116 +150,116 @@ def test_normalize_max2one(data_in, expected):
150150

151151

152152
@pytest.mark.parametrize(
153-
'input,expected',
154-
[
155-
(
156-
{
157-
"time": datetime(
158-
1974, 6, 22, 18, 30, 15, tzinfo=ZoneInfo("Etc/GMT+5"),
159-
),
160-
"location": location.Location(
161-
43.19262774396091, -77.58782907414867, tz="Etc/GMT+5"
162-
)
163-
},
164-
datetime(1974, 6, 22, 23, 30, 15, tzinfo=ZoneInfo("UTC")),
165-
),
166-
(
167-
{
168-
"time": datetime(1974, 6, 22, 18, 30, 15),
169-
"location": location.Location(
170-
43.19262774396091, -77.58782907414867, tz="Etc/GMT+5"
171-
)
172-
},
173-
datetime(1974, 6, 22, 23, 30, 15, tzinfo=ZoneInfo("UTC")),
174-
),
175-
(
176-
{
177-
"time": pd.DatetimeIndex(
153+
'input,expected',
154+
[
155+
(
156+
{
157+
"time": datetime(
158+
1974, 6, 22, 18, 30, 15, tzinfo=ZoneInfo("Etc/GMT+5"),
159+
),
160+
"location": location.Location(
161+
43.19262774396091, -77.58782907414867, tz="Etc/GMT+5"
162+
)
163+
},
164+
datetime(1974, 6, 22, 23, 30, 15, tzinfo=ZoneInfo("UTC")),
165+
),
166+
(
167+
{
168+
"time": datetime(1974, 6, 22, 18, 30, 15),
169+
"location": location.Location(
170+
43.19262774396091, -77.58782907414867, tz="Etc/GMT+5"
171+
)
172+
},
173+
datetime(1974, 6, 22, 23, 30, 15, tzinfo=ZoneInfo("UTC")),
174+
),
175+
(
176+
{
177+
"time": pd.DatetimeIndex(
178+
["1974-06-22T18:30:15"],
179+
tz=ZoneInfo("Etc/GMT+5"),
180+
),
181+
"location": location.Location(
182+
43.19262774396091, -77.58782907414867, tz="Etc/GMT+5"
183+
)
184+
},
185+
pd.DatetimeIndex(["1974-06-22T23:30:15"], tz=ZoneInfo("UTC")),
186+
),
187+
(
188+
{
189+
"time": pd.DatetimeIndex(["1974-06-22T18:30:15"]),
190+
"location": location.Location(
191+
43.19262774396091, -77.58782907414867, tz="Etc/GMT+5"
192+
)
193+
},
194+
pd.DatetimeIndex(["1974-06-22T23:30:15"], tz=ZoneInfo("UTC")),
195+
),
196+
(
197+
{
198+
"time": pd.Series(
199+
[24.42],
200+
index=pd.DatetimeIndex(
178201
["1974-06-22T18:30:15"],
179202
tz=ZoneInfo("Etc/GMT+5"),
180203
),
181-
"location": location.Location(
182-
43.19262774396091, -77.58782907414867, tz="Etc/GMT+5"
183-
)
184-
},
185-
pd.DatetimeIndex(["1974-06-22T23:30:15"], tz=ZoneInfo("UTC")),
186-
),
187-
(
188-
{
189-
"time": pd.DatetimeIndex(["1974-06-22T18:30:15"]),
190-
"location": location.Location(
191-
43.19262774396091, -77.58782907414867, tz="Etc/GMT+5"
192-
)
193-
},
194-
pd.DatetimeIndex(["1974-06-22T23:30:15"], tz=ZoneInfo("UTC")),
195-
),
196-
(
197-
{
198-
"time": pd.Series(
199-
[24.42],
200-
index=pd.DatetimeIndex(
201-
["1974-06-22T18:30:15"],
202-
tz=ZoneInfo("Etc/GMT+5"),
203-
),
204-
),
205-
"location": location.Location(
206-
43.19262774396091, -77.58782907414867, tz="Etc/GMT+5"
207-
)
208-
},
209-
pd.Series(
210-
[24.42],
211-
pd.DatetimeIndex(["1974-06-22T23:30:15"], tz=ZoneInfo("UTC")),
212204
),
205+
"location": location.Location(
206+
43.19262774396091, -77.58782907414867, tz="Etc/GMT+5"
207+
)
208+
},
209+
pd.Series(
210+
[24.42],
211+
pd.DatetimeIndex(["1974-06-22T23:30:15"], tz=ZoneInfo("UTC")),
213212
),
214-
(
215-
{
216-
"time": pd.Series(
217-
[24.42],
218-
index=pd.DatetimeIndex(["1974-06-22T18:30:15"]),
219-
),
220-
"location": location.Location(
221-
43.19262774396091, -77.58782907414867, tz="Etc/GMT+5"
222-
)
223-
},
224-
pd.Series(
213+
),
214+
(
215+
{
216+
"time": pd.Series(
225217
[24.42],
226-
pd.DatetimeIndex(["1974-06-22T23:30:15"], tz=ZoneInfo("UTC")),
218+
index=pd.DatetimeIndex(["1974-06-22T18:30:15"]),
227219
),
220+
"location": location.Location(
221+
43.19262774396091, -77.58782907414867, tz="Etc/GMT+5"
222+
)
223+
},
224+
pd.Series(
225+
[24.42],
226+
pd.DatetimeIndex(["1974-06-22T23:30:15"], tz=ZoneInfo("UTC")),
228227
),
229-
(
230-
{
231-
"time": pd.DataFrame(
232-
[[24.42]],
233-
index=pd.DatetimeIndex(
234-
["1974-06-22T18:30:15"],
235-
tz=ZoneInfo("Etc/GMT+5"),
236-
),
237-
),
238-
"location": location.Location(
239-
43.19262774396091, -77.58782907414867, tz="Etc/GMT+5"
240-
)
241-
},
242-
pd.DataFrame(
228+
),
229+
(
230+
{
231+
"time": pd.DataFrame(
243232
[[24.42]],
244-
pd.DatetimeIndex(["1974-06-22T23:30:15"], tz=ZoneInfo("UTC")),
233+
index=pd.DatetimeIndex(
234+
["1974-06-22T18:30:15"],
235+
tz=ZoneInfo("Etc/GMT+5"),
236+
),
245237
),
238+
"location": location.Location(
239+
43.19262774396091, -77.58782907414867, tz="Etc/GMT+5"
240+
)
241+
},
242+
pd.DataFrame(
243+
[[24.42]],
244+
pd.DatetimeIndex(["1974-06-22T23:30:15"], tz=ZoneInfo("UTC")),
246245
),
247-
(
248-
{
249-
"time": pd.DataFrame(
250-
[[24.42]],
251-
index=pd.DatetimeIndex(["1974-06-22T18:30:15"]),
252-
),
253-
"location": location.Location(
254-
43.19262774396091, -77.58782907414867, tz="Etc/GMT+5"
255-
)
256-
},
257-
pd.DataFrame(
246+
),
247+
(
248+
{
249+
"time": pd.DataFrame(
258250
[[24.42]],
259-
pd.DatetimeIndex(["1974-06-22T23:30:15"], tz=ZoneInfo("UTC")),
251+
index=pd.DatetimeIndex(["1974-06-22T18:30:15"]),
260252
),
253+
"location": location.Location(
254+
43.19262774396091, -77.58782907414867, tz="Etc/GMT+5"
255+
)
256+
},
257+
pd.DataFrame(
258+
[[24.42]],
259+
pd.DatetimeIndex(["1974-06-22T23:30:15"], tz=ZoneInfo("UTC")),
261260
),
262-
],
261+
),
262+
],
263263
ids=[
264264
"datetime.datetime with tzinfo",
265265
"datetime.datetime",
@@ -280,52 +280,50 @@ def test_localize_to_utc(input, expected):
280280

281281

282282
@pytest.mark.parametrize(
283-
'input,expected',
284-
[
285-
(
286-
{
287-
"time": datetime(1974, 6, 22, 18, 30, 15, tzinfo=ZoneInfo("Etc/GMT+5"))
288-
},
289-
27201.47934027778,
290-
),
291-
(
292-
{
293-
"time": datetime(1974, 6, 22, 23, 30, 15, tzinfo=ZoneInfo("UTC"))
294-
},
295-
27201.47934027778,
296-
),
297-
],
298-
ids=[
299-
"datetime.datetime with tzinfo",
300-
"datetime.datetime",
283+
'input,expected',
284+
[
285+
(
286+
{
287+
"time": datetime(
288+
1974, 6, 22, 18, 30, 15, tzinfo=ZoneInfo("Etc/GMT+5")
289+
)
290+
},
291+
27201.47934027778,
292+
),
293+
(
294+
{
295+
"time": datetime(
296+
1974, 6, 22, 23, 30, 15, tzinfo=ZoneInfo("UTC")
297+
)
298+
},
299+
27201.47934027778,
300+
),
301301
],
302+
ids=["datetime.datetime with tzinfo", "datetime.datetime"],
302303
)
303304
def test_datetime_to_djd(input, expected):
304305
assert tools.datetime_to_djd(input["time"]) == expected
305306

306307

307308
@pytest.mark.parametrize(
308-
'input,expected',
309-
[
310-
(
311-
{
312-
"djd": 27201.47934027778,
313-
"tz": "Etc/GMT+5",
314-
},
315-
datetime(1974, 6, 22, 18, 30, 15, tzinfo=ZoneInfo("Etc/GMT+5")),
316-
),
317-
(
318-
{
319-
"djd": 27201.47934027778,
320-
"tz": None,
321-
},
322-
datetime(1974, 6, 22, 23, 30, 15, tzinfo=ZoneInfo("UTC")),
323-
),
324-
],
325-
ids=[
326-
"djd with tzinfo",
327-
"djd",
309+
'input,expected',
310+
[
311+
(
312+
{
313+
"djd": 27201.47934027778,
314+
"tz": "Etc/GMT+5",
315+
},
316+
datetime(1974, 6, 22, 18, 30, 15, tzinfo=ZoneInfo("Etc/GMT+5")),
317+
),
318+
(
319+
{
320+
"djd": 27201.47934027778,
321+
"tz": None,
322+
},
323+
datetime(1974, 6, 22, 23, 30, 15, tzinfo=ZoneInfo("UTC")),
324+
),
328325
],
326+
ids=["djd with tzinfo", "djd"],
329327
)
330328
def test_djd_to_datetime(input, expected):
331329
if input["tz"] is not None:

0 commit comments

Comments
 (0)