From fd3648504759dedbb9681166b72663806059793f Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Thu, 5 Jun 2025 09:15:27 -0400 Subject: [PATCH 1/2] remove default values for `year` --- pvlib/iotools/psm4.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/pvlib/iotools/psm4.py b/pvlib/iotools/psm4.py index 2c3522b952..63481839e7 100644 --- a/pvlib/iotools/psm4.py +++ b/pvlib/iotools/psm4.py @@ -72,7 +72,7 @@ def get_nsrdb_psm4_aggregated(latitude, longitude, api_key, email, - year='2023', time_step=60, + year, time_step=60, parameters=PARAMETERS, leap_day=True, full_name=PVLIB_PYTHON, affiliation=PVLIB_PYTHON, @@ -96,7 +96,7 @@ def get_nsrdb_psm4_aggregated(latitude, longitude, api_key, email, email : str NREL API uses this to automatically communicate messages back to the user only if necessary - year : str, default '2023' + year : int or str PSM4 API parameter specifing year (e.g. ``2023``) to download. The allowed values update periodically, so consult the NSRDB reference below for the current set of options. Called ``names`` in NSRDB API. @@ -314,9 +314,6 @@ def get_nsrdb_psm4_tmy(latitude, longitude, api_key, email, year='tmy', latitude = ('%8.4f' % latitude).strip() # TODO: make format_WKT(object_type, *args) in tools.py - # convert to string to accomodate integer years being passed in - year = str(year) - # convert pvlib names in parameters to PSM4 convention parameters = [REQUEST_VARIABLE_MAP.get(a, a) for a in parameters] @@ -354,7 +351,7 @@ def get_nsrdb_psm4_tmy(latitude, longitude, api_key, email, year='tmy', return read_nsrdb_psm4(fbuf, map_variables) -def get_nsrdb_psm4_conus(latitude, longitude, api_key, email, year='2023', +def get_nsrdb_psm4_conus(latitude, longitude, api_key, email, year, time_step=60, parameters=PARAMETERS, leap_day=True, full_name=PVLIB_PYTHON, affiliation=PVLIB_PYTHON, utc=False, map_variables=True, url=None, timeout=30): @@ -376,7 +373,7 @@ def get_nsrdb_psm4_conus(latitude, longitude, api_key, email, year='2023', email : str NREL API uses this to automatically communicate messages back to the user only if necessary - year : str, default '2023' + year : int or str PSM4 API parameter specifing year (e.g. ``2023``) to download. The allowed values update periodically, so consult the NSRDB reference below for the current set of options. Called ``names`` in NSRDB API. @@ -494,7 +491,7 @@ def get_nsrdb_psm4_conus(latitude, longitude, api_key, email, year='2023', def get_nsrdb_psm4_full_disc(latitude, longitude, api_key, email, - year='2023', time_step=60, + year, time_step=60, parameters=PARAMETERS, leap_day=True, full_name=PVLIB_PYTHON, affiliation=PVLIB_PYTHON, utc=False, @@ -517,7 +514,7 @@ def get_nsrdb_psm4_full_disc(latitude, longitude, api_key, email, email : str NREL API uses this to automatically communicate messages back to the user only if necessary - year : str, default '2023' + year : int or str PSM4 API parameter specifing year (e.g. ``2023``) to download. The allowed values update periodically, so consult the NSRDB reference below for the current set of options. Called ``names`` in NSRDB API. From ef24afcd81af11d7b54e306a39ef7ef907857fea Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Thu, 5 Jun 2025 13:32:38 -0400 Subject: [PATCH 2/2] get rid of `year = str(year)` --- pvlib/iotools/psm4.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/pvlib/iotools/psm4.py b/pvlib/iotools/psm4.py index 63481839e7..44325364c7 100644 --- a/pvlib/iotools/psm4.py +++ b/pvlib/iotools/psm4.py @@ -173,9 +173,6 @@ def get_nsrdb_psm4_aggregated(latitude, longitude, api_key, email, latitude = ('%8.4f' % latitude).strip() # TODO: make format_WKT(object_type, *args) in tools.py - # convert to string to accomodate integer years being passed in - year = str(year) - # convert pvlib names in parameters to PSM4 convention parameters = [REQUEST_VARIABLE_MAP.get(a, a) for a in parameters] @@ -450,9 +447,6 @@ def get_nsrdb_psm4_conus(latitude, longitude, api_key, email, year, latitude = ('%8.4f' % latitude).strip() # TODO: make format_WKT(object_type, *args) in tools.py - # convert to string to accomodate integer years being passed in - year = str(year) - # convert pvlib names in parameters to PSM4 convention parameters = [REQUEST_VARIABLE_MAP.get(a, a) for a in parameters] @@ -592,9 +586,6 @@ def get_nsrdb_psm4_full_disc(latitude, longitude, api_key, email, latitude = ('%8.4f' % latitude).strip() # TODO: make format_WKT(object_type, *args) in tools.py - # convert to string to accomodate integer years being passed in - year = str(year) - # convert pvlib names in parameters to PSM4 convention parameters = [REQUEST_VARIABLE_MAP.get(a, a) for a in parameters]