Skip to content

Commit

Permalink
Updated get_cams protocol to https pvlib#1457 (pvlib#1458)
Browse files Browse the repository at this point in the history
* Updated get_cams protocol to https pvlib#1457

* Updated instances of http to https. pvlib#1457

* Updated documentation links to https

* Added Contributor
  • Loading branch information
PrajwalBorkar authored May 17, 2022
1 parent a0812b1 commit 5047b26
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions docs/sphinx/source/whatsnew/v0.9.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ Contributors
~~~~~~~~~~~~
* Naman Priyadarshi (:ghuser:`Naman-Priyadarshi`)
* Chencheng Luo (:ghuser:`roger-lcc`)
* Prajwal Borkar (:ghuser:`PrajwalBorkar`)
16 changes: 8 additions & 8 deletions pvlib/iotools/sodapro.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ def get_cams(latitude, longitude, start, end, email, identifier='mcclear',
References
----------
.. [1] `CAMS Radiation Service Info
<http://www.soda-pro.com/web-services/radiation/cams-radiation-service/info>`_
<https://www.soda-pro.com/web-services/radiation/cams-radiation-service/info>`_
.. [2] `CAMS McClear Service Info
<http://www.soda-pro.com/web-services/radiation/cams-mcclear/info>`_
<https://www.soda-pro.com/web-services/radiation/cams-mcclear/info>`_
.. [3] `CAMS McClear Automatic Access
<http://www.soda-pro.com/help/cams-services/cams-mcclear-service/automatic-access>`_
<https://www.soda-pro.com/help/cams-services/cams-mcclear-service/automatic-access>`_
"""
try:
time_step_str = TIME_STEPS_MAP[time_step]
Expand Down Expand Up @@ -185,7 +185,7 @@ def get_cams(latitude, longitude, start, end, email, identifier='mcclear',
email = email.replace('@', '%2540') # Format email address
identifier = 'get_{}'.format(identifier.lower()) # Format identifier str

base_url = f"http://{server}/service/wps"
base_url = f"https://{server}/service/wps"

data_inputs_dict = {
'latitude': latitude,
Expand Down Expand Up @@ -263,9 +263,9 @@ def parse_cams(fbuf, integrated=False, label=None, map_variables=True):
References
----------
.. [1] `CAMS Radiation Service Info
<http://www.soda-pro.com/web-services/radiation/cams-radiation-service/info>`_
<https://www.soda-pro.com/web-services/radiation/cams-radiation-service/info>`_
.. [2] `CAMS McClear Service Info
<http://www.soda-pro.com/web-services/radiation/cams-mcclear/info>`_
<https://www.soda-pro.com/web-services/radiation/cams-mcclear/info>`_
"""
metadata = {}
# Initial lines starting with # contain metadata
Expand Down Expand Up @@ -366,9 +366,9 @@ def read_cams(filename, integrated=False, label=None, map_variables=True):
References
----------
.. [1] `CAMS Radiation Service Info
<http://www.soda-pro.com/web-services/radiation/cams-radiation-service/info>`_
<https://www.soda-pro.com/web-services/radiation/cams-radiation-service/info>`_
.. [2] `CAMS McClear Service Info
<http://www.soda-pro.com/web-services/radiation/cams-mcclear/info>`_
<https://www.soda-pro.com/web-services/radiation/cams-mcclear/info>`_
"""
with open(str(filename), 'r') as fbuf:
content = parse_cams(fbuf, integrated, label, map_variables)
Expand Down
4 changes: 2 additions & 2 deletions pvlib/tests/iotools/test_sodapro.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def test_get_cams(requests_mock, testfile, index, columns, values, dtypes,
mock_response = test_file.read()
# Specify the full URI of a specific example, this ensures that all of the
# inputs are passing on correctly
url_test_cams = f'http://www.soda-is.com/service/wps?DataInputs=latitude=55.7906;longitude=12.5251;altitude=80;date_begin=2020-01-01;date_end=2020-05-04;time_ref=UT;summarization=P01M;username=pvlib-admin%2540googlegroups.com;verbose=false&Service=WPS&Request=Execute&Identifier=get_{identifier}&version=1.0.0&RawDataOutput=irradiation' # noqa: E501
url_test_cams = f'https://www.soda-is.com/service/wps?DataInputs=latitude=55.7906;longitude=12.5251;altitude=80;date_begin=2020-01-01;date_end=2020-05-04;time_ref=UT;summarization=P01M;username=pvlib-admin%2540googlegroups.com;verbose=false&Service=WPS&Request=Execute&Identifier=get_{identifier}&version=1.0.0&RawDataOutput=irradiation' # noqa: E501

requests_mock.get(url_test_cams, text=mock_response,
headers={'Content-Type': 'application/csv'})
Expand Down Expand Up @@ -254,7 +254,7 @@ def test_get_cams_bad_request(requests_mock):
Please, register yourself at www.soda-pro.com
</ows:ExceptionText>"""

url_cams_bad_request = 'http://pro.soda-is.com/service/wps?DataInputs=latitude=55.7906;longitude=12.5251;altitude=-999;date_begin=2020-01-01;date_end=2020-05-04;time_ref=TST;summarization=PT01H;username=test%2540test.com;verbose=false&Service=WPS&Request=Execute&Identifier=get_mcclear&version=1.0.0&RawDataOutput=irradiation' # noqa: E501
url_cams_bad_request = 'https://pro.soda-is.com/service/wps?DataInputs=latitude=55.7906;longitude=12.5251;altitude=-999;date_begin=2020-01-01;date_end=2020-05-04;time_ref=TST;summarization=PT01H;username=test%2540test.com;verbose=false&Service=WPS&Request=Execute&Identifier=get_mcclear&version=1.0.0&RawDataOutput=irradiation' # noqa: E501

requests_mock.get(url_cams_bad_request, text=mock_response_bad,
headers={'Content-Type': 'application/xml'})
Expand Down

0 comments on commit 5047b26

Please sign in to comment.