diff --git a/.github/workflows/pytest-remote-data.yml b/.github/workflows/pytest-remote-data.yml index 66fda9cdea..9aa72b1514 100644 --- a/.github/workflows/pytest-remote-data.yml +++ b/.github/workflows/pytest-remote-data.yml @@ -96,7 +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 - NREL_API_KEY: ${{ secrets.NRELAPIKEY }} + NLR_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/.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/ 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/examples/irradiance-decomposition/plot_diffuse_fraction.py b/docs/examples/irradiance-decomposition/plot_diffuse_fraction.py index 7eb11a53f5..16b801b3c6 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://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 e4b8ef4cc7..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 # NREL 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 @@ -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 -# (Last accessed: 18/09/2024) +# https://www.nlr.gov/grid/solar-resource/spectral +# (Last accessed: 03/03/2026) diff --git a/docs/sphinx/source/reference/iotools.rst b/docs/sphinx/source/reference/iotools.rst index 1461534a4c..9588a8daf7 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 (known as NREL prior to December 2025). .. autosummary:: :toctree: generated/ 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/docs/sphinx/source/user_guide/getting_started/installation.rst b/docs/sphinx/source/user_guide/getting_started/installation.rst index 8212c5b251..be68ca94a6 100644 --- a/docs/sphinx/source/user_guide/getting_started/installation.rst +++ b/docs/sphinx/source/user_guide/getting_started/installation.rst @@ -242,15 +242,15 @@ 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 +implementation of NREL SPA. 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: #. 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 75ab242c94..cd5447b159 100644 --- a/docs/sphinx/source/whatsnew/v0.15.1.rst +++ b/docs/sphinx/source/whatsnew/v0.15.1.rst @@ -20,11 +20,14 @@ Bug fixes * Fix a division-by-zero condition in :py:func:`pvlib.transformer.simple_efficiency` when ``load_loss = 0``. (:issue:`2645`, :pull:`2646`) +* Update URLs in :py:mod:`pvlib.iotools.psm4` to use nlr.gov instead of + nrel.gov. (:issue:`2701`, :pull:`2705`) * Fix a bug in :py:func:`pvlib.iotools.era5._m_to_cm` where meters were incorrectly divided by 100 instead of multiplied, causing precipitations to be underestimated by a factor of 10,000 when ``map_variables=True``. (:issue:`2724`, :pull:`2725`) + Enhancements ~~~~~~~~~~~~ * Use ``k`` and ``cap_adjustment`` from :py:func:`pvlib.pvsystem.Array.module_parameters` in :py:func:`pvlib.pvsystem.PVSystem.pvwatts_dc` @@ -71,6 +74,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``. Rename ``NREL_API_KEY`` environment variable to + ``NLR_API_KEY``. (:issue:`2701`, :pull:`2705`) Contributors @@ -81,6 +88,7 @@ Contributors * Cliff Hansen (:ghuser:`cwhanse`) * Anton Driesse (:ghuser:`adriesse`) * Kevin Anderson (:ghuser:`kandersolar`) +* Jason Curtis (:ghuser:`jason-curtis`) * Rohan Saxena (:ghuser:`r0hansaxena`) * Marco Fumagalli (:ghuser:`fuma900`) * Jean-Baptiste Pasquier (:ghuser:`pasquierjb`) diff --git a/docs/tutorials/tmy_to_power.ipynb b/docs/tutorials/tmy_to_power.ipynb index ae8fa43eb0..47fa9b4648 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\nhttps://nsrdb.nlr.gov/data-sets/archives" }, { "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\nhttps://www.osti.gov/biblio/951223\n" }, { "cell_type": "code", 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..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.nrel.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/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/clearsky.py b/pvlib/clearsky.py index 8cc867e020..66b732e328 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] `Bird Clear Sky Model `_ - .. [4] `SERI/TR-642-761 `_ + .. [4] SERI/TR-642-761 :doi:`10.2172/6510849` - .. [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..622fb9b958 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}` @@ -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/irradiance.py b/pvlib/irradiance.py index bc2448b036..978e520f5a 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" NREL Golden, CO, USA. NREL/TP-560-34302, Revised 2008. :doi:`10.2172/15003974` """ @@ -1731,7 +1731,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 ------- @@ -1775,7 +1775,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`. @@ -1829,7 +1829,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/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/pvsystem.py b/pvlib/pvsystem.py index 5b40a8774f..a1661eafc7 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -1565,7 +1565,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 @@ -1573,7 +1573,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. @@ -1608,7 +1608,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 @@ -1783,7 +1783,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 @@ -1791,7 +1791,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. @@ -1826,7 +1826,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, @@ -2088,7 +2088,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 -------- @@ -2893,7 +2893,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 ---------- @@ -2967,7 +2967,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: :doi:`10.1109/PVSC.2008.4922586` """ # noqa: E501 pdc = (effective_irradiance * 0.001 * pdc0 * @@ -3008,7 +3008,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..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.nrel.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.nrel.gov/docs/fy18osti/67399.pdf + :doi:`10.2172/1429291` """ return 1 - cosd(masking_angle/2)**2 diff --git a/pvlib/snow.py b/pvlib/snow.py index f2c8fca148..ec1fa0dc51 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 @@ -211,7 +211,7 @@ def dc_loss_nrel(snow_coverage, num_strings): ---------- .. [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 + 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.osti.gov/biblio/2229734 .. [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..dc84685183 100644 --- a/pvlib/solarposition.py +++ b/pvlib/solarposition.py @@ -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,8 +129,8 @@ 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 - SPA code. + Calculate the solar position using the NLR C implementation of the + NREL SPA. The source files for this code are located in './spa_c_files/', along with a README file which describes how the C code is wrapped in Python. @@ -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 @@ -432,8 +432,8 @@ 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, - USA, http://www.nrel.gov. + radiation applications. Technical report: NREL/TP-560-34302. Golden, + USA, http://www.nlr.gov. """ # Added by Tony Lorenzo (@alorenzo175), University of Arizona, 2015 @@ -987,8 +987,8 @@ 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, - USA, http://www.nrel.gov. + radiation applications. Technical report: NREL/TP-560-34302. Golden, + USA, http://www.nlr.gov. """ if not isinstance(time, pd.DatetimeIndex): diff --git a/pvlib/spa.py b/pvlib/spa.py index 6297e88c35..fe072b2cc9 100644 --- a/pvlib/spa.py +++ b/pvlib/spa.py @@ -1235,8 +1235,8 @@ 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, - USA, http://www.nrel.gov. + radiation applications. Technical report: NREL/TP-560-34302. Golden, + 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..69a9c28d4d 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. :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 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..4c8e70b693 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.” NLR. + 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..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.nrel.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/spectrum/spectrl2.py b/pvlib/spectrum/spectrl2.py index 38739efff3..af531ff0a8 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 NREL used 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 @@ -273,7 +273,7 @@ def spectrl2(apparent_zenith, aoi, surface_tilt, ground_albedo, 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.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..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.nrel.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.nrel.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.nrel.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/conftest.py b/tests/conftest.py index dc14a34254..8a1c1180d8 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -86,20 +86,22 @@ def assert_frame_equal(left, right, **kwargs): @pytest.fixture(scope="module") -def nrel_api_key(): - """Supplies pvlib-python's NREL Developer Network API key. - - 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. +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["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." + "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 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_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) 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_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..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.nrel.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')