Skip to content

Commit c857047

Browse files
committed
use urljoin
1 parent c23ce24 commit c857047

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

pvlib/iotools/psm4.py

Lines changed: 5 additions & 5 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',

0 commit comments

Comments
 (0)