Skip to content

Commit 703685a

Browse files
committed
Merge branch 'nsrdb_goes_v4' of https://github.com/williamhobbs/pvlib-python into nsrdb_goes_v4
2 parents 30bf1b1 + bd4f760 commit 703685a

3 files changed

Lines changed: 9 additions & 14 deletions

File tree

pvlib/iotools/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
from pvlib.iotools.psm3 import get_psm3 # noqa: F401
1212
from pvlib.iotools.psm3 import read_psm3 # noqa: F401
1313
from pvlib.iotools.psm3 import parse_psm3 # noqa: F401
14+
from pvlib.iotools.psm4 import get_psm4 # noqa: F401
15+
from pvlib.iotools.psm4 import read_psm4 # noqa: F401
16+
from pvlib.iotools.psm4 import parse_psm4 # noqa: F401
1417
from pvlib.iotools.pvgis import get_pvgis_tmy, read_pvgis_tmy # noqa: F401
1518
from pvlib.iotools.pvgis import read_pvgis_hourly # noqa: F401
1619
from pvlib.iotools.pvgis import get_pvgis_hourly # noqa: F401
@@ -34,6 +37,3 @@
3437
from pvlib.iotools.solcast import get_solcast_historic # noqa: F401
3538
from pvlib.iotools.solcast import get_solcast_tmy # noqa: F401
3639
from pvlib.iotools.solargis import get_solargis # noqa: F401
37-
from pvlib.iotools.goes4 import get_goes4 # noqa: F401
38-
from pvlib.iotools.goes4 import read_goes4 # noqa: F401
39-
from pvlib.iotools.goes4 import parse_goes4 # noqa: F401

pvlib/iotools/psm4.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
"""
66

77
import io
8+
from urllib.parse import urljoin
89
import requests
910
import pandas as pd
1011
from json import JSONDecodeError
1112

12-
NSRDB_API_BASE = "https://developer.nrel.gov"
13-
API_STUB = "/api/nsrdb/v2/solar/"
13+
NSRDB_API_BASE = "https://developer.nrel.gov/api/nsrdb/v2/solar/"
1414
GOES_ENDPOINT = "nsrdb-GOES-aggregated-v4-0-0-download.csv"
1515
TMY_ENDPOINT = "nsrdb-GOES-tmy-v4-0-0-download.csv"
1616
GOESCONUS_ENDPOINT = "nsrdb-GOES-conus-v4-0-0-download.csv"
17-
GOES_URL = NSRDB_API_BASE + API_STUB + GOES_ENDPOINT
18-
TMY_URL = NSRDB_API_BASE + API_STUB + TMY_ENDPOINT
19-
GOESCONUS_URL = NSRDB_API_BASE + API_STUB + GOESCONUS_ENDPOINT
17+
GOES_URL = urljoin(NSRDB_API_BASE, GOES_ENDPOINT)
18+
TMY_URL = urljoin(NSRDB_API_BASE, TMY_ENDPOINT)
19+
GOESCONUS_URL = urljoin(NSRDB_API_BASE, GOESCONUS_ENDPOINT)
2020

2121
ATTRIBUTES = (
2222
'air_temperature', 'dew_point', 'dhi', 'dni', 'ghi', 'surface_albedo',
@@ -356,11 +356,6 @@ def read_psm4(filename, map_variables=True):
356356
Read an NSRDB PSM4 weather file (formatted as SAM CSV). The NSRDB
357357
is described in [1]_ and the SAM CSV format is described in [2]_.
358358
359-
.. versionchanged:: 0.9.0
360-
The function now returns a tuple where the first element is a dataframe
361-
and the second element is a dictionary containing metadata. Previous
362-
versions of this function had the return values switched.
363-
364359
Parameters
365360
----------
366361
filename: str

pvlib/tests/iotools/test_psm4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def test_get_psm4_attribute_mapping(nrel_api_key):
185185
"""Test that pvlib names can be passed in as attributes and get correctly
186186
reverse mapped to psm4 names"""
187187
data, meta = psm4.get_psm4(LATITUDE, LONGITUDE, nrel_api_key,
188-
PVLIB_EMAIL, names=2019, interval=60,
188+
PVLIB_EMAIL, names='2019', interval=60,
189189
attributes=['ghi', 'wind_speed'],
190190
leap_day=False, map_variables=True)
191191
# Check that columns are in the correct order (GH1647)

0 commit comments

Comments
 (0)