Skip to content

Commit e4d3aa4

Browse files
authored
PSM4 get_ functions: remove default values for year (#2471)
* remove default values for `year` * get rid of `year = str(year)`
1 parent d702353 commit e4d3aa4

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

pvlib/iotools/psm4.py

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272

7373

7474
def get_nsrdb_psm4_aggregated(latitude, longitude, api_key, email,
75-
year='2023', time_step=60,
75+
year, time_step=60,
7676
parameters=PARAMETERS, leap_day=True,
7777
full_name=PVLIB_PYTHON,
7878
affiliation=PVLIB_PYTHON,
@@ -96,7 +96,7 @@ def get_nsrdb_psm4_aggregated(latitude, longitude, api_key, email,
9696
email : str
9797
NREL API uses this to automatically communicate messages back
9898
to the user only if necessary
99-
year : str, default '2023'
99+
year : int or str
100100
PSM4 API parameter specifing year (e.g. ``2023``) to download. The
101101
allowed values update periodically, so consult the NSRDB reference
102102
below for the current set of options. Called ``names`` in NSRDB API.
@@ -173,9 +173,6 @@ def get_nsrdb_psm4_aggregated(latitude, longitude, api_key, email,
173173
latitude = ('%8.4f' % latitude).strip()
174174
# TODO: make format_WKT(object_type, *args) in tools.py
175175

176-
# convert to string to accomodate integer years being passed in
177-
year = str(year)
178-
179176
# convert pvlib names in parameters to PSM4 convention
180177
parameters = [REQUEST_VARIABLE_MAP.get(a, a) for a in parameters]
181178

@@ -314,9 +311,6 @@ def get_nsrdb_psm4_tmy(latitude, longitude, api_key, email, year='tmy',
314311
latitude = ('%8.4f' % latitude).strip()
315312
# TODO: make format_WKT(object_type, *args) in tools.py
316313

317-
# convert to string to accomodate integer years being passed in
318-
year = str(year)
319-
320314
# convert pvlib names in parameters to PSM4 convention
321315
parameters = [REQUEST_VARIABLE_MAP.get(a, a) for a in parameters]
322316

@@ -354,7 +348,7 @@ def get_nsrdb_psm4_tmy(latitude, longitude, api_key, email, year='tmy',
354348
return read_nsrdb_psm4(fbuf, map_variables)
355349

356350

357-
def get_nsrdb_psm4_conus(latitude, longitude, api_key, email, year='2023',
351+
def get_nsrdb_psm4_conus(latitude, longitude, api_key, email, year,
358352
time_step=60, parameters=PARAMETERS, leap_day=True,
359353
full_name=PVLIB_PYTHON, affiliation=PVLIB_PYTHON,
360354
utc=False, map_variables=True, url=None, timeout=30):
@@ -376,7 +370,7 @@ def get_nsrdb_psm4_conus(latitude, longitude, api_key, email, year='2023',
376370
email : str
377371
NREL API uses this to automatically communicate messages back
378372
to the user only if necessary
379-
year : str, default '2023'
373+
year : int or str
380374
PSM4 API parameter specifing year (e.g. ``2023``) to download. The
381375
allowed values update periodically, so consult the NSRDB reference
382376
below for the current set of options. Called ``names`` in NSRDB API.
@@ -453,9 +447,6 @@ def get_nsrdb_psm4_conus(latitude, longitude, api_key, email, year='2023',
453447
latitude = ('%8.4f' % latitude).strip()
454448
# TODO: make format_WKT(object_type, *args) in tools.py
455449

456-
# convert to string to accomodate integer years being passed in
457-
year = str(year)
458-
459450
# convert pvlib names in parameters to PSM4 convention
460451
parameters = [REQUEST_VARIABLE_MAP.get(a, a) for a in parameters]
461452

@@ -494,7 +485,7 @@ def get_nsrdb_psm4_conus(latitude, longitude, api_key, email, year='2023',
494485

495486

496487
def get_nsrdb_psm4_full_disc(latitude, longitude, api_key, email,
497-
year='2023', time_step=60,
488+
year, time_step=60,
498489
parameters=PARAMETERS, leap_day=True,
499490
full_name=PVLIB_PYTHON,
500491
affiliation=PVLIB_PYTHON, utc=False,
@@ -517,7 +508,7 @@ def get_nsrdb_psm4_full_disc(latitude, longitude, api_key, email,
517508
email : str
518509
NREL API uses this to automatically communicate messages back
519510
to the user only if necessary
520-
year : str, default '2023'
511+
year : int or str
521512
PSM4 API parameter specifing year (e.g. ``2023``) to download. The
522513
allowed values update periodically, so consult the NSRDB reference
523514
below for the current set of options. Called ``names`` in NSRDB API.
@@ -595,9 +586,6 @@ def get_nsrdb_psm4_full_disc(latitude, longitude, api_key, email,
595586
latitude = ('%8.4f' % latitude).strip()
596587
# TODO: make format_WKT(object_type, *args) in tools.py
597588

598-
# convert to string to accomodate integer years being passed in
599-
year = str(year)
600-
601589
# convert pvlib names in parameters to PSM4 convention
602590
parameters = [REQUEST_VARIABLE_MAP.get(a, a) for a in parameters]
603591

0 commit comments

Comments
 (0)