Skip to content

Commit 654d3cf

Browse files
committed
replace 'names' with 'year'
1 parent 1bbe7b0 commit 654d3cf

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

pvlib/iotools/psm4.py

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373

7474

7575
def get_nsrdb_psm4_aggregated(latitude, longitude, api_key, email,
76-
names='2023', time_step=60,
76+
year='2023', time_step=60,
7777
parameters=PARAMETERS, leap_day=True,
7878
full_name=PVLIB_PYTHON,
7979
affiliation=PVLIB_PYTHON,
@@ -97,10 +97,10 @@ def get_nsrdb_psm4_aggregated(latitude, longitude, api_key, email,
9797
email : str
9898
NREL API uses this to automatically communicate messages back
9999
to the user only if necessary
100-
names : str, default '2023'
100+
year : str, default '2023'
101101
PSM4 API parameter specifing year (e.g. ``2023``) to download. The
102102
allowed values update periodically, so consult the NSRDB reference
103-
below for the current set of options.
103+
below for the current set of options. Called ``names`` in NSRDB API.
104104
time_step : int, {60, 30}
105105
time step in minutes, must be 60 or 30 for PSM4 Aggregated. Called
106106
``interval`` in NSRDB API.
@@ -179,7 +179,7 @@ def get_nsrdb_psm4_aggregated(latitude, longitude, api_key, email,
179179
# TODO: make format_WKT(object_type, *args) in tools.py
180180

181181
# convert to string to accomodate integer years being passed in
182-
names = str(names)
182+
year = str(year)
183183

184184
# convert pvlib names in parameters to PSM4 convention
185185
parameters = [REQUEST_VARIABLE_MAP.get(a, a) for a in parameters]
@@ -193,7 +193,7 @@ def get_nsrdb_psm4_aggregated(latitude, longitude, api_key, email,
193193
'reason': PVLIB_PYTHON,
194194
'mailing_list': 'false',
195195
'wkt': 'POINT(%s %s)' % (longitude, latitude),
196-
'names': names,
196+
'names': year,
197197
'attributes': ','.join(parameters),
198198
'leap_day': str(leap_day).lower(),
199199
'utc': str(utc).lower(),
@@ -218,7 +218,7 @@ def get_nsrdb_psm4_aggregated(latitude, longitude, api_key, email,
218218
return parse_nsrdb_psm4(fbuf, map_variables)
219219

220220

221-
def get_nsrdb_psm4_tmy(latitude, longitude, api_key, email, names='tmy',
221+
def get_nsrdb_psm4_tmy(latitude, longitude, api_key, email, year='tmy',
222222
time_step=60, parameters=PARAMETERS, leap_day=False,
223223
full_name=PVLIB_PYTHON, affiliation=PVLIB_PYTHON,
224224
utc=False, map_variables=True, url=None, timeout=30):
@@ -240,10 +240,11 @@ def get_nsrdb_psm4_tmy(latitude, longitude, api_key, email, names='tmy',
240240
email : str
241241
NREL API uses this to automatically communicate messages back
242242
to the user only if necessary
243-
names : str, default 'tmy'
243+
year : str, default 'tmy'
244244
PSM4 API parameter specifing TMY variant to download (e.g. ``'tmy'``
245245
or ``'tgy-2022'``). The allowed values update periodically, so
246246
consult the NSRDB references below for the current set of options.
247+
Called ``names`` in NSRDB API.
247248
time_step : int, {60}
248249
time step in minutes. Must be 60 for typical year requests. Called
249250
``interval`` in NSRDB API.
@@ -322,7 +323,7 @@ def get_nsrdb_psm4_tmy(latitude, longitude, api_key, email, names='tmy',
322323
# TODO: make format_WKT(object_type, *args) in tools.py
323324

324325
# convert to string to accomodate integer years being passed in
325-
names = str(names)
326+
year = str(year)
326327

327328
# convert pvlib names in parameters to PSM4 convention
328329
parameters = [REQUEST_VARIABLE_MAP.get(a, a) for a in parameters]
@@ -336,7 +337,7 @@ def get_nsrdb_psm4_tmy(latitude, longitude, api_key, email, names='tmy',
336337
'reason': PVLIB_PYTHON,
337338
'mailing_list': 'false',
338339
'wkt': 'POINT(%s %s)' % (longitude, latitude),
339-
'names': names,
340+
'names': year,
340341
'attributes': ','.join(parameters),
341342
'leap_day': str(leap_day).lower(),
342343
'utc': str(utc).lower(),
@@ -361,7 +362,7 @@ def get_nsrdb_psm4_tmy(latitude, longitude, api_key, email, names='tmy',
361362
return parse_nsrdb_psm4(fbuf, map_variables)
362363

363364

364-
def get_nsrdb_psm4_conus(latitude, longitude, api_key, email, names='2023',
365+
def get_nsrdb_psm4_conus(latitude, longitude, api_key, email, year='2023',
365366
time_step=60, parameters=PARAMETERS, leap_day=True,
366367
full_name=PVLIB_PYTHON, affiliation=PVLIB_PYTHON,
367368
utc=False, map_variables=True, url=None, timeout=30):
@@ -383,10 +384,10 @@ def get_nsrdb_psm4_conus(latitude, longitude, api_key, email, names='2023',
383384
email : str
384385
NREL API uses this to automatically communicate messages back
385386
to the user only if necessary
386-
names : str, default '2023'
387+
year : str, default '2023'
387388
PSM4 API parameter specifing year (e.g. ``2023``) to download. The
388389
allowed values update periodically, so consult the NSRDB reference
389-
below for the current set of options.
390+
below for the current set of options. Called ``names`` in NSRDB API.
390391
time_step : int, {60, 5, 15, 30}
391392
time step in minutes. Called ``interval`` in NSRDB API.
392393
parameters : list of str, optional
@@ -464,7 +465,7 @@ def get_nsrdb_psm4_conus(latitude, longitude, api_key, email, names='2023',
464465
# TODO: make format_WKT(object_type, *args) in tools.py
465466

466467
# convert to string to accomodate integer years being passed in
467-
names = str(names)
468+
year = str(year)
468469

469470
# convert pvlib names in parameters to PSM4 convention
470471
parameters = [REQUEST_VARIABLE_MAP.get(a, a) for a in parameters]
@@ -478,7 +479,7 @@ def get_nsrdb_psm4_conus(latitude, longitude, api_key, email, names='2023',
478479
'reason': PVLIB_PYTHON,
479480
'mailing_list': 'false',
480481
'wkt': 'POINT(%s %s)' % (longitude, latitude),
481-
'names': names,
482+
'names': year,
482483
'attributes': ','.join(parameters),
483484
'leap_day': str(leap_day).lower(),
484485
'utc': str(utc).lower(),
@@ -504,7 +505,7 @@ def get_nsrdb_psm4_conus(latitude, longitude, api_key, email, names='2023',
504505

505506

506507
def get_nsrdb_psm4_full_disc(latitude, longitude, api_key, email,
507-
names='2023', time_step=60,
508+
year='2023', time_step=60,
508509
parameters=PARAMETERS, leap_day=True,
509510
full_name=PVLIB_PYTHON,
510511
affiliation=PVLIB_PYTHON, utc=False,
@@ -527,10 +528,10 @@ def get_nsrdb_psm4_full_disc(latitude, longitude, api_key, email,
527528
email : str
528529
NREL API uses this to automatically communicate messages back
529530
to the user only if necessary
530-
names : str, default '2023'
531+
year : str, default '2023'
531532
PSM4 API parameter specifing year (e.g. ``2023``) to download. The
532533
allowed values update periodically, so consult the NSRDB reference
533-
below for the current set of options.
534+
below for the current set of options. Called ``names`` in NSRDB API.
534535
time_step : int, {60, 10, 30}
535536
time step in minutes, must be 10, 30 or 60. Called ``interval`` in
536537
NSRDB API.
@@ -609,7 +610,7 @@ def get_nsrdb_psm4_full_disc(latitude, longitude, api_key, email,
609610
# TODO: make format_WKT(object_type, *args) in tools.py
610611

611612
# convert to string to accomodate integer years being passed in
612-
names = str(names)
613+
year = str(year)
613614

614615
# convert pvlib names in parameters to PSM4 convention
615616
parameters = [REQUEST_VARIABLE_MAP.get(a, a) for a in parameters]
@@ -623,7 +624,7 @@ def get_nsrdb_psm4_full_disc(latitude, longitude, api_key, email,
623624
'reason': PVLIB_PYTHON,
624625
'mailing_list': 'false',
625626
'wkt': 'POINT(%s %s)' % (longitude, latitude),
626-
'names': names,
627+
'names': year,
627628
'attributes': ','.join(parameters),
628629
'leap_day': str(leap_day).lower(),
629630
'utc': str(utc).lower(),

0 commit comments

Comments
 (0)