Skip to content

Commit 6b6d696

Browse files
authored
Merge pull request #643 from IN-CORE/release-1.21.0
Release 1.21.0
2 parents 86c639a + d03cda6 commit 6b6d696

21 files changed

+166
-55
lines changed

.github/workflows/conda.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ jobs:
6262
run: |
6363
conda install conda-build
6464
mkdir dist
65-
conda build --output-folder dist \
65+
conda build --package-format=tar.bz2 \
66+
--output-folder dist \
6667
--label ${{ env.LABEL }} \
6768
recipes
6869

.github/workflows/doc.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ jobs:
5151
tags="${tags},${version}"
5252
version=${version%.*}
5353
done
54+
# Remove any unwanted double quotes from tags
55+
tags=$(echo $tags | sed 's/"//g')
5456
echo "VERSION=${version}" >> $GITHUB_ENV
5557
echo "TAGS=${tags}" >> $GITHUB_ENV
5658
elif [ "$BRANCH" == "develop" ]; then
@@ -61,6 +63,10 @@ jobs:
6163
echo "TAGS=${BRANCH}" >> $GITHUB_ENV
6264
fi
6365
66+
# debug TAGS
67+
- name: Debug TAGS
68+
run: echo "TAGS=${{ env.TAGS }}"
69+
6470
# build image
6571
- name: Build image
6672
uses: elgohr/Publish-Docker-Github-Action@3.04

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [1.21.0] - 2025-02-12
9+
10+
### Changed
11+
- Enable internal network names for each service [#638](https://github.com/IN-CORE/pyincore/issues/638)
12+
- Update production URL references to tools.in-core.org and dev to dev.in-core.org [#634](https://github.com/IN-CORE/pyincore/issues/634)
13+
14+
### Fixed
15+
- Documentation container tagging error by github action [#631](https://github.com/IN-CORE/pyincore/issues/631)
16+
- Updated rasterio dependency to the latest to fetch correct GDAL version [#636](https://github.com/IN-CORE/pyincore/issues/636)
17+
18+
819
## [1.20.1] - 2024-11-01
920

1021
### Fixed

README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ To update **pyIncore**, run
3333
conda update -c in-core pyincore
3434
3535
You can find detail information at the
36-
`Installation <https://incore.ncsa.illinois.edu/doc/incore/pyincore/install_pyincore.html>`__
36+
`Installation <https://tools.in-core.org/doc/incore/pyincore/install_pyincore.html>`__
3737
section at IN-CORE manual.
3838

3939
Installation with pip
@@ -61,17 +61,17 @@ Testing and Running
6161
-------------------
6262

6363
Please read the `Testing and
64-
Running <https://incore.ncsa.illinois.edu/doc/incore/pyincore/running.html>`__
64+
Running <https://tools.in-core.org/doc/incore/pyincore/running.html>`__
6565
section at IN-CORE manual.
6666

6767
Documentation
6868
-------------
6969

7070
**pyIncore** documentation can be found at
71-
https://incore.ncsa.illinois.edu/doc/incore/pyincore.html
71+
https://tools.in-core.org/doc/incore/pyincore.html
7272

7373
**pyIncore** technical reference (API) can be found at
74-
https://incore.ncsa.illinois.edu/doc/pyincore/.
74+
https://tools.in-core.org/doc/pyincore/.
7575

7676
Acknowledgement
7777
---------------

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
author = ""
3434

3535
# The short X.Y version
36-
version = "1.20"
36+
version = "1.21"
3737
# The full version, including alpha/beta/rc tags
38-
release = "1.20.1"
38+
release = "1.21.0"
3939

4040
# -- General configuration ---------------------------------------------------
4141

docs/source/refs.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ References
55

66
<embed>
77
<ul>
8-
<li><a href="https://incore.ncsa.illinois.edu/doc/incore/" target="_blank">IN-CORE</a> Manual</li>
9-
<li><a href="https://incore.ncsa.illinois.edu/doc/pyincore_viz/" target="_blank">pyIncore-viz</a> Reference</li>
10-
<li><a href="https://incore.ncsa.illinois.edu/doc/pyincore_data/" target="_blank">pyIncore-data</a> Reference</li>
11-
<li><a href="https://incore.ncsa.illinois.edu/doc/api/" target="_blank">IN-CORE Web Services API</a> specifications</li>
8+
<li><a href="https://tools.in-core.org/doc/incore/" target="_blank">IN-CORE</a> Manual</li>
9+
<li><a href="https://tools.in-core.org/doc/pyincore_viz/" target="_blank">pyIncore-viz</a> Reference</li>
10+
<li><a href="https://tools.in-core.org/doc/pyincore_data/" target="_blank">pyIncore-data</a> Reference</li>
11+
<li><a href="https://tools.in-core.org/doc/api/" target="_blank">IN-CORE Web Services API</a> specifications</li>
1212
</ul>
1313
</embed>

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies:
1515
- pyproj>=3.6.1
1616
- pytest>=3.9.0
1717
- python-jose>=3.0
18-
- rasterio>=1.3.9
18+
- rasterio>=1.4.2
1919
- requests>=2.31.0
2020
- rtree>=1.1.0
2121
- scipy>=1.11.3

pyincore/client.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ def __init__(
171171
username: str = None,
172172
usergroups: list = None,
173173
internal: bool = False,
174+
local: bool = False,
174175
offline: bool = False,
175176
):
176177
"""
@@ -183,12 +184,13 @@ def __init__(
183184
super().__init__()
184185
self.offline = offline
185186
self.internal = internal
187+
self.local = local
186188

187189
if not offline:
188190
if service_url is None or len(service_url.strip()) == 0:
189191
service_url = pyglobals.INCORE_API_PROD_URL
190-
if internal:
191-
service_url = pyglobals.INCORE_INTERNAL_API_URL
192+
if local:
193+
service_url = pyglobals.INCORE_LOCAL_API_URL
192194

193195
self.service_url = service_url
194196
self.token_url = urllib.parse.urljoin(
@@ -211,7 +213,7 @@ def __init__(
211213
if not os.path.exists(self.hashed_svc_data_dir):
212214
os.makedirs(self.hashed_svc_data_dir)
213215

214-
if internal:
216+
if internal or local:
215217
# Constructing the headers
216218
self.session.headers["x-auth-userinfo"] = json.dumps(
217219
{"preferred_username": username}
@@ -262,6 +264,9 @@ def login(self):
262264
if self.internal is True:
263265
logger.warning("Internal mode does not have login method.")
264266
return False
267+
if self.local is True:
268+
logger.warning("Local mode does not have login method.")
269+
return False
265270

266271
for attempt in range(pyglobals.MAX_LOGIN_ATTEMPTS):
267272
try:
@@ -312,6 +317,11 @@ def store_authorization_in_file(self, authorization: str):
312317
"Internal mode does not have store_authorization_in_file method."
313318
)
314319
return
320+
if self.local is True:
321+
logger.warning(
322+
"Local mode does not have store_authorization_in_file method."
323+
)
324+
return
315325
try:
316326
with open(self.token_file, "w") as f:
317327
f.write(authorization)
@@ -330,6 +340,9 @@ def is_token_expired(self, token):
330340
if self.internal is True:
331341
logger.warning("Internal mode does not have is_token_expired method.")
332342
return
343+
if self.local is True:
344+
logger.warning("Local mode does not have is_token_expired method.")
345+
return
333346

334347
# Split the token to get payload
335348
_, payload_encoded, _ = token.split(".")
@@ -361,6 +374,9 @@ def retrieve_token_from_file(self):
361374
"Internal mode does not have retrieve_token_from_file method."
362375
)
363376
return
377+
if self.local is True:
378+
logger.warning("Local mode does not have retrieve_token_from_file method.")
379+
return
364380

365381
if not os.path.isfile(self.token_file):
366382
return None

pyincore/dataservice.py

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,27 @@ class DataService:
3131

3232
def __init__(self, client: IncoreClient):
3333
self.client = client
34-
self.base_url = urljoin(client.service_url, "data/api/datasets/")
35-
self.files_url = urljoin(client.service_url, "data/api/files/")
36-
self.base_earthquake_url = urljoin(
37-
client.service_url, "hazard/api/earthquakes/"
38-
)
39-
self.base_tornado_url = urljoin(client.service_url, "hazard/api/tornadoes/")
34+
35+
if self.client.internal:
36+
self.base_url = urljoin(
37+
pyglobals.INCORE_INTERNAL_DATA_API_URL, "data/api/datasets/"
38+
)
39+
self.base_earthquake_url = urljoin(
40+
pyglobals.INCORE_INTERNAL_HAZARD_API_URL, "hazard/api/earthquakes/"
41+
)
42+
self.base_tornado_url = urljoin(
43+
pyglobals.INCORE_INTERNAL_HAZARD_API_URL, "hazard/api/tornadoes/"
44+
)
45+
self.files_url = urljoin(
46+
pyglobals.INCORE_INTERNAL_DATA_API_URL, "data/api/files/"
47+
)
48+
else:
49+
self.base_url = urljoin(client.service_url, "data/api/datasets/")
50+
self.base_earthquake_url = urljoin(
51+
client.service_url, "hazard/api/earthquakes/"
52+
)
53+
self.base_tornado_url = urljoin(client.service_url, "hazard/api/tornadoes/")
54+
self.files_url = urljoin(client.service_url, "data/api/files/")
4055

4156
@forbid_offline
4257
def get_dataset_metadata(self, dataset_id: str, timeout=(30, 600), **kwargs):

pyincore/dfr3service.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,12 @@ class Dfr3Service:
6666

6767
def __init__(self, client: IncoreClient):
6868
self.client = client
69-
self.base_mapping_url = urljoin(client.service_url, "dfr3/api/mappings/")
69+
if self.client.internal:
70+
self.base_mapping_url = urljoin(
71+
pyglobals.INCORE_INTERNAL_DFR3_API_URL, "dfr3/api/mappings/"
72+
)
73+
else:
74+
self.base_mapping_url = urljoin(client.service_url, "dfr3/api/mappings/")
7075

7176
@forbid_offline
7277
def get_dfr3_set(self, dfr3_id: str, timeout=(30, 600), **kwargs):

0 commit comments

Comments
 (0)