From 4902b20446515f685a346969ea934d1b4c57bae5 Mon Sep 17 00:00:00 2001 From: mayor Date: Mon, 2 Mar 2026 17:27:52 -0800 Subject: [PATCH 01/10] Migrate NREL references to NLR (National Laboratory of the Rockies) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update all nrel.gov URLs to nlr.gov equivalents following the NREL→NLR rename (Dec 2025). The nrel.gov domain stops resolving May 29, 2026. - Update API base URLs in psm4.py and midc.py (critical runtime paths) - Add NLR_API_KEY env var support with NREL_API_KEY deprecation fallback - Update all documentation URLs, prose references, and test comments - Preserve report IDs (NREL/TP-xxx), GitHub URLs, and citation publishers Closes #2701 Co-Authored-By: Claude Opus 4.6 --- .github/workflows/pytest-remote-data.yml | 1 + .../plot_diffuse_fraction.py | 6 +- .../spectrum/average_photon_energy.py | 4 +- .../examples/spectrum/plot_spectrl2_fig51A.py | 6 +- docs/sphinx/source/reference/iotools.rst | 2 +- .../sphinx/source/reference/solarposition.rst | 2 +- .../getting_started/installation.rst | 10 +- docs/sphinx/source/whatsnew/v0.15.1.rst | 4 + docs/tutorials/tmy_to_power.ipynb | 16 +-- pvlib/atmosphere.py | 2 +- pvlib/bifacial/infinite_sheds.py | 2 +- pvlib/clearsky.py | 14 +-- pvlib/inverter.py | 8 +- pvlib/iotools/midc.py | 16 +-- pvlib/iotools/psm4.py | 100 +++++++++--------- pvlib/iotools/tmy.py | 2 +- pvlib/irradiance.py | 8 +- pvlib/pvsystem.py | 18 ++-- pvlib/shading.py | 10 +- pvlib/snow.py | 10 +- pvlib/solarposition.py | 28 ++--- pvlib/spa.py | 10 +- pvlib/spa_c_files/README.md | 12 +-- pvlib/spectrum/irradiance.py | 8 +- pvlib/spectrum/mismatch.py | 2 +- pvlib/spectrum/spectrl2.py | 8 +- pvlib/tracking.py | 6 +- tests/conftest.py | 29 +++-- tests/iotools/test_midc.py | 2 +- tests/iotools/test_tmy.py | 2 +- tests/spectrum/test_spectrl2.py | 2 +- tests/test_shading.py | 4 +- tests/test_solarposition.py | 14 +-- tests/test_temperature.py | 2 +- tests/test_tracking.py | 2 +- 35 files changed, 187 insertions(+), 185 deletions(-) diff --git a/.github/workflows/pytest-remote-data.yml b/.github/workflows/pytest-remote-data.yml index 66fda9cdea..dc7346ea65 100644 --- a/.github/workflows/pytest-remote-data.yml +++ b/.github/workflows/pytest-remote-data.yml @@ -96,6 +96,7 @@ jobs: shell: bash -l {0} # necessary for conda env to be active env: # copy GitHub Secrets into environment variables for the tests to access + NLR_API_KEY: ${{ secrets.NRELAPIKEY }} NREL_API_KEY: ${{ secrets.NRELAPIKEY }} SOLARANYWHERE_API_KEY: ${{ secrets.SOLARANYWHERE_API_KEY }} BSRN_FTP_USERNAME: ${{ secrets.BSRN_FTP_USERNAME }} diff --git a/docs/examples/irradiance-decomposition/plot_diffuse_fraction.py b/docs/examples/irradiance-decomposition/plot_diffuse_fraction.py index 7eb11a53f5..8329b5e543 100644 --- a/docs/examples/irradiance-decomposition/plot_diffuse_fraction.py +++ b/docs/examples/irradiance-decomposition/plot_diffuse_fraction.py @@ -52,7 +52,7 @@ # ---- # # DISC :py:func:`~pvlib.irradiance.disc` is an empirical correlation developed -# at SERI (now NREL) in 1987. The direct normal irradiance (DNI) is related to +# at SERI (now NLR) in 1987. The direct normal irradiance (DNI) is related to # clearness index (kt) by two polynomials split at kt = 0.6, then combined with # an exponential relation with airmass. @@ -216,5 +216,5 @@ # correlations, which include additional variables such as airmass. These # methods seem to reduce DNI spikes over 1000 [W/m^2]. # -# .. _TMY3: https://www.nrel.gov/docs/fy08osti/43156.pdf -# .. _NSRDB: https://www.nrel.gov/docs/fy12osti/54824.pdf +# .. _TMY3: https://www.nlr.gov/docs/fy08osti/43156.pdf +# .. _NSRDB: https://www.nlr.gov/docs/fy12osti/54824.pdf diff --git a/docs/examples/spectrum/average_photon_energy.py b/docs/examples/spectrum/average_photon_energy.py index e4b8ef4cc7..a9d8e5c0c8 100644 --- a/docs/examples/spectrum/average_photon_energy.py +++ b/docs/examples/spectrum/average_photon_energy.py @@ -34,7 +34,7 @@ from scipy.integrate import trapezoid from pvlib import spectrum, solarposition, irradiance, atmosphere -lat, lon = 39.742, -105.18 # NREL SRRL location +lat, lon = 39.742, -105.18 # NLR SRRL location surface_tilt = 25 surface_azimuth = 180 # south-facing system pressure = 81190 # at 1828 metres AMSL, roughly @@ -194,5 +194,5 @@ # for the solar spectral influence on photovoltaic device performance." # Energy 286 :doi:`10.1016/j.energy.2023.129461` # .. [4] Bird Simple Spectral Model: spectrl2_2.c -# https://www.nrel.gov/grid/solar-resource/spectral.html +# https://www.nlr.gov/grid/solar-resource/spectral.html # (Last accessed: 18/09/2024) diff --git a/docs/examples/spectrum/plot_spectrl2_fig51A.py b/docs/examples/spectrum/plot_spectrl2_fig51A.py index 0a921aaf79..00a8c06672 100644 --- a/docs/examples/spectrum/plot_spectrl2_fig51A.py +++ b/docs/examples/spectrum/plot_spectrl2_fig51A.py @@ -2,7 +2,7 @@ Modeling Spectral Irradiance ============================ -Recreating Figure 5-1A from the SPECTRL2 NREL Technical Report. +Recreating Figure 5-1A from the SPECTRL2 NLR Technical Report. """ # %% @@ -10,7 +10,7 @@ # based on atmospheric conditions. The spectral distribution of irradiance is # the power content at each wavelength band in the solar spectrum and is # affected by various scattering and absorption mechanisms in the atmosphere. -# This example recreates an example figure from the SPECTRL2 NREL Technical +# This example recreates an example figure from the SPECTRL2 NLR Technical # Report [1]_. The figure shows modeled spectra at hourly intervals across # a single morning. @@ -95,5 +95,5 @@ # ---------- # .. [1] Bird, R, and Riordan, C., 1984, "Simple solar spectral model for # direct and diffuse irradiance on horizontal and tilted planes at the -# earth's surface for cloudless atmospheres", NREL Technical Report +# earth's surface for cloudless atmospheres", NLR Technical Report # TR-215-2436 :doi:`10.2172/5986936` diff --git a/docs/sphinx/source/reference/iotools.rst b/docs/sphinx/source/reference/iotools.rst index 1461534a4c..b2b306eaf1 100644 --- a/docs/sphinx/source/reference/iotools.rst +++ b/docs/sphinx/source/reference/iotools.rst @@ -179,7 +179,7 @@ A solar radiation network in the USA, run by NOAA. MIDC ^^^^ -A solar radiation network in the USA, run by NREL. +A solar radiation network in the USA, run by NLR. .. autosummary:: :toctree: generated/ diff --git a/docs/sphinx/source/reference/solarposition.rst b/docs/sphinx/source/reference/solarposition.rst index dbe93d5392..f642ff411b 100644 --- a/docs/sphinx/source/reference/solarposition.rst +++ b/docs/sphinx/source/reference/solarposition.rst @@ -43,7 +43,7 @@ Functions for calculating sunrise, sunset and transit times. solarposition.sun_rise_set_transit_geometric -The spa module contains the implementation of the built-in NREL SPA +The spa module contains the implementation of the built-in NLR SPA algorithm. .. autosummary:: diff --git a/docs/sphinx/source/user_guide/getting_started/installation.rst b/docs/sphinx/source/user_guide/getting_started/installation.rst index 8212c5b251..955f5c9ac3 100644 --- a/docs/sphinx/source/user_guide/getting_started/installation.rst +++ b/docs/sphinx/source/user_guide/getting_started/installation.rst @@ -235,22 +235,22 @@ Alternatively, users may install all optional dependencies using .. _nrelspa: -NREL SPA algorithm +NLR SPA algorithm ------------------ pvlib-python is distributed with several validated, high-precision, and high-performance solar position calculators. We strongly recommend using the built-in solar position calculators. -pvlib-python also includes unsupported wrappers for the official NREL -SPA algorithm. NREL's license does not allow redistribution of the +pvlib-python also includes unsupported wrappers for the official NLR +SPA algorithm. NLR's license does not allow redistribution of the source code, so you must jump through some hoops to use it with pvlib. You will need a C compiler to use this code. -To install the NREL SPA algorithm for use with pvlib: +To install the NLR SPA algorithm for use with pvlib: #. Download the pvlib repository (as described in :ref:`obtainsource`) -#. Download the `SPA files from NREL `_ +#. Download the `SPA files from NLR `_ #. Copy the SPA files into ``pvlib-python/pvlib/spa_c_files`` #. From the ``pvlib-python`` directory, run ``pip uninstall pvlib`` followed by ``pip install .`` diff --git a/docs/sphinx/source/whatsnew/v0.15.1.rst b/docs/sphinx/source/whatsnew/v0.15.1.rst index 83b13d01f0..b43d143240 100644 --- a/docs/sphinx/source/whatsnew/v0.15.1.rst +++ b/docs/sphinx/source/whatsnew/v0.15.1.rst @@ -56,6 +56,10 @@ Requirements Maintenance ~~~~~~~~~~~ +* Update all NREL references to NLR (National Laboratory of the Rockies) + following the laboratory rename and domain migration from ``nrel.gov`` + to ``nlr.gov``. Add ``NLR_API_KEY`` environment variable support with + ``NREL_API_KEY`` fallback. (:issue:`2701`) Contributors diff --git a/docs/tutorials/tmy_to_power.ipynb b/docs/tutorials/tmy_to_power.ipynb index ae8fa43eb0..979f8a129e 100644 --- a/docs/tutorials/tmy_to_power.ipynb +++ b/docs/tutorials/tmy_to_power.ipynb @@ -70,11 +70,7 @@ { "cell_type": "markdown", "metadata": {}, - "source": [ - "pvlib comes with a couple of TMY files, and we'll use one of them for simplicity. You could also load a file from disk, or specify a url. See this NREL website for a list of TMY files:\n", - "\n", - "http://rredc.nrel.gov/solar/old_data/nsrdb/1991-2005/tmy3/by_state_and_city.html" - ] + "source": "pvlib comes with a couple of TMY files, and we'll use one of them for simplicity. You could also load a file from disk, or specify a url. See this NLR website for a list of TMY files:\n\nhttp://rredc.nlr.gov/solar/old_data/nsrdb/1991-2005/tmy3/by_state_and_city.html" }, { "cell_type": "code", @@ -1515,13 +1511,7 @@ { "cell_type": "markdown", "metadata": {}, - "source": [ - "Next, we will assume that the SAPM model is representative of the real world performance so that we can use scipy's optimization routine to derive simulated PVUSA coefficients. You will need to install scipy to run these functions.\n", - "\n", - "Here's one PVUSA reference:\n", - "\n", - "http://www.nrel.gov/docs/fy09osti/45376.pdf\n" - ] + "source": "Next, we will assume that the SAPM model is representative of the real world performance so that we can use scipy's optimization routine to derive simulated PVUSA coefficients. You will need to install scipy to run these functions.\n\nHere's one PVUSA reference:\n\nhttp://www.nlr.gov/docs/fy09osti/45376.pdf\n" }, { "cell_type": "code", @@ -1667,4 +1657,4 @@ }, "nbformat": 4, "nbformat_minor": 4 -} +} \ No newline at end of file diff --git a/pvlib/atmosphere.py b/pvlib/atmosphere.py index dcd34da6bc..f17a8e5866 100644 --- a/pvlib/atmosphere.py +++ b/pvlib/atmosphere.py @@ -448,7 +448,7 @@ def bird_hulstrom80_aod_bb(aod380, aod500): References ---------- .. [1] Bird and Hulstrom, "Direct Insolation Models" (1980) - `SERI/TR-335-344 `_ + `SERI/TR-335-344 `_ .. [2] R. E. Bird and R. L. Hulstrom, "Review, Evaluation, and Improvement of Direct Irradiance Models", Journal of Solar Energy Engineering diff --git a/pvlib/bifacial/infinite_sheds.py b/pvlib/bifacial/infinite_sheds.py index be9f426fdd..12b15fba76 100644 --- a/pvlib/bifacial/infinite_sheds.py +++ b/pvlib/bifacial/infinite_sheds.py @@ -166,7 +166,7 @@ def _shaded_fraction(solar_zenith, solar_azimuth, surface_tilt, :doi:`10.1109/PVSC40753.2019.8980572`. .. [2] Kevin Anderson and Mark Mikofski, "Slope-Aware Backtracking for Single-Axis Trackers", Technical Report NREL/TP-5K00-76626, July 2020. - https://www.nrel.gov/docs/fy20osti/76626.pdf + https://www.nlr.gov/docs/fy20osti/76626.pdf """ tan_phi = utils._solar_projection_tangent( solar_zenith, solar_azimuth, surface_azimuth) diff --git a/pvlib/clearsky.py b/pvlib/clearsky.py index 8cc867e020..2f8da611e9 100644 --- a/pvlib/clearsky.py +++ b/pvlib/clearsky.py @@ -942,7 +942,7 @@ def bird(zenith, airmass_relative, aod380, aod500, precipitable_water, """ Bird Simple Clear Sky Broadband Solar Radiation Model - Based on NREL Excel implementation by Daryl R. Myers [1, 2]. + Based on NLR Excel implementation by Daryl R. Myers [1, 2]. Bird and Hulstrom define the zenith as the "angle between a line to the sun and the local zenith". There is no distinction in the paper @@ -953,7 +953,7 @@ def bird(zenith, airmass_relative, aod380, aod500, precipitable_water, was to compare existing clear sky models with "rigorous radiative transfer models" (RTM) it is possible that apparent zenith was obtained as output from the RTM. However, the implementation presented - in PVLIB is tested against the NREL Excel implementation by Daryl + in PVLIB is tested against the NLR Excel implementation by Daryl Myers which uses an analytical expression for solar zenith instead of apparent zenith. @@ -1001,13 +1001,13 @@ def bird(zenith, airmass_relative, aod380, aod500, precipitable_water, .. [2] Daryl R. Myers, "Solar Radiation: Practical Modeling for Renewable Energy Applications", pp. 46-51 CRC Press (2013) - .. [3] `NREL Bird Clear Sky Model `_ + .. [3] `NLR Bird Clear Sky Model `_ - .. [4] `SERI/TR-642-761 `_ + .. [4] `SERI/TR-642-761 `_ - .. [5] `Error Reports `_ + .. [5] `Error Reports `_ """ etr = dni_extra # extraradiation ze_rad = np.deg2rad(zenith) # zenith in radians diff --git a/pvlib/inverter.py b/pvlib/inverter.py index a6a80863eb..21d24a84fe 100644 --- a/pvlib/inverter.py +++ b/pvlib/inverter.py @@ -117,7 +117,7 @@ def sandia(v_dc, p_dc, inverter): for Grid-Connected Photovoltaic Inverters", Sandia National Laboratories, Albuquerque, N.M., USA, SAND2007-5036, Sept. 2007. :doi:`10.2172/920449` - .. [2] System Advisor Model web page. https://sam.nrel.gov. + .. [2] System Advisor Model web page. https://sam.nlr.gov. See also -------- @@ -335,7 +335,7 @@ def adr(v_dc, p_dc, inverter, vtol=0.10): def pvwatts(pdc, pdc0, eta_inv_nom=0.96, eta_inv_ref=0.9637): r""" - NREL's PVWatts inverter model. + NLR's PVWatts inverter model. The PVWatts inverter model [1]_ calculates inverter efficiency :math:`\eta` as a function of input DC power :math:`P_{dc}` @@ -388,7 +388,7 @@ def pvwatts(pdc, pdc0, eta_inv_nom=0.96, eta_inv_ref=0.9637): References ---------- - .. [1] A. P. Dobos, "PVWatts Version 5 Manual", NREL, Golden, CO, USA, + .. [1] A. P. Dobos, "PVWatts Version 5 Manual", NLR, Golden, CO, USA, Technical Report NREL/TP-6A20-62641, 2014, :doi:`10.2172/1158421`. """ @@ -414,7 +414,7 @@ def pvwatts(pdc, pdc0, eta_inv_nom=0.96, eta_inv_ref=0.9637): def pvwatts_multi(pdc, pdc0, eta_inv_nom=0.96, eta_inv_ref=0.9637): r""" - Extend NREL's PVWatts inverter model for multiple MPP inputs. + Extend NLR's PVWatts inverter model for multiple MPP inputs. DC input power is summed over MPP inputs to obtain the DC power input to the PVWatts inverter model. See :py:func:`pvlib.inverter.pvwatts` diff --git a/pvlib/iotools/midc.py b/pvlib/iotools/midc.py index c0dfd370eb..e2fe435125 100644 --- a/pvlib/iotools/midc.py +++ b/pvlib/iotools/midc.py @@ -1,4 +1,4 @@ -"""Functions to read NREL MIDC data. +"""Functions to read NLR MIDC data. """ import io @@ -15,7 +15,7 @@ # # In particular, these mappings coincide with the raw ddata files. # All site's field list can be found at: -# https://midcdmz.nrel.gov/apps/daily.pl?site=&live=1 +# https://midcdmz.nlr.gov/apps/daily.pl?site=&live=1 # Where id is the key found in this dictionary MIDC_VARIABLE_MAP = { 'BMS': { @@ -158,7 +158,7 @@ def _format_index_raw(data): def read_midc(filename, variable_map={}, raw_data=False, **kwargs): - """Read in National Renewable Energy Laboratory Measurement and + """Read in National Laboratory of the Rockies Measurement and Instrumentation Data Center weather data. The MIDC is described in [1]_. Parameters @@ -196,12 +196,12 @@ def read_midc(filename, variable_map={}, raw_data=False, **kwargs): :ref:`nomenclature`. Be sure to check the units for the variables you will use on the - `MIDC site `_. + `MIDC site `_. References ---------- - .. [1] NREL: Measurement and Instrumentation Data Center - `https://midcdmz.nrel.gov/ `_ + .. [1] NLR: Measurement and Instrumentation Data Center + `https://midcdmz.nlr.gov/ `_ """ data = pd.read_csv(filename, **kwargs) if raw_data: @@ -248,13 +248,13 @@ def read_midc_raw_data_from_nrel(site, start, end, variable_map={}, ----- Requests spanning an instrumentation change will yield an error. See the MIDC raw data api page - `here `_ + `here `_ for more details and considerations. """ args = {'site': site, 'begin': pd.to_datetime(start).strftime('%Y%m%d'), 'end': pd.to_datetime(end).strftime('%Y%m%d')} - url = 'https://midcdmz.nrel.gov/apps/data_api.pl' + url = 'https://midcdmz.nlr.gov/apps/data_api.pl' # NOTE: just use requests.get(url, params=args) to build querystring # number of header columns and data columns do not always match, # so first parse the header to determine the number of data columns diff --git a/pvlib/iotools/psm4.py b/pvlib/iotools/psm4.py index ecab84fd21..9eb760f382 100644 --- a/pvlib/iotools/psm4.py +++ b/pvlib/iotools/psm4.py @@ -1,9 +1,9 @@ """ Functions for reading and retrieving data from NSRDB PSM4. See: -https://developer.nrel.gov/docs/solar/nsrdb/nsrdb-GOES-aggregated-v4-0-0-download/ -https://developer.nrel.gov/docs/solar/nsrdb/nsrdb-GOES-tmy-v4-0-0-download/ -https://developer.nrel.gov/docs/solar/nsrdb/nsrdb-GOES-conus-v4-0-0-download/ -https://developer.nrel.gov/docs/solar/nsrdb/nsrdb-GOES-full-disc-v4-0-0-download/ +https://developer.nlr.gov/docs/solar/nsrdb/nsrdb-GOES-aggregated-v4-0-0-download/ +https://developer.nlr.gov/docs/solar/nsrdb/nsrdb-GOES-tmy-v4-0-0-download/ +https://developer.nlr.gov/docs/solar/nsrdb/nsrdb-GOES-conus-v4-0-0-download/ +https://developer.nlr.gov/docs/solar/nsrdb/nsrdb-GOES-full-disc-v4-0-0-download/ """ import io @@ -13,7 +13,7 @@ from json import JSONDecodeError from pvlib import tools -NSRDB_API_BASE = "https://developer.nrel.gov/api/nsrdb/v2/solar/" +NSRDB_API_BASE = "https://developer.nlr.gov/api/nsrdb/v2/solar/" PSM4_AGG_ENDPOINT = "nsrdb-GOES-aggregated-v4-0-0-download.csv" PSM4_TMY_ENDPOINT = "nsrdb-GOES-tmy-v4-0-0-download.csv" PSM4_CON_ENDPOINT = "nsrdb-GOES-conus-v4-0-0-download.csv" @@ -92,9 +92,9 @@ def get_nsrdb_psm4_aggregated(latitude, longitude, api_key, email, longitude : float or int in decimal degrees, between -180 and 180, east is positive api_key : str - NREL Developer Network API key + NLR Developer Network API key email : str - NREL API uses this to automatically communicate messages back + NLR API uses this to automatically communicate messages back to the user only if necessary year : int or str PSM4 API parameter specifing year (e.g. ``2023``) to download. The @@ -130,9 +130,9 @@ def get_nsrdb_psm4_aggregated(latitude, longitude, api_key, email, Returns ------- data : pandas.DataFrame - timeseries data from NREL PSM4 + timeseries data from NLR PSM4 metadata : dict - metadata from NREL PSM4 about the record, see + metadata from NLR PSM4 about the record, see :func:`pvlib.iotools.read_nsrdb_psm4` for fields Raises @@ -145,8 +145,8 @@ def get_nsrdb_psm4_aggregated(latitude, longitude, api_key, email, Notes ----- - The required NREL developer key, `api_key`, is available for free by - registering at the `NREL Developer Network `_. + The required NLR developer key, `api_key`, is available for free by + registering at the `NLR Developer Network `_. .. warning:: The "DEMO_KEY" `api_key` is severely rate limited and may result in rejected requests. @@ -161,10 +161,10 @@ def get_nsrdb_psm4_aggregated(latitude, longitude, api_key, email, References ---------- - .. [1] `NREL National Solar Radiation Database (NSRDB) - `_ + .. [1] `NLR National Solar Radiation Database (NSRDB) + `_ .. [2] `NSRDB GOES Aggregated V4.0.0 - `_ + `_ """ # The well know text (WKT) representation of geometry notation is strict. # A POINT object is a string with longitude first, then the latitude, with @@ -191,7 +191,7 @@ def get_nsrdb_psm4_aggregated(latitude, longitude, api_key, email, 'utc': str(utc).lower(), 'interval': time_step } - # request CSV download from NREL PSM4 + # request CSV download from NLR PSM4 if url is None: url = PSM4_AGG_URL @@ -228,9 +228,9 @@ def get_nsrdb_psm4_tmy(latitude, longitude, api_key, email, year='tmy', longitude : float or int in decimal degrees, between -180 and 180, east is positive api_key : str - NREL Developer Network API key + NLR Developer Network API key email : str - NREL API uses this to automatically communicate messages back + NLR API uses this to automatically communicate messages back to the user only if necessary year : str, default 'tmy' PSM4 API parameter specifing TMY variant to download (e.g. ``'tmy'`` @@ -267,9 +267,9 @@ def get_nsrdb_psm4_tmy(latitude, longitude, api_key, email, year='tmy', Returns ------- data : pandas.DataFrame - timeseries data from NREL PSM4 + timeseries data from NLR PSM4 metadata : dict - metadata from NREL PSM4 about the record, see + metadata from NLR PSM4 about the record, see :func:`pvlib.iotools.read_nsrdb_psm4` for fields Raises @@ -282,8 +282,8 @@ def get_nsrdb_psm4_tmy(latitude, longitude, api_key, email, year='tmy', Notes ----- - The required NREL developer key, `api_key`, is available for free by - registering at the `NREL Developer Network `_. + The required NLR developer key, `api_key`, is available for free by + registering at the `NLR Developer Network `_. .. warning:: The "DEMO_KEY" `api_key` is severely rate limited and may result in rejected requests. @@ -299,10 +299,10 @@ def get_nsrdb_psm4_tmy(latitude, longitude, api_key, email, year='tmy', References ---------- - .. [1] `NREL National Solar Radiation Database (NSRDB) - `_ + .. [1] `NLR National Solar Radiation Database (NSRDB) + `_ .. [2] `NSRDB GOES Tmy V4.0.0 - `_ + `_ """ # The well know text (WKT) representation of geometry notation is strict. # A POINT object is a string with longitude first, then the latitude, with @@ -329,7 +329,7 @@ def get_nsrdb_psm4_tmy(latitude, longitude, api_key, email, year='tmy', 'utc': str(utc).lower(), 'interval': time_step } - # request CSV download from NREL PSM4 + # request CSV download from NLR PSM4 if url is None: url = PSM4_TMY_URL @@ -366,9 +366,9 @@ def get_nsrdb_psm4_conus(latitude, longitude, api_key, email, year, longitude : float or int in decimal degrees, between -180 and 180, east is positive api_key : str - NREL Developer Network API key + NLR Developer Network API key email : str - NREL API uses this to automatically communicate messages back + NLR API uses this to automatically communicate messages back to the user only if necessary year : int or str PSM4 API parameter specifing year (e.g. ``2023``) to download. The @@ -403,9 +403,9 @@ def get_nsrdb_psm4_conus(latitude, longitude, api_key, email, year, Returns ------- data : pandas.DataFrame - timeseries data from NREL PSM4 + timeseries data from NLR PSM4 metadata : dict - metadata from NREL PSM4 about the record, see + metadata from NLR PSM4 about the record, see :func:`pvlib.iotools.read_nsrdb_psm4` for fields Raises @@ -418,8 +418,8 @@ def get_nsrdb_psm4_conus(latitude, longitude, api_key, email, year, Notes ----- - The required NREL developer key, `api_key`, is available for free by - registering at the `NREL Developer Network `_. + The required NLR developer key, `api_key`, is available for free by + registering at the `NLR Developer Network `_. .. warning:: The "DEMO_KEY" `api_key` is severely rate limited and may result in rejected requests. @@ -435,10 +435,10 @@ def get_nsrdb_psm4_conus(latitude, longitude, api_key, email, year, References ---------- - .. [1] `NREL National Solar Radiation Database (NSRDB) - `_ + .. [1] `NLR National Solar Radiation Database (NSRDB) + `_ .. [2] `NSRDB GOES Conus V4.0.0 - `_ + `_ """ # The well know text (WKT) representation of geometry notation is strict. # A POINT object is a string with longitude first, then the latitude, with @@ -465,7 +465,7 @@ def get_nsrdb_psm4_conus(latitude, longitude, api_key, email, year, 'utc': str(utc).lower(), 'interval': time_step } - # request CSV download from NREL PSM4 + # request CSV download from NLR PSM4 if url is None: url = PSM4_CON_URL @@ -504,9 +504,9 @@ def get_nsrdb_psm4_full_disc(latitude, longitude, api_key, email, longitude : float or int in decimal degrees, between -180 and 180, east is positive api_key : str - NREL Developer Network API key + NLR Developer Network API key email : str - NREL API uses this to automatically communicate messages back + NLR API uses this to automatically communicate messages back to the user only if necessary year : int or str PSM4 API parameter specifing year (e.g. ``2023``) to download. The @@ -542,9 +542,9 @@ def get_nsrdb_psm4_full_disc(latitude, longitude, api_key, email, Returns ------- data : pandas.DataFrame - timeseries data from NREL PSM4 + timeseries data from NLR PSM4 metadata : dict - metadata from NREL PSM4 about the record, see + metadata from NLR PSM4 about the record, see :func:`pvlib.iotools.read_nsrdb_psm4` for fields Raises @@ -557,8 +557,8 @@ def get_nsrdb_psm4_full_disc(latitude, longitude, api_key, email, Notes ----- - The required NREL developer key, `api_key`, is available for free by - registering at the `NREL Developer Network `_. + The required NLR developer key, `api_key`, is available for free by + registering at the `NLR Developer Network `_. .. warning:: The "DEMO_KEY" `api_key` is severely rate limited and may result in rejected requests. @@ -574,10 +574,10 @@ def get_nsrdb_psm4_full_disc(latitude, longitude, api_key, email, References ---------- - .. [1] `NREL National Solar Radiation Database (NSRDB) - `_ + .. [1] `NLR National Solar Radiation Database (NSRDB) + `_ .. [2] `NSRDB GOES Full Disc V4.0.0 - `_ + `_ """ # The well know text (WKT) representation of geometry notation is strict. # A POINT object is a string with longitude first, then the latitude, with @@ -604,7 +604,7 @@ def get_nsrdb_psm4_full_disc(latitude, longitude, api_key, email, 'utc': str(utc).lower(), 'interval': time_step } - # request CSV download from NREL PSM4 + # request CSV download from NLR PSM4 if url is None: url = PSM4_FUL_URL @@ -640,16 +640,16 @@ def read_nsrdb_psm4(filename, map_variables=True): Returns ------- data : pandas.DataFrame - timeseries data from NREL PSM4 + timeseries data from NLR PSM4 metadata : dict - metadata from NREL PSM4 about the record, see notes for fields + metadata from NLR PSM4 about the record, see notes for fields Notes ----- The return is a tuple with two items. The first item is a dataframe with the PSM4 timeseries data. - The second item is a dictionary with metadata from NREL PSM4 about the + The second item is a dictionary with metadata from NLR PSM4 about the record containing the following fields: * Source @@ -717,8 +717,8 @@ def read_nsrdb_psm4(filename, map_variables=True): References ---------- - .. [1] `NREL National Solar Radiation Database (NSRDB) - `_ + .. [1] `NLR National Solar Radiation Database (NSRDB) + `_ .. [2] `Standard Time Series Data File Format `_ """ diff --git a/pvlib/iotools/tmy.py b/pvlib/iotools/tmy.py index 28d20ffc2d..0527e2633c 100644 --- a/pvlib/iotools/tmy.py +++ b/pvlib/iotools/tmy.py @@ -161,7 +161,7 @@ def read_tmy3(filename, coerce_year=None, map_variables=True, encoding=None): .. admonition:: Midnight representation - The function is able to handle midnight represented as 24:00 (NREL TMY3 + The function is able to handle midnight represented as 24:00 (NLR TMY3 format, see [1]_) and as 00:00 (SolarAnywhere TMY3 format, see [3]_). .. warning:: TMY3 irradiance data corresponds to the *previous* hour, so diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index c67c1ca251..c3f8d1f761 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -89,7 +89,7 @@ def get_extra_radiation(datetime_or_doy, solar_constant=1366.1, Engineers, 2005. :doi:`10.1061/9780784408056` .. [6] I. Reda, A. Andreas, "Solar position algorithm for solar - radiation applications" NREL Golden, USA. NREL/TP-560-34302, + radiation applications" NLR Golden, USA. NREL/TP-560-34302, Revised 2008. :doi:`10.2172/15003974` """ @@ -1730,7 +1730,7 @@ def clearness_index_zenith_independent(clearness_index, airmass, max_clearness_index : numeric, default 2.0 Maximum value of the clearness index. The default, 2.0, allows for over-irradiance events typically seen in sub-hourly data. - NREL's SRRL Fortran code used 0.82 for hourly data. + NLR's SRRL Fortran code used 0.82 for hourly data. Returns ------- @@ -1774,7 +1774,7 @@ def disc(ghi, solar_zenith, datetime_or_doy, pressure=101325, The original report describing the DISC model [1]_ uses the relative airmass rather than the absolute (pressure-corrected) - airmass. However, the NREL implementation of the DISC model [2]_ + airmass. However, the NLR implementation of the DISC model [2]_ uses absolute airmass. PVLib Matlab also uses the absolute airmass. pvlib python defaults to absolute airmass, but the relative airmass can be used by supplying `pressure=None`. @@ -1828,7 +1828,7 @@ def disc(ghi, solar_zenith, datetime_or_doy, pressure=101325, Institute, 1987. .. [2] Maxwell, E. "DISC Model", Excel Worksheet. - https://www.nrel.gov/grid/solar-resource/disc.html + https://www.nlr.gov/grid/solar-resource/disc.html See Also -------- diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index fe85359b99..7fe3779581 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -1561,7 +1561,7 @@ def calcparams_desoto(effective_irradiance, temp_cell, The energy bandgap at reference temperature in units of eV. 1.121 eV for crystalline silicon. EgRef must be >0. For parameters from the SAM CEC module database, EgRef=1.121 is implicit for all - cell types in the parameter estimation algorithm used by NREL. + cell types in the parameter estimation algorithm used by NLR. dEgdT : float The temperature dependence of the energy bandgap at reference @@ -1569,7 +1569,7 @@ def calcparams_desoto(effective_irradiance, temp_cell, (e.g. -0.0002677 as in [1]_) or a DataFrame (this may be useful if dEgdT is a modeled as a function of temperature). For parameters from the SAM CEC module database, dEgdT=-0.0002677 is implicit for all cell - types in the parameter estimation algorithm used by NREL. + types in the parameter estimation algorithm used by NLR. irrad_ref : float, default 1000 Reference irradiance in W/m^2. @@ -1604,7 +1604,7 @@ def calcparams_desoto(effective_irradiance, temp_cell, photovoltaic array performance", Solar Energy, vol 80, pp. 78-88, 2006. - .. [2] System Advisor Model web page. https://sam.nrel.gov. + .. [2] System Advisor Model web page. https://sam.nlr.gov. .. [3] A. Dobos, "An Improved Coefficient Calculator for the California Energy Commission 6 Parameter Photovoltaic Module Model", Journal of @@ -1779,7 +1779,7 @@ def calcparams_cec(effective_irradiance, temp_cell, The energy bandgap at reference temperature in units of eV. 1.121 eV for crystalline silicon. EgRef must be >0. For parameters from the SAM CEC module database, EgRef=1.121 is implicit for all - cell types in the parameter estimation algorithm used by NREL. + cell types in the parameter estimation algorithm used by NLR. dEgdT : float The temperature dependence of the energy bandgap at reference @@ -1787,7 +1787,7 @@ def calcparams_cec(effective_irradiance, temp_cell, (e.g. -0.0002677 as in [3]) or a DataFrame (this may be useful if dEgdT is a modeled as a function of temperature). For parameters from the SAM CEC module database, dEgdT=-0.0002677 is implicit for all cell - types in the parameter estimation algorithm used by NREL. + types in the parameter estimation algorithm used by NLR. irrad_ref : float, default 1000 Reference irradiance in W/m^2. @@ -1822,7 +1822,7 @@ def calcparams_cec(effective_irradiance, temp_cell, Energy Commission 6 Parameter Photovoltaic Module Model", Journal of Solar Energy Engineering, vol 134, 2012. - .. [2] System Advisor Model web page. https://sam.nrel.gov. + .. [2] System Advisor Model web page. https://sam.nlr.gov. .. [3] W. De Soto et al., "Improvement and validation of a model for photovoltaic array performance", Solar Energy, vol 80, pp. 78-88, @@ -2889,7 +2889,7 @@ def scale_voltage_current_power(data, voltage=1, current=1): def pvwatts_dc(effective_irradiance, temp_cell, pdc0, gamma_pdc, temp_ref=25., k=None, cap_adjustment=False): r""" - Implement NREL's PVWatts (Version 5) DC power model. + Implement NLR's PVWatts (Version 5) DC power model. Parameters ---------- @@ -2963,7 +2963,7 @@ def pvwatts_dc(effective_irradiance, temp_cell, pdc0, gamma_pdc, temp_ref=25., Module Performance," In Proc. 33rd IEEE Photovoltaic Specialists Conference (PVSC), San Diego, CA, USA, 2008, pp. 1-6, :doi:`10.1109/PVSC.2008.4922586`. - Pre-print: https://docs.nrel.gov/docs/fy08osti/42511.pdf + Pre-print: https://www.nlr.gov/docs/fy08osti/42511.pdf """ # noqa: E501 pdc = (effective_irradiance * 0.001 * pdc0 * @@ -3004,7 +3004,7 @@ def pvwatts_losses(soiling=2, shading=3, snow=0, mismatch=2, wiring=2, connections=0.5, lid=1.5, nameplate_rating=1, age=0, availability=3): r""" - Implements NREL's PVWatts system loss model. + Implements NLR's PVWatts system loss model. The PVWatts loss model [1]_ is: .. math:: diff --git a/pvlib/shading.py b/pvlib/shading.py index 42aef892f7..a66498d765 100644 --- a/pvlib/shading.py +++ b/pvlib/shading.py @@ -87,8 +87,8 @@ def masking_angle(surface_tilt, gcr, slant_height): panels", Solar Cells, Volume 11, Pages 281-291. 1984. :doi:`10.1016/0379-6787(84)90017-6` .. [2] Gilman, P. et al., (2018). "SAM Photovoltaic Model Technical - Reference Update", NREL Technical Report NREL/TP-6A20-67399. - Available at https://www.nrel.gov/docs/fy18osti/67399.pdf + Reference Update", NLR Technical Report NREL/TP-6A20-67399. + Available at https://www.nlr.gov/docs/fy18osti/67399.pdf """ # The original equation (8 in [1]) requires pitch and collector width, # but it's easy to non-dimensionalize it to make it a function of GCR @@ -228,8 +228,8 @@ def sky_diffuse_passias(masking_angle): panels", Solar Cells, Volume 11, Pages 281-291. 1984. :doi:`10.1016/0379-6787(84)90017-6` .. [2] Gilman, P. et al., (2018). "SAM Photovoltaic Model Technical - Reference Update", NREL Technical Report NREL/TP-6A20-67399. - Available at https://www.nrel.gov/docs/fy18osti/67399.pdf + Reference Update", NLR Technical Report NREL/TP-6A20-67399. + Available at https://www.nlr.gov/docs/fy18osti/67399.pdf """ return 1 - cosd(masking_angle/2)**2 @@ -304,7 +304,7 @@ def projected_solar_zenith_angle(solar_zenith, solar_azimuth, References ---------- .. [1] K. Anderson and M. Mikofski, 'Slope-Aware Backtracking for - Single-Axis Trackers', National Renewable Energy Lab. (NREL), Golden, + Single-Axis Trackers', National Laboratory of the Rockies (NLR), Golden, CO (United States); NREL/TP-5K00-76626, Jul. 2020. :doi:`10.2172/1660126`. diff --git a/pvlib/snow.py b/pvlib/snow.py index f2c8fca148..4a87061cca 100644 --- a/pvlib/snow.py +++ b/pvlib/snow.py @@ -51,7 +51,7 @@ def fully_covered_nrel(snowfall, snow_depth=None, threshold_snowfall=1., "Measured and modeled photovoltaic system energy losses from snow for Colorado and Wisconsin locations." Solar Energy 97; pp.112-121. .. [2] Ryberg, D; Freeman, J. "Integration, Validation, and Application - of a PV Snow Coverage Model in SAM" (2017) NREL Technical Report + of a PV Snow Coverage Model in SAM" (2017) NLR Technical Report NREL/TP-6A20-68705 ''' timestep = _time_delta_in_hours(snowfall.index) @@ -134,7 +134,7 @@ def coverage_nrel(snowfall, poa_irradiance, temp_air, surface_tilt, "Measured and modeled photovoltaic system energy losses from snow for Colorado and Wisconsin locations." Solar Energy 97; pp.112-121. .. [2] Ryberg, D; Freeman, J. (2017). "Integration, Validation, and - Application of a PV Snow Coverage Model in SAM" NREL Technical Report + Application of a PV Snow Coverage Model in SAM" NLR Technical Report NREL/TP-6A20-68705 ''' @@ -210,8 +210,8 @@ def dc_loss_nrel(snow_coverage, num_strings): References ---------- .. [1] Gilman, P. et al., (2018). "SAM Photovoltaic Model Technical - Reference Update", NREL Technical Report NREL/TP-6A20-67399. - Available at https://www.nrel.gov/docs/fy18osti/67399.pdf + Reference Update", NLR Technical Report NREL/TP-6A20-67399. + Available at https://www.nlr.gov/docs/fy18osti/67399.pdf ''' return np.ceil(snow_coverage * num_strings) / num_strings @@ -320,7 +320,7 @@ def loss_townsend(snow_total, snow_events, surface_tilt, relative_humidity, Uses of the Townsend Snow Model. In "Photovoltaic Reliability Workshop (PVRW) 2023 Proceedings: Posters.", ed. Silverman, T. J. Dec. 2023. NREL/CP-5900-87918. - Available at: https://www.nrel.gov/docs/fy25osti/90585.pdf + Available at: https://www.nlr.gov/docs/fy25osti/90585.pdf .. [3] Townsend, T. (2013). Predicting PV Energy Loss Caused by Snow. Solar Power International, Chicago IL. :doi:`10.13140/RG.2.2.14299.68647` diff --git a/pvlib/solarposition.py b/pvlib/solarposition.py index 2b8a43e9d0..76aeda2ce6 100644 --- a/pvlib/solarposition.py +++ b/pvlib/solarposition.py @@ -56,10 +56,10 @@ def get_solarposition(time, latitude, longitude, if ``altitude`` is not supplied. method : string, default 'nrel_numpy' - 'nrel_numpy' uses an implementation of the NREL SPA algorithm + 'nrel_numpy' uses an implementation of the NLR SPA algorithm described in [1] (default, recommended): :py:func:`spa_python` - 'nrel_numba' uses an implementation of the NREL SPA algorithm + 'nrel_numba' uses an implementation of the NLR SPA algorithm described in [1], but also compiles the code first: :py:func:`spa_python` @@ -67,7 +67,7 @@ def get_solarposition(time, latitude, longitude, 'ephemeris' uses the pvlib ephemeris code: :py:func:`ephemeris` - 'nrel_c' uses the NREL SPA C code [3]: :py:func:`spa_c` + 'nrel_c' uses the NLR SPA C code [3]: :py:func:`spa_c` temperature : float, default 12 Degrees C. @@ -85,7 +85,7 @@ def get_solarposition(time, latitude, longitude, solar radiation applications. Solar Energy, vol. 81, no. 6, p. 838, 2007. - .. [3] NREL SPA code: https://midcdmz.nrel.gov/spa/ + .. [3] NLR SPA code: https://midcdmz.nlr.gov/spa/ """ if altitude is None and pressure is None: @@ -129,7 +129,7 @@ def spa_c(time, latitude, longitude, pressure=101325., altitude=0., temperature=12., delta_t=67.0, raw_spa_output=False): r""" - Calculate the solar position using the C implementation of the NREL + Calculate the solar position using the C implementation of the NLR SPA code. The source files for this code are located in './spa_c_files/', along with @@ -173,7 +173,7 @@ def spa_c(time, latitude, longitude, pressure=101325., altitude=0., References ---------- - .. [1] NREL SPA reference: https://midcdmz.nrel.gov/spa/ + .. [1] NLR SPA reference: https://midcdmz.nlr.gov/spa/ Note: The ``timezone`` field in the SPA C files is replaced with ``time_zone`` to avoid a nameclash with the function ``__timezone`` that is @@ -283,9 +283,9 @@ def spa_python(time, latitude, longitude, atmos_refract=None, how='numpy', numthreads=4): """ Calculate the solar position using a python implementation of the - NREL SPA algorithm. + NLR SPA algorithm. - The details of the NREL SPA algorithm are described in [1]_, [2]_. + The details of the NLR SPA algorithm are described in [1]_, [2]_. If numba is installed, the functions can be compiled to machine code and the function can be multithreaded. @@ -394,9 +394,9 @@ def sun_rise_set_transit_spa(times, latitude, longitude, how='numpy', delta_t=67.0, numthreads=4): """ Calculate the sunrise, sunset, and sun transit times using the - NREL SPA algorithm. + NLR SPA algorithm. - The details of the NREL SPA algorithm are described in [1]_. + The details of the NLR SPA algorithm are described in [1]_. If numba is installed, the functions can be compiled to machine code and the function can be multithreaded. @@ -433,7 +433,7 @@ def sun_rise_set_transit_spa(times, latitude, longitude, how='numpy', ---------- .. [1] Reda, I., Andreas, A., 2003. Solar position algorithm for solar radiation applications. Technical report: NREL/TP-560- 34302. Golden, - USA, http://www.nrel.gov. + USA, http://www.nlr.gov. """ # Added by Tony Lorenzo (@alorenzo175), University of Arizona, 2015 @@ -956,9 +956,9 @@ def pyephem_earthsun_distance(time): def nrel_earthsun_distance(time, how='numpy', delta_t=67.0, numthreads=4): """ Calculates the distance from the earth to the sun using the - NREL SPA algorithm. + NLR SPA algorithm. - The details of the NREL SPA algorithm are described in [1]_. + The details of the NLR SPA algorithm are described in [1]_. Parameters ---------- @@ -988,7 +988,7 @@ def nrel_earthsun_distance(time, how='numpy', delta_t=67.0, numthreads=4): ---------- .. [1] Reda, I., Andreas, A., 2003. Solar position algorithm for solar radiation applications. Technical report: NREL/TP-560- 34302. Golden, - USA, http://www.nrel.gov. + USA, http://www.nlr.gov. """ if not isinstance(time, pd.DatetimeIndex): diff --git a/pvlib/spa.py b/pvlib/spa.py index 6297e88c35..279593e48a 100644 --- a/pvlib/spa.py +++ b/pvlib/spa.py @@ -1,5 +1,5 @@ """ -Calculate the solar position using the NREL SPA algorithm either using +Calculate the solar position using the NLR SPA algorithm either using numpy arrays or compiling the code to machine language with numba. """ @@ -402,7 +402,7 @@ def nocompile(*args, **kwargs): @jcompile('float64(int64, int64, int64, int64, int64, int64, int64)', nopython=True) def julian_day_dt(year, month, day, hour, minute, second, microsecond): - """This is the original way to calculate the julian day from the NREL paper. + """This is the original way to calculate the julian day from the NLR paper. However, it is much faster to convert to unix/epoch time and then convert to julian day. Note that the date must be UTC.""" if month <= 2: @@ -1031,7 +1031,7 @@ def solar_position(unixtime, lat, lon, elev, pressure, temp, delta_t, """ Calculate the solar position using the - NREL SPA algorithm described in [1]. + NLR SPA algorithm described in [1]. If numba is installed, the functions can be compiled and the code runs quickly. If not, the functions @@ -1214,7 +1214,7 @@ def transit_sunrise_sunset(dates, lat, lon, delta_t, numthreads): def earthsun_distance(unixtime, delta_t, numthreads): """ Calculates the distance from the earth to the sun using the - NREL SPA algorithm described in [1]. + NLR SPA algorithm described in [1]. Parameters ---------- @@ -1236,7 +1236,7 @@ def earthsun_distance(unixtime, delta_t, numthreads): ---------- [1] Reda, I., Andreas, A., 2003. Solar position algorithm for solar radiation applications. Technical report: NREL/TP-560- 34302. Golden, - USA, http://www.nrel.gov. + USA, http://www.nlr.gov. """ R = solar_position(unixtime, 0, 0, 0, 0, 0, delta_t, diff --git a/pvlib/spa_c_files/README.md b/pvlib/spa_c_files/README.md index aaef8bd571..8d3d1022a9 100644 --- a/pvlib/spa_c_files/README.md +++ b/pvlib/spa_c_files/README.md @@ -1,18 +1,18 @@ README ------ -NREL provides a C implementation of the solar position algorithm described in -[Reda, I.; Andreas, A. (2003). Solar Position Algorithm for Solar Radiation Applications. 55 pp.; NREL Report No. TP-560-34302](http://www.nrel.gov/docs/fy08osti/34302.pdf). +NLR provides a C implementation of the solar position algorithm described in +[Reda, I.; Andreas, A. (2003). Solar Position Algorithm for Solar Radiation Applications. 55 pp.; NREL Report No. TP-560-34302](http://www.nlr.gov/docs/fy08osti/34302.pdf). This folder contains the files required to make SPA C code accessible -to the `pvlib-python` package. We use the Cython package to wrap the NREL SPA +to the `pvlib-python` package. We use the Cython package to wrap the NLR SPA implementation. ** Due to licensing issues, the SPA C files can _not_ be distributed with `pvlib-python`. You must download the SPA C files from the -[NREL website](https://midcdmz.nrel.gov/spa/). ** +[NLR website](https://midcdmz.nlr.gov/spa/). ** -Download the `spa.c` and `spa.h` files from NREL, and copy them into the +Download the `spa.c` and `spa.h` files from NLR, and copy them into the `pvlib/spa_c_files` directory. When the extension is built, the ``timezone`` field in the SPA C files is replaced with `time_zone` to avoid a nameclash with the function `__timezone` that is redefined by Python>=3.5. This issue @@ -20,7 +20,7 @@ is [Python bug 24643](https://bugs.python.org/issue24643). There are a total of 5 files needed to compile the C code, described below: -* `spa.c`: original C code from NREL +* `spa.c`: original C code from NLR * `spa.h`: header file for spa.c * `cspa_py.pxd`: a cython header file which essentially tells cython which parts of the main header file to pay attention to diff --git a/pvlib/spectrum/irradiance.py b/pvlib/spectrum/irradiance.py index fc3440cd19..b1a9456880 100644 --- a/pvlib/spectrum/irradiance.py +++ b/pvlib/spectrum/irradiance.py @@ -47,8 +47,8 @@ def get_reference_spectra(wavelengths=None, standard="ASTM G173-03"): For global spectra, it is about 1000.37 W/m². The values of the ASTM G173-03 provided with pvlib-python are copied from - an Excel file distributed by NREL, which is found here [2]_: - https://www.nrel.gov/grid/solar-resource/assets/data/astmg173.xls + an Excel file distributed by NLR, which is found here [2]_: + https://www.nlr.gov/grid/solar-resource/assets/data/astmg173.xls Examples -------- @@ -78,8 +78,8 @@ def get_reference_spectra(wavelengths=None, standard="ASTM G173-03"): ---------- .. [1] ASTM "G173-03 Standard Tables for Reference Solar Spectral Irradiances: Direct Normal and Hemispherical on 37° Tilted Surface." - .. [2] “Reference Air Mass 1.5 Spectra,” www.nrel.gov. - https://www.nrel.gov/grid/solar-resource/spectra-am1.5.html + .. [2] “Reference Air Mass 1.5 Spectra,” www.nlr.gov. + https://www.nlr.gov/grid/solar-resource/spectra-am1.5.html """ # Contributed by Echedey Luis, inspired by Anton Driesse (get_am15g) SPECTRA_FILES = { "ASTM G173-03": "ASTMG173.csv", diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index b4385e255a..88e34f5b63 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -231,7 +231,7 @@ def spectral_factor_firstsolar(precipitable_water, airmass_absolute, Water." IEEE Photovoltaic Specialists Conference, Portland, 2016 .. [3] Marion, William F., et al. User's Manual for Data for Validating Models for PV Module Performance. National Renewable Energy - Laboratory, 2014. http://www.nrel.gov/docs/fy14osti/61610.pdf + Laboratory, 2014. http://www.nlr.gov/docs/fy14osti/61610.pdf .. [4] Schweiger, M. and Hermann, W, Influence of Spectral Effects on Energy Yield of Different PV Modules: Comparison of Pwat and MMF Approach, TUV Rheinland Energy GmbH report 21237296.003, diff --git a/pvlib/spectrum/spectrl2.py b/pvlib/spectrum/spectrl2.py index 38739efff3..aeda5a2560 100644 --- a/pvlib/spectrum/spectrl2.py +++ b/pvlib/spectrum/spectrl2.py @@ -203,7 +203,7 @@ def spectrl2(apparent_zenith, aoi, surface_tilt, ground_albedo, Surface pressure. [Pa] relative_airmass : numeric Relative airmass. The airmass model used in [1]_ is the `'kasten1966'` - model, while a later implementation by NREL uses the + model, while a later implementation by NLR uses the `'kastenyoung1989'` model. [unitless] precipitable_water : numeric Atmospheric water vapor content. [cm] @@ -245,7 +245,7 @@ def spectrl2(apparent_zenith, aoi, surface_tilt, ground_albedo, Notes ----- - NREL's C implementation ``spectrl2_2.c`` [2]_ of the model differs in + NLR's C implementation ``spectrl2_2.c`` [2]_ of the model differs in several ways from the original report [1]_. The report itself also has a few differences between the in-text equations and the code appendix. The list of known differences is shown below. Note that this @@ -270,10 +270,10 @@ def spectrl2(apparent_zenith, aoi, surface_tilt, ground_albedo, ---------- .. [1] Bird, R., and Riordan, C., 1984, "Simple solar spectral model for direct and diffuse irradiance on horizontal and tilted planes at the - earth's surface for cloudless atmospheres", NREL Technical Report + earth's surface for cloudless atmospheres", NLR Technical Report TR-215-2436 :doi:`10.2172/5986936`. .. [2] Bird Simple Spectral Model: spectrl2_2.c. - https://www.nrel.gov/grid/solar-resource/spectral.html + https://www.nlr.gov/grid/solar-resource/spectral.html """ # values need to be np arrays for broadcasting, so unwrap Series if needed: is_pandas = isinstance(apparent_zenith, pd.Series) diff --git a/pvlib/tracking.py b/pvlib/tracking.py index ae50a5bc3f..6ecedd0d77 100644 --- a/pvlib/tracking.py +++ b/pvlib/tracking.py @@ -114,7 +114,7 @@ def singleaxis(apparent_zenith, solar_azimuth, ---------- .. [1] Anderson, K., and Mikofski, M., "Slope-Aware Backtracking for Single-Axis Trackers", Technical Report NREL/TP-5K00-76626, July 2020. - https://www.nrel.gov/docs/fy20osti/76626.pdf + https://www.nlr.gov/docs/fy20osti/76626.pdf .. [2] Lorenzo, E., Narvarte, L., and Muñoz, J. (2011). Tracking and back-tracking 19(6), 747–753. :doi:`10.1002/pip.1085` """ @@ -299,7 +299,7 @@ def calc_axis_tilt(slope_azimuth, slope_tilt, axis_azimuth): ---------- .. [1] Kevin Anderson and Mark Mikofski, "Slope-Aware Backtracking for Single-Axis Trackers", Technical Report NREL/TP-5K00-76626, July 2020. - https://www.nrel.gov/docs/fy20osti/76626.pdf + https://www.nlr.gov/docs/fy20osti/76626.pdf """ delta_gamma = axis_azimuth - slope_azimuth # equations 18-19 @@ -408,7 +408,7 @@ def calc_cross_axis_tilt( ---------- .. [1] Kevin Anderson and Mark Mikofski, "Slope-Aware Backtracking for Single-Axis Trackers", Technical Report NREL/TP-5K00-76626, July 2020. - https://www.nrel.gov/docs/fy20osti/76626.pdf + https://www.nlr.gov/docs/fy20osti/76626.pdf """ # delta-gamma, difference between axis and slope azimuths delta_gamma = axis_azimuth - slope_azimuth diff --git a/tests/conftest.py b/tests/conftest.py index dc14a34254..f989b29643 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -87,24 +87,31 @@ def assert_frame_equal(left, right, **kwargs): @pytest.fixture(scope="module") def nrel_api_key(): - """Supplies pvlib-python's NREL Developer Network API key. + """API key for NLR Developer Network (formerly NREL). - pvlib's CI utilizes a secret variable set to NREL_API_KEY - to mitigate failures associated with using the default key of - "DEMO_KEY". A user is capable of using their own key this way if - desired however the default key should suffice for testing purposes. + Checks NLR_API_KEY first, falls back to NREL_API_KEY with deprecation warning. """ try: - demo_key = os.environ["NREL_API_KEY"] + demo_key = os.environ["NLR_API_KEY"] except KeyError: - warnings.warn( - "WARNING: NREL API KEY environment variable not set! " - "Using DEMO_KEY instead. Unexpected failures may occur." - ) - demo_key = 'DEMO_KEY' + try: + demo_key = os.environ["NREL_API_KEY"] + warnings.warn( + "NREL_API_KEY is deprecated, use NLR_API_KEY instead", + DeprecationWarning, + stacklevel=2, + ) + except KeyError: + pytest.skip("requires NLR_API_KEY or NREL_API_KEY env var") return demo_key +@pytest.fixture(scope="module") +def nlr_api_key(nrel_api_key): + """Alias for nrel_api_key fixture.""" + return nrel_api_key + + try: # Attempt to load BSRN credentials used for testing pvlib.iotools.get_bsrn bsrn_username = os.environ["BSRN_FTP_USERNAME"] diff --git a/tests/iotools/test_midc.py b/tests/iotools/test_midc.py index 9a327d1394..b1a9594744 100644 --- a/tests/iotools/test_midc.py +++ b/tests/iotools/test_midc.py @@ -23,7 +23,7 @@ def test_mapping(): TESTS_DATA_DIR / 'midc_raw_short_header_20191115.txt') # TODO: not used, remove? -# midc_network_testfile = ('https://midcdmz.nrel.gov/apps/data_api.pl' +# midc_network_testfile = ('https://midcdmz.nlr.gov/apps/data_api.pl' # '?site=UAT&begin=20181018&end=20181019') diff --git a/tests/iotools/test_tmy.py b/tests/iotools/test_tmy.py index d50609ec47..23d824382f 100644 --- a/tests/iotools/test_tmy.py +++ b/tests/iotools/test_tmy.py @@ -107,7 +107,7 @@ def solaranywhere_index(): def test_solaranywhere_tmy3(solaranywhere_index): # The SolarAnywhere TMY3 format specifies midnight as 00:00 whereas the - # NREL TMY3 format utilizes 24:00. The SolarAnywhere file is therefore + # NLR TMY3 format utilizes 24:00. The SolarAnywhere file is therefore # included to test files with 00:00 timestamps are parsed correctly data, meta = tmy.read_tmy3(TMY3_SOLARANYWHERE, encoding='iso-8859-1', map_variables=False) diff --git a/tests/spectrum/test_spectrl2.py b/tests/spectrum/test_spectrl2.py index 38df01830f..c29429c7ea 100644 --- a/tests/spectrum/test_spectrl2.py +++ b/tests/spectrum/test_spectrl2.py @@ -6,7 +6,7 @@ def test_spectrl2(spectrl2_data): - # compare against output from solar_utils wrapper around NREL spectrl2_2.c + # compare against output from solar_utils wrapper around NLR spectrl2_2.c kwargs, expected = spectrl2_data actual = spectrum.spectrl2(**kwargs) assert_allclose(expected['wavelength'].values, actual['wavelength']) diff --git a/tests/test_shading.py b/tests/test_shading.py index f83f2db47b..893f6281a3 100644 --- a/tests/test_shading.py +++ b/tests/test_shading.py @@ -112,7 +112,7 @@ def test_sky_diffuse_passias_scalar(average_masking_angle, shading_loss): @pytest.fixture def true_tracking_angle_and_inputs_NREL(): - # data from NREL 'Slope-Aware Backtracking for Single-Axis Trackers' + # data from NLR 'Slope-Aware Backtracking for Single-Axis Trackers' # doi.org/10.2172/1660126 ; Accessed on 2023-11-06. tzinfo = timezone(timedelta(hours=-5)) axis_tilt_angle = 9.666 # deg @@ -170,7 +170,7 @@ def test_projected_solar_zenith_angle_numeric( ): psza_func = shading.projected_solar_zenith_angle axis_tilt, axis_azimuth, timedata = true_tracking_angle_and_inputs_NREL - # test against data provided by NREL + # test against data provided by NLR psz = psza_func( timedata["Apparent Zenith"], timedata["Solar Azimuth"], diff --git a/tests/test_solarposition.py b/tests/test_solarposition.py index 68158ee7d6..a6cf6b4819 100644 --- a/tests/test_solarposition.py +++ b/tests/test_solarposition.py @@ -38,7 +38,7 @@ def expected_solpos_multi(): @pytest.fixture() def expected_rise_set_spa(): - # for Golden, CO, from NREL SPA website + # for Golden, CO, from NLR SPA website times = pd.DatetimeIndex([datetime.datetime(2015, 1, 2), datetime.datetime(2015, 8, 2), ]).tz_localize('MST') @@ -86,8 +86,8 @@ def expected_rise_set_ephem(): index=times) -# the physical tests are run at the same time as the NREL SPA test. -# pyephem reproduces the NREL result to 2 decimal places. +# the physical tests are run at the same time as the NLR SPA test. +# pyephem reproduces the NLR result to 2 decimal places. # this doesn't mean that one code is better than the other. @requires_spa_c @@ -142,7 +142,7 @@ def test_spa_python_numpy_physical_dst(expected_solpos, golden): @pytest.mark.parametrize('delta_t', [65.0, None, np.array([65, 65])]) def test_sun_rise_set_transit_spa(expected_rise_set_spa, golden, delta_t): - # solution from NREL SPA web calculator + # solution from NLR SPA web calculator south = Location(-35.0, 0.0, tz='UTC') times = pd.to_datetime(["1996-07-05", "2004-12-04"], utc=True) sunrise = pd.to_datetime(["1996-07-05 07:08:15", "2004-12-04 04:38:57"], @@ -168,7 +168,7 @@ def test_sun_rise_set_transit_spa(expected_rise_set_spa, golden, delta_t): check_dtype=False # ignore us/ns dtypes ) - # test for Golden, CO compare to NREL SPA + # test for Golden, CO compare to NLR SPA result = solarposition.sun_rise_set_transit_spa( expected_rise_set_spa.index, golden.latitude, golden.longitude, delta_t=delta_t) @@ -672,7 +672,7 @@ def test_analytical_azimuth(): def test_hour_angle(): """ Test conversion from hours to hour angles in degrees given the following - inputs from NREL SPA calculator at Golden, CO + inputs from NLR SPA calculator at Golden, CO date,times,eot,sunrise,sunset 1/2/2015,7:21:55,-3.935172,-70.699400,70.512721 1/2/2015,16:47:43,-4.117227,-70.699400,70.512721 @@ -687,7 +687,7 @@ def test_hour_angle(): eot = np.array([-3.935172, -4.117227, -4.026295]) hourangle = solarposition.hour_angle(times, longitude, eot) expected = (-70.682338, 70.72118825000001, 0.000801250) - # FIXME: there are differences from expected NREL SPA calculator values + # FIXME: there are differences from expected NLR SPA calculator values # sunrise: 4 seconds, sunset: 48 seconds, transit: 0.2 seconds # but the differences may be due to other SPA input parameters assert np.allclose(hourangle, expected) diff --git a/tests/test_temperature.py b/tests/test_temperature.py index e482df6214..e238183600 100644 --- a/tests/test_temperature.py +++ b/tests/test_temperature.py @@ -228,7 +228,7 @@ def _read_pvwatts_8760(filename): ('pvwatts_8760_roofmount.csv', 49), ]) def test_fuentes(filename, inoct): - # Test against data exported from pvwatts.nrel.gov + # Test against data exported from pvwatts.nlr.gov data = _read_pvwatts_8760(TESTS_DATA_DIR / filename) data = data.iloc[:24*7, :] # just use one week inputs = { diff --git a/tests/test_tracking.py b/tests/test_tracking.py index 9a7ee98bef..3550f777fd 100644 --- a/tests/test_tracking.py +++ b/tests/test_tracking.py @@ -345,7 +345,7 @@ def test_calc_axis_tilt(): def test_slope_aware_backtracking(): """ - Test validation data set from https://www.nrel.gov/docs/fy20osti/76626.pdf + Test validation data set from https://www.nlr.gov/docs/fy20osti/76626.pdf """ index = pd.date_range('2019-01-01T08:00', '2019-01-01T17:00', freq='h') index = index.tz_localize('Etc/GMT+5') From 08f2c2787c154fc6bbb28bf06ad3fce920cfbba8 Mon Sep 17 00:00:00 2001 From: Jason Curtis Date: Tue, 3 Mar 2026 15:04:13 -0800 Subject: [PATCH 02/10] Apply suggestions from code review * update links for redirects * roll back some NLR -> NREL for publisher reference * fix various typos and EOF removal Co-authored-by: Rajiv Daxini <143435106+RDaxini@users.noreply.github.com> Co-authored-by: Cliff Hansen --- .../irradiance-decomposition/plot_diffuse_fraction.py | 4 ++-- docs/examples/spectrum/average_photon_energy.py | 4 ++-- docs/examples/spectrum/plot_spectrl2_fig51A.py | 6 +++--- docs/sphinx/source/whatsnew/v0.15.1.rst | 2 +- docs/tutorials/tmy_to_power.ipynb | 2 +- pvlib/clearsky.py | 2 +- pvlib/irradiance.py | 2 +- pvlib/pvsystem.py | 2 +- pvlib/shading.py | 4 ++-- pvlib/snow.py | 6 +++--- pvlib/solarposition.py | 4 ++-- pvlib/spa.py | 2 +- pvlib/spectrum/spectrl2.py | 2 +- tests/test_shading.py | 2 +- 14 files changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/examples/irradiance-decomposition/plot_diffuse_fraction.py b/docs/examples/irradiance-decomposition/plot_diffuse_fraction.py index 8329b5e543..de955781be 100644 --- a/docs/examples/irradiance-decomposition/plot_diffuse_fraction.py +++ b/docs/examples/irradiance-decomposition/plot_diffuse_fraction.py @@ -216,5 +216,5 @@ # correlations, which include additional variables such as airmass. These # methods seem to reduce DNI spikes over 1000 [W/m^2]. # -# .. _TMY3: https://www.nlr.gov/docs/fy08osti/43156.pdf -# .. _NSRDB: https://www.nlr.gov/docs/fy12osti/54824.pdf +# .. _TMY3: https://docs.nlr.gov/docs/fy08osti/43156.pdf +# .. _NSRDB: https://docs.nlr.gov/docs/fy12osti/54824.pdf diff --git a/docs/examples/spectrum/average_photon_energy.py b/docs/examples/spectrum/average_photon_energy.py index a9d8e5c0c8..97d6917733 100644 --- a/docs/examples/spectrum/average_photon_energy.py +++ b/docs/examples/spectrum/average_photon_energy.py @@ -194,5 +194,5 @@ # for the solar spectral influence on photovoltaic device performance." # Energy 286 :doi:`10.1016/j.energy.2023.129461` # .. [4] Bird Simple Spectral Model: spectrl2_2.c -# https://www.nlr.gov/grid/solar-resource/spectral.html -# (Last accessed: 18/09/2024) +# https://www.nlr.gov/grid/solar-resource/spectral +# (Last accessed: 03/03/2026) diff --git a/docs/examples/spectrum/plot_spectrl2_fig51A.py b/docs/examples/spectrum/plot_spectrl2_fig51A.py index 00a8c06672..0a921aaf79 100644 --- a/docs/examples/spectrum/plot_spectrl2_fig51A.py +++ b/docs/examples/spectrum/plot_spectrl2_fig51A.py @@ -2,7 +2,7 @@ Modeling Spectral Irradiance ============================ -Recreating Figure 5-1A from the SPECTRL2 NLR Technical Report. +Recreating Figure 5-1A from the SPECTRL2 NREL Technical Report. """ # %% @@ -10,7 +10,7 @@ # based on atmospheric conditions. The spectral distribution of irradiance is # the power content at each wavelength band in the solar spectrum and is # affected by various scattering and absorption mechanisms in the atmosphere. -# This example recreates an example figure from the SPECTRL2 NLR Technical +# This example recreates an example figure from the SPECTRL2 NREL Technical # Report [1]_. The figure shows modeled spectra at hourly intervals across # a single morning. @@ -95,5 +95,5 @@ # ---------- # .. [1] Bird, R, and Riordan, C., 1984, "Simple solar spectral model for # direct and diffuse irradiance on horizontal and tilted planes at the -# earth's surface for cloudless atmospheres", NLR Technical Report +# earth's surface for cloudless atmospheres", NREL Technical Report # TR-215-2436 :doi:`10.2172/5986936` diff --git a/docs/sphinx/source/whatsnew/v0.15.1.rst b/docs/sphinx/source/whatsnew/v0.15.1.rst index b43d143240..696d37a3ed 100644 --- a/docs/sphinx/source/whatsnew/v0.15.1.rst +++ b/docs/sphinx/source/whatsnew/v0.15.1.rst @@ -59,7 +59,7 @@ Maintenance * Update all NREL references to NLR (National Laboratory of the Rockies) following the laboratory rename and domain migration from ``nrel.gov`` to ``nlr.gov``. Add ``NLR_API_KEY`` environment variable support with - ``NREL_API_KEY`` fallback. (:issue:`2701`) + ``NREL_API_KEY`` fallback. (:issue:`2701`, :pull:`2705`) Contributors diff --git a/docs/tutorials/tmy_to_power.ipynb b/docs/tutorials/tmy_to_power.ipynb index 979f8a129e..34601d282d 100644 --- a/docs/tutorials/tmy_to_power.ipynb +++ b/docs/tutorials/tmy_to_power.ipynb @@ -1657,4 +1657,4 @@ }, "nbformat": 4, "nbformat_minor": 4 -} \ No newline at end of file +} diff --git a/pvlib/clearsky.py b/pvlib/clearsky.py index 2f8da611e9..ea421d54db 100644 --- a/pvlib/clearsky.py +++ b/pvlib/clearsky.py @@ -1001,7 +1001,7 @@ def bird(zenith, airmass_relative, aod380, aod500, precipitable_water, .. [2] Daryl R. Myers, "Solar Radiation: Practical Modeling for Renewable Energy Applications", pp. 46-51 CRC Press (2013) - .. [3] `NLR Bird Clear Sky Model `_ .. [4] `SERI/TR-642-761 `_ diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index c3f8d1f761..dbfdc33e5a 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -89,7 +89,7 @@ def get_extra_radiation(datetime_or_doy, solar_constant=1366.1, Engineers, 2005. :doi:`10.1061/9780784408056` .. [6] I. Reda, A. Andreas, "Solar position algorithm for solar - radiation applications" NLR Golden, USA. NREL/TP-560-34302, + radiation applications" NLR Golden, CO, USA. NREL/TP-560-34302, Revised 2008. :doi:`10.2172/15003974` """ diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index 7fe3779581..b55653acbd 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -2963,7 +2963,7 @@ def pvwatts_dc(effective_irradiance, temp_cell, pdc0, gamma_pdc, temp_ref=25., Module Performance," In Proc. 33rd IEEE Photovoltaic Specialists Conference (PVSC), San Diego, CA, USA, 2008, pp. 1-6, :doi:`10.1109/PVSC.2008.4922586`. - Pre-print: https://www.nlr.gov/docs/fy08osti/42511.pdf + Pre-print: https://docs.nlr.gov/docs/fy08osti/42511.pdf """ # noqa: E501 pdc = (effective_irradiance * 0.001 * pdc0 * diff --git a/pvlib/shading.py b/pvlib/shading.py index a66498d765..a3eb92266f 100644 --- a/pvlib/shading.py +++ b/pvlib/shading.py @@ -87,7 +87,7 @@ def masking_angle(surface_tilt, gcr, slant_height): panels", Solar Cells, Volume 11, Pages 281-291. 1984. :doi:`10.1016/0379-6787(84)90017-6` .. [2] Gilman, P. et al., (2018). "SAM Photovoltaic Model Technical - Reference Update", NLR Technical Report NREL/TP-6A20-67399. + Reference Update", NREL Technical Report NREL/TP-6A20-67399. Available at https://www.nlr.gov/docs/fy18osti/67399.pdf """ # The original equation (8 in [1]) requires pitch and collector width, @@ -228,7 +228,7 @@ def sky_diffuse_passias(masking_angle): panels", Solar Cells, Volume 11, Pages 281-291. 1984. :doi:`10.1016/0379-6787(84)90017-6` .. [2] Gilman, P. et al., (2018). "SAM Photovoltaic Model Technical - Reference Update", NLR Technical Report NREL/TP-6A20-67399. + Reference Update", NREL Technical Report NREL/TP-6A20-67399. Available at https://www.nlr.gov/docs/fy18osti/67399.pdf """ return 1 - cosd(masking_angle/2)**2 diff --git a/pvlib/snow.py b/pvlib/snow.py index 4a87061cca..a1c3ed1fab 100644 --- a/pvlib/snow.py +++ b/pvlib/snow.py @@ -51,7 +51,7 @@ def fully_covered_nrel(snowfall, snow_depth=None, threshold_snowfall=1., "Measured and modeled photovoltaic system energy losses from snow for Colorado and Wisconsin locations." Solar Energy 97; pp.112-121. .. [2] Ryberg, D; Freeman, J. "Integration, Validation, and Application - of a PV Snow Coverage Model in SAM" (2017) NLR Technical Report + of a PV Snow Coverage Model in SAM" (2017) NREL Technical Report NREL/TP-6A20-68705 ''' timestep = _time_delta_in_hours(snowfall.index) @@ -134,7 +134,7 @@ def coverage_nrel(snowfall, poa_irradiance, temp_air, surface_tilt, "Measured and modeled photovoltaic system energy losses from snow for Colorado and Wisconsin locations." Solar Energy 97; pp.112-121. .. [2] Ryberg, D; Freeman, J. (2017). "Integration, Validation, and - Application of a PV Snow Coverage Model in SAM" NLR Technical Report + Application of a PV Snow Coverage Model in SAM" NREL Technical Report NREL/TP-6A20-68705 ''' @@ -210,7 +210,7 @@ def dc_loss_nrel(snow_coverage, num_strings): References ---------- .. [1] Gilman, P. et al., (2018). "SAM Photovoltaic Model Technical - Reference Update", NLR Technical Report NREL/TP-6A20-67399. + Reference Update", NREL Technical Report NREL/TP-6A20-67399. Available at https://www.nlr.gov/docs/fy18osti/67399.pdf ''' return np.ceil(snow_coverage * num_strings) / num_strings diff --git a/pvlib/solarposition.py b/pvlib/solarposition.py index 76aeda2ce6..15eb9eeeab 100644 --- a/pvlib/solarposition.py +++ b/pvlib/solarposition.py @@ -432,7 +432,7 @@ def sun_rise_set_transit_spa(times, latitude, longitude, how='numpy', References ---------- .. [1] Reda, I., Andreas, A., 2003. Solar position algorithm for solar - radiation applications. Technical report: NREL/TP-560- 34302. Golden, + radiation applications. Technical report: NREL/TP-560-34302. Golden, USA, http://www.nlr.gov. """ # Added by Tony Lorenzo (@alorenzo175), University of Arizona, 2015 @@ -987,7 +987,7 @@ def nrel_earthsun_distance(time, how='numpy', delta_t=67.0, numthreads=4): References ---------- .. [1] Reda, I., Andreas, A., 2003. Solar position algorithm for solar - radiation applications. Technical report: NREL/TP-560- 34302. Golden, + radiation applications. Technical report: NREL/TP-560-34302. Golden, USA, http://www.nlr.gov. """ diff --git a/pvlib/spa.py b/pvlib/spa.py index 279593e48a..3384bfe5ab 100644 --- a/pvlib/spa.py +++ b/pvlib/spa.py @@ -1235,7 +1235,7 @@ def earthsun_distance(unixtime, delta_t, numthreads): References ---------- [1] Reda, I., Andreas, A., 2003. Solar position algorithm for solar - radiation applications. Technical report: NREL/TP-560- 34302. Golden, + radiation applications. Technical report: NREL/TP-560-34302. Golden, USA, http://www.nlr.gov. """ diff --git a/pvlib/spectrum/spectrl2.py b/pvlib/spectrum/spectrl2.py index aeda5a2560..966c9d649a 100644 --- a/pvlib/spectrum/spectrl2.py +++ b/pvlib/spectrum/spectrl2.py @@ -270,7 +270,7 @@ def spectrl2(apparent_zenith, aoi, surface_tilt, ground_albedo, ---------- .. [1] Bird, R., and Riordan, C., 1984, "Simple solar spectral model for direct and diffuse irradiance on horizontal and tilted planes at the - earth's surface for cloudless atmospheres", NLR Technical Report + earth's surface for cloudless atmospheres", NREL Technical Report TR-215-2436 :doi:`10.2172/5986936`. .. [2] Bird Simple Spectral Model: spectrl2_2.c. https://www.nlr.gov/grid/solar-resource/spectral.html diff --git a/tests/test_shading.py b/tests/test_shading.py index 893f6281a3..e856a57241 100644 --- a/tests/test_shading.py +++ b/tests/test_shading.py @@ -112,7 +112,7 @@ def test_sky_diffuse_passias_scalar(average_masking_angle, shading_loss): @pytest.fixture def true_tracking_angle_and_inputs_NREL(): - # data from NLR 'Slope-Aware Backtracking for Single-Axis Trackers' + # data from NREL 'Slope-Aware Backtracking for Single-Axis Trackers' # doi.org/10.2172/1660126 ; Accessed on 2023-11-06. tzinfo = timezone(timedelta(hours=-5)) axis_tilt_angle = 9.666 # deg From 1ebb8d6f11249be31539c1347de29c05c075e7c7 Mon Sep 17 00:00:00 2001 From: mayor Date: Tue, 3 Mar 2026 15:13:57 -0800 Subject: [PATCH 03/10] Fix broken links in tmy_to_power tutorial - Replace broken rredc.nlr.gov TMY3 link with nsrdb.nlr.gov archive - Use canonical https://docs.nlr.gov URL for PVUSA reference PDF - Add trailing newline Co-Authored-By: Claude Opus 4.6 --- docs/tutorials/tmy_to_power.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tutorials/tmy_to_power.ipynb b/docs/tutorials/tmy_to_power.ipynb index 34601d282d..992361e1aa 100644 --- a/docs/tutorials/tmy_to_power.ipynb +++ b/docs/tutorials/tmy_to_power.ipynb @@ -70,7 +70,7 @@ { "cell_type": "markdown", "metadata": {}, - "source": "pvlib comes with a couple of TMY files, and we'll use one of them for simplicity. You could also load a file from disk, or specify a url. See this NLR website for a list of TMY files:\n\nhttp://rredc.nlr.gov/solar/old_data/nsrdb/1991-2005/tmy3/by_state_and_city.html" + "source": "pvlib comes with a couple of TMY files, and we'll use one of them for simplicity. You could also load a file from disk, or specify a url. See this NLR website for a list of TMY files:\n\nhttps://nsrdb.nlr.gov/data-sets/archives" }, { "cell_type": "code", @@ -1511,7 +1511,7 @@ { "cell_type": "markdown", "metadata": {}, - "source": "Next, we will assume that the SAPM model is representative of the real world performance so that we can use scipy's optimization routine to derive simulated PVUSA coefficients. You will need to install scipy to run these functions.\n\nHere's one PVUSA reference:\n\nhttp://www.nlr.gov/docs/fy09osti/45376.pdf\n" + "source": "Next, we will assume that the SAPM model is representative of the real world performance so that we can use scipy's optimization routine to derive simulated PVUSA coefficients. You will need to install scipy to run these functions.\n\nHere's one PVUSA reference:\n\nhttps://docs.nlr.gov/docs/fy09osti/45376.pdf\n" }, { "cell_type": "code", From 0ae35586ebbafffccee0bc094254733a94d5a017 Mon Sep 17 00:00:00 2001 From: mayor Date: Tue, 3 Mar 2026 15:14:03 -0800 Subject: [PATCH 04/10] Fix reference formatting in irradiance.py and pvsystem.py - Remove non-standard double URL in AM1.5 spectra reference - Remove "Pre-print:" prefix from Marion 2008 reference URL Co-Authored-By: Claude Opus 4.6 --- pvlib/pvsystem.py | 4 ++-- pvlib/spectrum/irradiance.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index b55653acbd..afe0ddc297 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -2084,7 +2084,7 @@ def retrieve_sam(name=None, path=None): Notes ----- Files available at - https://github.com/NREL/SAM/tree/develop/deploy/libraries + https://github.com/NatLabRockies/SAM/tree/develop/deploy/libraries Examples -------- @@ -2963,7 +2963,7 @@ def pvwatts_dc(effective_irradiance, temp_cell, pdc0, gamma_pdc, temp_ref=25., Module Performance," In Proc. 33rd IEEE Photovoltaic Specialists Conference (PVSC), San Diego, CA, USA, 2008, pp. 1-6, :doi:`10.1109/PVSC.2008.4922586`. - Pre-print: https://docs.nlr.gov/docs/fy08osti/42511.pdf + https://docs.nlr.gov/docs/fy08osti/42511.pdf """ # noqa: E501 pdc = (effective_irradiance * 0.001 * pdc0 * diff --git a/pvlib/spectrum/irradiance.py b/pvlib/spectrum/irradiance.py index b1a9456880..4c8e70b693 100644 --- a/pvlib/spectrum/irradiance.py +++ b/pvlib/spectrum/irradiance.py @@ -78,7 +78,7 @@ def get_reference_spectra(wavelengths=None, standard="ASTM G173-03"): ---------- .. [1] ASTM "G173-03 Standard Tables for Reference Solar Spectral Irradiances: Direct Normal and Hemispherical on 37° Tilted Surface." - .. [2] “Reference Air Mass 1.5 Spectra,” www.nlr.gov. + .. [2] “Reference Air Mass 1.5 Spectra.” NLR. https://www.nlr.gov/grid/solar-resource/spectra-am1.5.html """ # Contributed by Echedey Luis, inspired by Anton Driesse (get_am15g) SPECTRA_FILES = { From aec468261188af88edb83f55883b03157b75d2e9 Mon Sep 17 00:00:00 2001 From: mayor Date: Tue, 3 Mar 2026 15:14:09 -0800 Subject: [PATCH 05/10] Migrate github.com/NREL URLs to github.com/NatLabRockies NREL GitHub org has moved to NatLabRockies. Update all references in code and docs (excluding historical whatsnew entries). Co-Authored-By: Claude Opus 4.6 --- docs/examples/bifacial/plot_irradiance_nonuniformity_loss.py | 2 +- docs/sphinx/source/user_guide/extras/faq.rst | 2 +- pvlib/bifacial/loss_models.py | 2 +- pvlib/ivtools/utils.py | 2 +- pvlib/snow.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/examples/bifacial/plot_irradiance_nonuniformity_loss.py b/docs/examples/bifacial/plot_irradiance_nonuniformity_loss.py index cb0d4c4634..281f0954b5 100644 --- a/docs/examples/bifacial/plot_irradiance_nonuniformity_loss.py +++ b/docs/examples/bifacial/plot_irradiance_nonuniformity_loss.py @@ -47,7 +47,7 @@ # described in Figure 1 (A), [1]_. We will cover this case for educational # purposes, although it can be achieved with the packages # `solarfactors `_ and -# `bifacial_radiance `_. +# `bifacial_radiance `_. # # Here we set and plot the global irradiance level of each cell. diff --git a/docs/sphinx/source/user_guide/extras/faq.rst b/docs/sphinx/source/user_guide/extras/faq.rst index 29eeef7c2b..81b69731d9 100644 --- a/docs/sphinx/source/user_guide/extras/faq.rst +++ b/docs/sphinx/source/user_guide/extras/faq.rst @@ -126,7 +126,7 @@ The CEC table doesn't include my module or inverter, what should I do? ---------------------------------------------------------------------- The CEC tables for module and inverter parameters included in pvlib are periodically -copied from `SAM `_, +copied from `SAM `_, so you can check the tables there for more up-to-date tables. For modules, if even the SAM files don't include the module you're looking for diff --git a/pvlib/bifacial/loss_models.py b/pvlib/bifacial/loss_models.py index 3582e8a6c9..4c6f0febf3 100644 --- a/pvlib/bifacial/loss_models.py +++ b/pvlib/bifacial/loss_models.py @@ -135,7 +135,7 @@ def power_mismatch_deline( -------- `solarfactors `_ Calculate the irradiance at different points of the module. - `bifacial_radiance `_ + `bifacial_radiance `_ Calculate the irradiance at different points of the module. References diff --git a/pvlib/ivtools/utils.py b/pvlib/ivtools/utils.py index cde50655dc..91c862f88a 100644 --- a/pvlib/ivtools/utils.py +++ b/pvlib/ivtools/utils.py @@ -470,7 +470,7 @@ def astm_e1036(v, i, imax_limits=(0.75, 1.15), vmax_limits=(0.75, 1.15), ASTM E1036-15(2019), :doi:`10.1520/E1036-15R19` ''' - # Adapted from https://github.com/NREL/iv_params + # Adapted from https://github.com/NatLabRockies/iv_params # Copyright (c) 2022, Alliance for Sustainable Energy, LLC # All rights reserved. diff --git a/pvlib/snow.py b/pvlib/snow.py index a1c3ed1fab..272f946839 100644 --- a/pvlib/snow.py +++ b/pvlib/snow.py @@ -159,7 +159,7 @@ def coverage_nrel(snowfall, poa_irradiance, temp_air, surface_tilt, # All slides off if snow on the ground is less than threshold_depth. # Described in [2] to avoid non-sliding snow for low-tilt systems. # Default threshold_depth of 1cm is from [2[ and SAM's implementation. - # https://github.com/NREL/ssc/issues/1265 + # https://github.com/NatLabRockies/ssc/issues/1265 slide_amt[snow_depth < threshold_depth] = 1. # build time series of cumulative slide amounts From 6563103f9c8caa456dbebe14465d17a976a0f06e Mon Sep 17 00:00:00 2001 From: mayor Date: Tue, 3 Mar 2026 15:29:38 -0800 Subject: [PATCH 06/10] Add docs page explaining NREL to NLR rename Co-Authored-By: Claude Opus 4.6 --- .../source/user_guide/extras/nrel_nlr.rst | 30 +++++++++++++++++++ docs/sphinx/source/user_guide/index.rst | 1 + 2 files changed, 31 insertions(+) create mode 100644 docs/sphinx/source/user_guide/extras/nrel_nlr.rst diff --git a/docs/sphinx/source/user_guide/extras/nrel_nlr.rst b/docs/sphinx/source/user_guide/extras/nrel_nlr.rst new file mode 100644 index 0000000000..6bb7a5cd8c --- /dev/null +++ b/docs/sphinx/source/user_guide/extras/nrel_nlr.rst @@ -0,0 +1,30 @@ +.. _nrel_nlr: + +============================== +NREL to NLR Rename (Dec 2025) +============================== + +In December 2025, the U.S. Department of Energy renamed the +**National Renewable Energy Laboratory (NREL)** to the +**National Laboratory of the Rockies (NLR)**. + + +Domain migration +**************** + +The lab's website moved from ``nrel.gov`` to ``nlr.gov``. The ``nrel.gov`` +domain is expected to stop resolving on **May 29, 2026**. The GitHub +organization moved from ``github.com/NREL`` to ``github.com/NatLabRockies``. +pvlib will update API and repository URLs as the migration progresses. + + +When we use NREL vs NLR +*********************** + +- **NREL**: historical publications, citations, and algorithm references + (e.g. the NREL SPA) published under the original name. +- **NLR**: the current organization, its software and data products, + and new ``nlr.gov`` URLs. + +Most existing pvlib code and docs say "NREL" because it appears in +bibliographic citations. These do not need to be updated. diff --git a/docs/sphinx/source/user_guide/index.rst b/docs/sphinx/source/user_guide/index.rst index af2a4cbb92..973ac0b025 100644 --- a/docs/sphinx/source/user_guide/index.rst +++ b/docs/sphinx/source/user_guide/index.rst @@ -34,4 +34,5 @@ This user guide is an overview and explains some of the key features of pvlib. :caption: Extras extras/nomenclature + extras/nrel_nlr extras/faq From fd771e6e23d3fe9228e1eca0900ec6216cae1e73 Mon Sep 17 00:00:00 2001 From: mayor Date: Tue, 3 Mar 2026 15:43:36 -0800 Subject: [PATCH 07/10] Fix line too long in conftest.py docstring Co-Authored-By: Claude Opus 4.6 --- tests/conftest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index f989b29643..22717a5d08 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -89,7 +89,8 @@ def assert_frame_equal(left, right, **kwargs): def nrel_api_key(): """API key for NLR Developer Network (formerly NREL). - Checks NLR_API_KEY first, falls back to NREL_API_KEY with deprecation warning. + Checks NLR_API_KEY first, falls back to NREL_API_KEY + with deprecation warning. """ try: demo_key = os.environ["NLR_API_KEY"] From 1820fdd3c08328731da5a2d12424b6501a801d64 Mon Sep 17 00:00:00 2001 From: Jason Curtis Date: Wed, 4 Mar 2026 09:42:17 -0800 Subject: [PATCH 08/10] Apply suggestions from @AdamRJensen CR Co-authored-by: Adam R. Jensen <39184289+AdamRJensen@users.noreply.github.com> --- .../irradiance-decomposition/plot_diffuse_fraction.py | 4 ++-- docs/examples/spectrum/average_photon_energy.py | 2 +- docs/tutorials/tmy_to_power.ipynb | 2 +- pvlib/bifacial/infinite_sheds.py | 2 +- pvlib/clearsky.py | 2 +- pvlib/inverter.py | 2 +- pvlib/irradiance.py | 2 +- pvlib/pvsystem.py | 2 +- pvlib/shading.py | 6 +++--- pvlib/snow.py | 2 +- pvlib/spa_c_files/README.md | 2 +- pvlib/spectrum/mismatch.py | 2 +- pvlib/tracking.py | 6 +++--- tests/test_tracking.py | 2 +- 14 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/examples/irradiance-decomposition/plot_diffuse_fraction.py b/docs/examples/irradiance-decomposition/plot_diffuse_fraction.py index de955781be..16b801b3c6 100644 --- a/docs/examples/irradiance-decomposition/plot_diffuse_fraction.py +++ b/docs/examples/irradiance-decomposition/plot_diffuse_fraction.py @@ -216,5 +216,5 @@ # correlations, which include additional variables such as airmass. These # methods seem to reduce DNI spikes over 1000 [W/m^2]. # -# .. _TMY3: https://docs.nlr.gov/docs/fy08osti/43156.pdf -# .. _NSRDB: https://docs.nlr.gov/docs/fy12osti/54824.pdf +# .. _TMY3: https://doi.org/10.2172/928611 +# .. _NSRDB: https://doi.org/10.2172/1054832 diff --git a/docs/examples/spectrum/average_photon_energy.py b/docs/examples/spectrum/average_photon_energy.py index 97d6917733..57918da3b5 100644 --- a/docs/examples/spectrum/average_photon_energy.py +++ b/docs/examples/spectrum/average_photon_energy.py @@ -34,7 +34,7 @@ from scipy.integrate import trapezoid from pvlib import spectrum, solarposition, irradiance, atmosphere -lat, lon = 39.742, -105.18 # NLR SRRL location +lat, lon = 39.742, -105.18 # SRRL location surface_tilt = 25 surface_azimuth = 180 # south-facing system pressure = 81190 # at 1828 metres AMSL, roughly diff --git a/docs/tutorials/tmy_to_power.ipynb b/docs/tutorials/tmy_to_power.ipynb index 992361e1aa..47fa9b4648 100644 --- a/docs/tutorials/tmy_to_power.ipynb +++ b/docs/tutorials/tmy_to_power.ipynb @@ -1511,7 +1511,7 @@ { "cell_type": "markdown", "metadata": {}, - "source": "Next, we will assume that the SAPM model is representative of the real world performance so that we can use scipy's optimization routine to derive simulated PVUSA coefficients. You will need to install scipy to run these functions.\n\nHere's one PVUSA reference:\n\nhttps://docs.nlr.gov/docs/fy09osti/45376.pdf\n" + "source": "Next, we will assume that the SAPM model is representative of the real world performance so that we can use scipy's optimization routine to derive simulated PVUSA coefficients. You will need to install scipy to run these functions.\n\nHere's one PVUSA reference:\n\nhttps://www.osti.gov/biblio/951223\n" }, { "cell_type": "code", diff --git a/pvlib/bifacial/infinite_sheds.py b/pvlib/bifacial/infinite_sheds.py index 12b15fba76..f99c536315 100644 --- a/pvlib/bifacial/infinite_sheds.py +++ b/pvlib/bifacial/infinite_sheds.py @@ -166,7 +166,7 @@ def _shaded_fraction(solar_zenith, solar_azimuth, surface_tilt, :doi:`10.1109/PVSC40753.2019.8980572`. .. [2] Kevin Anderson and Mark Mikofski, "Slope-Aware Backtracking for Single-Axis Trackers", Technical Report NREL/TP-5K00-76626, July 2020. - https://www.nlr.gov/docs/fy20osti/76626.pdf + :doi:`10.2172/1660126` """ tan_phi = utils._solar_projection_tangent( solar_zenith, solar_azimuth, surface_azimuth) diff --git a/pvlib/clearsky.py b/pvlib/clearsky.py index ea421d54db..66b732e328 100644 --- a/pvlib/clearsky.py +++ b/pvlib/clearsky.py @@ -1004,7 +1004,7 @@ def bird(zenith, airmass_relative, aod380, aod500, precipitable_water, .. [3] `Bird Clear Sky Model `_ - .. [4] `SERI/TR-642-761 `_ + .. [4] SERI/TR-642-761 :doi:`10.2172/6510849` .. [5] `Error Reports `_ diff --git a/pvlib/inverter.py b/pvlib/inverter.py index 21d24a84fe..622fb9b958 100644 --- a/pvlib/inverter.py +++ b/pvlib/inverter.py @@ -388,7 +388,7 @@ def pvwatts(pdc, pdc0, eta_inv_nom=0.96, eta_inv_ref=0.9637): References ---------- - .. [1] A. P. Dobos, "PVWatts Version 5 Manual", NLR, Golden, CO, USA, + .. [1] A. P. Dobos, "PVWatts Version 5 Manual", NREL, Golden, CO, USA, Technical Report NREL/TP-6A20-62641, 2014, :doi:`10.2172/1158421`. """ diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index dbfdc33e5a..26e6f4d3b1 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -89,7 +89,7 @@ def get_extra_radiation(datetime_or_doy, solar_constant=1366.1, Engineers, 2005. :doi:`10.1061/9780784408056` .. [6] I. Reda, A. Andreas, "Solar position algorithm for solar - radiation applications" NLR Golden, CO, USA. NREL/TP-560-34302, + radiation applications" NREL Golden, CO, USA. NREL/TP-560-34302, Revised 2008. :doi:`10.2172/15003974` """ diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index afe0ddc297..5512f362ad 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -2963,7 +2963,7 @@ def pvwatts_dc(effective_irradiance, temp_cell, pdc0, gamma_pdc, temp_ref=25., Module Performance," In Proc. 33rd IEEE Photovoltaic Specialists Conference (PVSC), San Diego, CA, USA, 2008, pp. 1-6, :doi:`10.1109/PVSC.2008.4922586`. - https://docs.nlr.gov/docs/fy08osti/42511.pdf + Pre-print: :doi:`10.1109/PVSC.2008.4922586` """ # noqa: E501 pdc = (effective_irradiance * 0.001 * pdc0 * diff --git a/pvlib/shading.py b/pvlib/shading.py index a3eb92266f..8fb50e5d3d 100644 --- a/pvlib/shading.py +++ b/pvlib/shading.py @@ -88,7 +88,7 @@ def masking_angle(surface_tilt, gcr, slant_height): :doi:`10.1016/0379-6787(84)90017-6` .. [2] Gilman, P. et al., (2018). "SAM Photovoltaic Model Technical Reference Update", NREL Technical Report NREL/TP-6A20-67399. - Available at https://www.nlr.gov/docs/fy18osti/67399.pdf + :doi:`10.2172/1429291` """ # The original equation (8 in [1]) requires pitch and collector width, # but it's easy to non-dimensionalize it to make it a function of GCR @@ -229,7 +229,7 @@ def sky_diffuse_passias(masking_angle): :doi:`10.1016/0379-6787(84)90017-6` .. [2] Gilman, P. et al., (2018). "SAM Photovoltaic Model Technical Reference Update", NREL Technical Report NREL/TP-6A20-67399. - Available at https://www.nlr.gov/docs/fy18osti/67399.pdf + :doi:`10.2172/1429291` """ return 1 - cosd(masking_angle/2)**2 @@ -304,7 +304,7 @@ def projected_solar_zenith_angle(solar_zenith, solar_azimuth, References ---------- .. [1] K. Anderson and M. Mikofski, 'Slope-Aware Backtracking for - Single-Axis Trackers', National Laboratory of the Rockies (NLR), Golden, + Single-Axis Trackers', National Renewable Energy Lab. (NREL), Golden, CO (United States); NREL/TP-5K00-76626, Jul. 2020. :doi:`10.2172/1660126`. diff --git a/pvlib/snow.py b/pvlib/snow.py index 272f946839..3723a85dfe 100644 --- a/pvlib/snow.py +++ b/pvlib/snow.py @@ -320,7 +320,7 @@ def loss_townsend(snow_total, snow_events, surface_tilt, relative_humidity, Uses of the Townsend Snow Model. In "Photovoltaic Reliability Workshop (PVRW) 2023 Proceedings: Posters.", ed. Silverman, T. J. Dec. 2023. NREL/CP-5900-87918. - Available at: https://www.nlr.gov/docs/fy25osti/90585.pdf + :doi:`10.2172/1429291` .. [3] Townsend, T. (2013). Predicting PV Energy Loss Caused by Snow. Solar Power International, Chicago IL. :doi:`10.13140/RG.2.2.14299.68647` diff --git a/pvlib/spa_c_files/README.md b/pvlib/spa_c_files/README.md index 8d3d1022a9..69a9c28d4d 100644 --- a/pvlib/spa_c_files/README.md +++ b/pvlib/spa_c_files/README.md @@ -2,7 +2,7 @@ README ------ NLR provides a C implementation of the solar position algorithm described in -[Reda, I.; Andreas, A. (2003). Solar Position Algorithm for Solar Radiation Applications. 55 pp.; NREL Report No. TP-560-34302](http://www.nlr.gov/docs/fy08osti/34302.pdf). +Reda, I.; Andreas, A. (2003). Solar Position Algorithm for Solar Radiation Applications. 55 pp.; NREL Report No. TP-560-34302. :doi:`10.2172/15003974` This folder contains the files required to make SPA C code accessible to the `pvlib-python` package. We use the Cython package to wrap the NLR SPA diff --git a/pvlib/spectrum/mismatch.py b/pvlib/spectrum/mismatch.py index 88e34f5b63..830c0be171 100644 --- a/pvlib/spectrum/mismatch.py +++ b/pvlib/spectrum/mismatch.py @@ -231,7 +231,7 @@ def spectral_factor_firstsolar(precipitable_water, airmass_absolute, Water." IEEE Photovoltaic Specialists Conference, Portland, 2016 .. [3] Marion, William F., et al. User's Manual for Data for Validating Models for PV Module Performance. National Renewable Energy - Laboratory, 2014. http://www.nlr.gov/docs/fy14osti/61610.pdf + Laboratory, 2014. :doi:`10.2172/1130632` .. [4] Schweiger, M. and Hermann, W, Influence of Spectral Effects on Energy Yield of Different PV Modules: Comparison of Pwat and MMF Approach, TUV Rheinland Energy GmbH report 21237296.003, diff --git a/pvlib/tracking.py b/pvlib/tracking.py index 6ecedd0d77..737d077a7b 100644 --- a/pvlib/tracking.py +++ b/pvlib/tracking.py @@ -114,7 +114,7 @@ def singleaxis(apparent_zenith, solar_azimuth, ---------- .. [1] Anderson, K., and Mikofski, M., "Slope-Aware Backtracking for Single-Axis Trackers", Technical Report NREL/TP-5K00-76626, July 2020. - https://www.nlr.gov/docs/fy20osti/76626.pdf + :doi:`10.2172/1660126` .. [2] Lorenzo, E., Narvarte, L., and Muñoz, J. (2011). Tracking and back-tracking 19(6), 747–753. :doi:`10.1002/pip.1085` """ @@ -299,7 +299,7 @@ def calc_axis_tilt(slope_azimuth, slope_tilt, axis_azimuth): ---------- .. [1] Kevin Anderson and Mark Mikofski, "Slope-Aware Backtracking for Single-Axis Trackers", Technical Report NREL/TP-5K00-76626, July 2020. - https://www.nlr.gov/docs/fy20osti/76626.pdf + :doi:`10.2172/1660126` """ delta_gamma = axis_azimuth - slope_azimuth # equations 18-19 @@ -408,7 +408,7 @@ def calc_cross_axis_tilt( ---------- .. [1] Kevin Anderson and Mark Mikofski, "Slope-Aware Backtracking for Single-Axis Trackers", Technical Report NREL/TP-5K00-76626, July 2020. - https://www.nlr.gov/docs/fy20osti/76626.pdf + :doi:`10.2172/1660126` """ # delta-gamma, difference between axis and slope azimuths delta_gamma = axis_azimuth - slope_azimuth diff --git a/tests/test_tracking.py b/tests/test_tracking.py index 3550f777fd..4a0c06bdca 100644 --- a/tests/test_tracking.py +++ b/tests/test_tracking.py @@ -345,7 +345,7 @@ def test_calc_axis_tilt(): def test_slope_aware_backtracking(): """ - Test validation data set from https://www.nlr.gov/docs/fy20osti/76626.pdf + Test validation data set from https://doi.org/10.2172/1660126 """ index = pd.date_range('2019-01-01T08:00', '2019-01-01T17:00', freq='h') index = index.tz_localize('Etc/GMT+5') From c3df9a84871276ff8d6433ad2f1449ce94875d47 Mon Sep 17 00:00:00 2001 From: obsidian Date: Wed, 4 Mar 2026 09:44:17 -0800 Subject: [PATCH 09/10] Address wholmgren's review on PR #2705 - Rename nrel_api_key fixture to nlr_api_key directly (no alias) - Simplify fixture: check NLR_API_KEY, warn with DEMO_KEY fallback (no NREL_API_KEY deprecation logic) - Update test_psm4.py to use nlr_api_key fixture - Remove NREL_API_KEY from CI workflow - Update whatsnew: remove fallback mention, link nrel_nlr doc page --- .github/workflows/pytest-remote-data.yml | 1 - docs/sphinx/source/whatsnew/v0.15.1.rst | 5 ++-- tests/conftest.py | 34 ++++++++++-------------- tests/iotools/test_psm4.py | 32 +++++++++++----------- 4 files changed, 33 insertions(+), 39 deletions(-) diff --git a/.github/workflows/pytest-remote-data.yml b/.github/workflows/pytest-remote-data.yml index dc7346ea65..9aa72b1514 100644 --- a/.github/workflows/pytest-remote-data.yml +++ b/.github/workflows/pytest-remote-data.yml @@ -97,7 +97,6 @@ jobs: env: # copy GitHub Secrets into environment variables for the tests to access NLR_API_KEY: ${{ secrets.NRELAPIKEY }} - NREL_API_KEY: ${{ secrets.NRELAPIKEY }} SOLARANYWHERE_API_KEY: ${{ secrets.SOLARANYWHERE_API_KEY }} BSRN_FTP_USERNAME: ${{ secrets.BSRN_FTP_USERNAME }} BSRN_FTP_PASSWORD: ${{ secrets.BSRN_FTP_PASSWORD }} diff --git a/docs/sphinx/source/whatsnew/v0.15.1.rst b/docs/sphinx/source/whatsnew/v0.15.1.rst index 696d37a3ed..959edbaa19 100644 --- a/docs/sphinx/source/whatsnew/v0.15.1.rst +++ b/docs/sphinx/source/whatsnew/v0.15.1.rst @@ -58,8 +58,9 @@ Maintenance ~~~~~~~~~~~ * Update all NREL references to NLR (National Laboratory of the Rockies) following the laboratory rename and domain migration from ``nrel.gov`` - to ``nlr.gov``. Add ``NLR_API_KEY`` environment variable support with - ``NREL_API_KEY`` fallback. (:issue:`2701`, :pull:`2705`) + to ``nlr.gov``. Rename ``NREL_API_KEY`` environment variable to + ``NLR_API_KEY``. See :ref:`nrel_nlr` for details. + (:issue:`2701`, :pull:`2705`) Contributors diff --git a/tests/conftest.py b/tests/conftest.py index 22717a5d08..8a1c1180d8 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -86,33 +86,27 @@ def assert_frame_equal(left, right, **kwargs): @pytest.fixture(scope="module") -def nrel_api_key(): - """API key for NLR Developer Network (formerly NREL). - - Checks NLR_API_KEY first, falls back to NREL_API_KEY - with deprecation warning. +def nlr_api_key(): + """Supplies pvlib-python's NLR Developer Network API key. + + pvlib's CI utilizes a secret variable set to NLR_API_KEY + (formerly NREL_API_KEY) to mitigate failures associated with + using the default key of "DEMO_KEY". A user is capable of using + their own key this way if desired however the default key should + suffice for testing purposes. """ try: demo_key = os.environ["NLR_API_KEY"] except KeyError: - try: - demo_key = os.environ["NREL_API_KEY"] - warnings.warn( - "NREL_API_KEY is deprecated, use NLR_API_KEY instead", - DeprecationWarning, - stacklevel=2, - ) - except KeyError: - pytest.skip("requires NLR_API_KEY or NREL_API_KEY env var") + warnings.warn( + "WARNING: NLR_API_KEY (formerly NREL_API_KEY) environment " + "variable not set! Using DEMO_KEY instead. " + "Unexpected failures may occur." + ) + demo_key = 'DEMO_KEY' return demo_key -@pytest.fixture(scope="module") -def nlr_api_key(nrel_api_key): - """Alias for nrel_api_key fixture.""" - return nrel_api_key - - try: # Attempt to load BSRN credentials used for testing pvlib.iotools.get_bsrn bsrn_username = os.environ["BSRN_FTP_USERNAME"] diff --git a/tests/iotools/test_psm4.py b/tests/iotools/test_psm4.py index 6447aed33b..3d06c27a3d 100644 --- a/tests/iotools/test_psm4.py +++ b/tests/iotools/test_psm4.py @@ -4,7 +4,7 @@ from pvlib.iotools import psm4 from ..conftest import ( - TESTS_DATA_DIR, RERUNS, RERUNS_DELAY, assert_index_equal, nrel_api_key + TESTS_DATA_DIR, RERUNS, RERUNS_DELAY, assert_index_equal, nlr_api_key ) import numpy as np import pandas as pd @@ -54,10 +54,10 @@ def assert_psm4_equal(data, metadata, expected): @pytest.mark.remote_data @pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY) -def test_get_nsrdb_psm4_tmy(nrel_api_key): +def test_get_nsrdb_psm4_tmy(nlr_api_key): """test get_nsrdb_psm4_tmy with a TMY""" data, metadata = psm4.get_nsrdb_psm4_tmy(LATITUDE, LONGITUDE, - nrel_api_key, PVLIB_EMAIL, + nlr_api_key, PVLIB_EMAIL, year='tmy-2023', leap_day=False, map_variables=False) @@ -67,10 +67,10 @@ def test_get_nsrdb_psm4_tmy(nrel_api_key): @pytest.mark.remote_data @pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY) -def test_get_nsrdb_psm4_full_disc(nrel_api_key): +def test_get_nsrdb_psm4_full_disc(nlr_api_key): """test get_nsrdb_psm4_full_disc with a single year""" data, metadata = psm4.get_nsrdb_psm4_full_disc(LATITUDE, LONGITUDE, - nrel_api_key, PVLIB_EMAIL, + nlr_api_key, PVLIB_EMAIL, year='2023', leap_day=False, map_variables=False) @@ -80,10 +80,10 @@ def test_get_nsrdb_psm4_full_disc(nrel_api_key): @pytest.mark.remote_data @pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY) -def test_get_nsrdb_psm4_conus_singleyear(nrel_api_key): +def test_get_nsrdb_psm4_conus_singleyear(nlr_api_key): """test get_nsrdb_psm4_conus with a single year""" data, metadata = psm4.get_nsrdb_psm4_aggregated(LATITUDE, LONGITUDE, - nrel_api_key, + nlr_api_key, PVLIB_EMAIL, year='2023', leap_day=False, @@ -95,10 +95,10 @@ def test_get_nsrdb_psm4_conus_singleyear(nrel_api_key): @pytest.mark.remote_data @pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY) -def test_get_nsrdb_psm4_conus_5min(nrel_api_key): +def test_get_nsrdb_psm4_conus_5min(nlr_api_key): """test get_nsrdb_psm4_conus for 5-minute data""" data, metadata = psm4.get_nsrdb_psm4_conus(LATITUDE, LONGITUDE, - nrel_api_key, PVLIB_EMAIL, + nlr_api_key, PVLIB_EMAIL, year='2023', time_step=5, leap_day=False, map_variables=False) @@ -110,10 +110,10 @@ def test_get_nsrdb_psm4_conus_5min(nrel_api_key): @pytest.mark.remote_data @pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY) -def test_get_nsrdb_psm4_aggregated_check_leap_day(nrel_api_key): +def test_get_nsrdb_psm4_aggregated_check_leap_day(nlr_api_key): """test get_nsrdb_psm4_aggregated for leap day""" data_2012, _ = psm4.get_nsrdb_psm4_aggregated(LATITUDE, LONGITUDE, - nrel_api_key, PVLIB_EMAIL, + nlr_api_key, PVLIB_EMAIL, year="2012", time_step=60, leap_day=True, map_variables=False) @@ -122,9 +122,9 @@ def test_get_nsrdb_psm4_aggregated_check_leap_day(nrel_api_key): @pytest.mark.parametrize('latitude, longitude, api_key, year, time_step', [(LATITUDE, LONGITUDE, 'BAD', '2023', 60), - (51, -5, nrel_api_key, '2023', 60), - (LATITUDE, LONGITUDE, nrel_api_key, 'bad', 60), - (LATITUDE, LONGITUDE, nrel_api_key, '2023', 15), + (51, -5, nlr_api_key, '2023', 60), + (LATITUDE, LONGITUDE, nlr_api_key, 'bad', 60), + (LATITUDE, LONGITUDE, nlr_api_key, '2023', 15), ]) @pytest.mark.remote_data @pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY) @@ -187,11 +187,11 @@ def test_read_nsrdb_psm4_map_variables(): @pytest.mark.remote_data @pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY) -def test_get_nsrdb_psm4_aggregated_parameter_mapping(nrel_api_key): +def test_get_nsrdb_psm4_aggregated_parameter_mapping(nlr_api_key): """Test that pvlib names can be passed in as parameters and get correctly reverse mapped to psm4 names""" data, meta = psm4.get_nsrdb_psm4_aggregated( - LATITUDE, LONGITUDE, nrel_api_key, PVLIB_EMAIL, year='2019', + LATITUDE, LONGITUDE, nlr_api_key, PVLIB_EMAIL, year='2019', time_step=60, parameters=['ghi', 'wind_speed'], leap_day=False, map_variables=True) # Check that columns are in the correct order (GH1647) From 01ad3d8a9f09c1b2923827c151818b33a8261899 Mon Sep 17 00:00:00 2001 From: obsidian Date: Wed, 4 Mar 2026 09:45:55 -0800 Subject: [PATCH 10/10] chore: add runtime dirs to .gitignore --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index c9d19f557d..0258b3975c 100644 --- a/.gitignore +++ b/.gitignore @@ -99,3 +99,8 @@ coverage.xml env results + +# Gas Town runtime +.beads/ +.claude/ +.runtime/