-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from BillMills/gridtools
easyocean
- Loading branch information
Showing
6 changed files
with
15 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ FROM python:3.9 | |
|
||
RUN pip install requests pytest area numpy scipy | ||
WORKDIR /app | ||
COPY . . | ||
COPY . . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
## Build and release | ||
|
||
- Review metadata in `pyproject.toml`; while determining if code is release worthy, append an rc tag to the semantic version, like `major.minor.patch.rcxx` | ||
- Build a release: | ||
- Build a release (image is built off of `Dockerfile-build-env`): | ||
``` | ||
docker container run -v $(pwd):/src argovis/argovis_helpers:build-220912 python -m build | ||
docker container run -v $(pwd):/src argovis/argovis_helpers:build-240118 python -m build | ||
``` | ||
- Push to testPypi: | ||
- Push to testPypi (notice you'll need a file `pypirc` with appropriate API tokens for the pypi servers): | ||
``` | ||
docker container run -v $(pwd):/src -it argovis/argovis_helpers:build-220912 twine upload -r testpypi dist/<your new rc> | ||
docker container run -v $(pwd):/src -v $(pwd)/pypirc:/root/.pypirc -it argovis/argovis_helpers:build-240118 twine upload -r testpypi dist/<your new rc> | ||
``` | ||
- Test install and try: `python -m pip install -i https://test.pypi.org/simple argovis_helpers` | ||
- If all is well, rebuild without the rc tag and push to pypi: | ||
``` | ||
docker container run -v $(pwd):/src -it argovis/argovis_helpers:build-220912 twine upload dist/<your new release> | ||
docker container run -v $(pwd):/src -v $(pwd)/pypirc:/root/.pypirc -it argovis/argovis_helpers:build-240118 twine upload dist/<your new release> | ||
``` | ||
- `git add` your new build artifacts under `/dist` | ||
- Push to github and mint a release matching the version number in `pyproject.toml`. | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,10 +24,10 @@ def argofetch(route, options={}, apikey='', apiroot='https://argovis-api.colorad | |
time.sleep(wait*1.1) | ||
return argofetch(route, options=o, apikey=apikey, apiroot=apiroot, suggestedLatency=latency, verbose=verbose) | ||
|
||
if statuscode!=404 and statuscode!=200: | ||
if (statuscode!=404 and statuscode!=200) or (statuscode==200 and type(dl) is dict and 'code' in dl): | ||
if statuscode == 413: | ||
print('The temporospatial extent of your request is enormous! Consider using the `query` helper in this package to split it up into more manageable chunks.') | ||
elif statuscode >= 500: | ||
elif statuscode >= 500 or (statuscode==200 and type(dl) is dict and 'code' in dl): | ||
print("Argovis' servers experienced an error. Please try your request again, and email [email protected] if this keeps happening; please include the full details of the the request you made so we can help address.") | ||
raise Exception(statuscode) | ||
|
||
|
@@ -41,14 +41,15 @@ def query(route, options={}, apikey='', apiroot='https://argovis-api.colorado.ed | |
r = re.sub('^/', '', route) | ||
r = re.sub('/$', '', r) | ||
|
||
data_routes = ['argo', 'cchdo', 'drifters', 'tc', 'argotrajectories', 'grids/rg09', 'grids/kg21', 'grids/glodap' 'timeseries/noaasst', 'timeseries/copernicussla', 'timeseries/ccmpwind'] | ||
data_routes = ['argo', 'cchdo', 'drifters', 'tc', 'argotrajectories', 'easyocean', 'grids/rg09', 'grids/kg21', 'grids/glodap' 'timeseries/noaasst', 'timeseries/copernicussla', 'timeseries/ccmpwind'] | ||
|
||
scoped_parameters = { | ||
'argo': ['id','platform'], | ||
'cchdo': ['id', 'woceline', 'cchdo_cruise'], | ||
'drifters': ['id', 'wmo', 'platform'], | ||
'tc': ['id', 'name'], | ||
'argotrajectories': ['id', 'platform'], | ||
'easyocean': ['id', 'woceline'], | ||
'grids/rg09': ['id'], | ||
'grids/kg21': ['id'], | ||
'grids/glodap': ['id'], | ||
|
@@ -63,6 +64,7 @@ def query(route, options={}, apikey='', apiroot='https://argovis-api.colorado.ed | |
'drifters': parsetime("1987-10-01T13:00:00.000Z"), | ||
'tc': parsetime("1851-06-24T00:00:00.000Z"), | ||
'argotrajectories': parsetime("2001-01-03T22:46:33.000Z"), | ||
'easyocean': parsetime("1983-10-08T00:00:00.000Z"), | ||
'grids/rg09': parsetime("2004-01-14T00:00:00.000Z"), | ||
'grids/kg21': parsetime("2005-01-14T00:00:00.000Z"), | ||
'grids/glodap': parsetime("0001-01-01T00:00:00.000Z"), | ||
|
@@ -71,12 +73,14 @@ def query(route, options={}, apikey='', apiroot='https://argovis-api.colorado.ed | |
'timeseries/ccmpwind': parsetime("1993-01-02T00:00:00Z") | ||
} | ||
|
||
# plus a day vs the API, just to make sure we don't artificially cut off | ||
last_records = { | ||
'argo': datetime.datetime.now(), | ||
'cchdo': parsetime("2023-03-10T17:48:00.000Z"), | ||
'drifters': parsetime("2020-07-01T23:00:00.000Z"), | ||
'tc': parsetime("2020-12-26T12:00:00.000Z"), | ||
'argotrajectories': parsetime("2021-01-02T01:13:26.000Z"), | ||
'easyocean': parsetime("2022-10-17T00:00:00.000Z"), | ||
'grids/rg09': parsetime("2022-05-16T00:00:00.000Z"), | ||
'grids/kg21': parsetime("2020-12-16T00:00:00.000Z"), | ||
'grids/glodap': parsetime("0001-01-02T00:00:00.000Z"), | ||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters