Skip to content

Commit

Permalink
HARMONY-166: Respond to pull request comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bilts committed Mar 17, 2020
1 parent aa54c5d commit 619e476
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 8 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,5 @@ bin/test

Run an example:
```
pip install -U "python-dotenv[cli]"
dotenv python -m harmony_netcdf_to_zarr --harmony-action invoke --harmony-input "`cat example/harmony-operation.json`"
```
2 changes: 1 addition & 1 deletion bin/push-image
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -ex
image="harmony/netcdf-to-zarr"
tag=${1:-latest}

region=${AWS_DEFAULT_REGION-"us-west-2"}
region=${AWS_DEFAULT_REGION:-"us-west-2"}

account=$(aws sts get-caller-identity --output text --query 'Account')
# Need to remove \r returned on all aws commands run from Bamboo
Expand Down
4 changes: 2 additions & 2 deletions bin/repl-with-zarr-opener
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ def open_localstack_zarr(name):
client_kwargs=dict(
region_name='us-west-2',
endpoint_url='http://localhost:4572',
aws_access_key_id='ACCESS_KEY',
aws_secret_access_key='SECRET_KEY'))
aws_access_key_id='DUMMY_ACCESS_KEY',
aws_secret_access_key='DUMMY_SECRET_KEY'))
store = fs.get_mapper(root=name, check=False)
return zarr.open(store)
EOF)"
9 changes: 9 additions & 0 deletions bin/run-in-docker
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
#!/bin/bash

# This script mounts the contents of the current directory, and optionally the Python library in a peer
# directory into the Harmony docker image and runs it. It is meant to allow development and testing
# without repeatedly rebuilding the docker image. To run a completely clean container using only what
# is in the image, as will be done in deployed environments, run
# `docker run --rm -it --env-file=.env harmony/netcdf-to-zarr`

set -ex

find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf

# CLI flags. Mount the current directory into the docker container's working directory
args="-v $(pwd):/home"

# If a peer directory exists for the Harmony python library, also mount it into the container, otherwise
# it will use the version installed when the container was built
if [ -d ../harmony-service-lib-py ]; then
(cd ../harmony-service-lib-py && make clean)
args="$args -v $(pwd)/../harmony-service-lib-py/harmony:/usr/lib/harmony-service-lib-py/harmony"
Expand Down
6 changes: 6 additions & 0 deletions bin/test-in-docker
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

set -e

# This script mounts the contents of the current directory, and optionally the Python library in a peer
# directory into the Harmony docker image and runs the test suite. It is meant to allow development and
# testing without repeatedly rebuilding the docker image. To run a completely clean container using only
# what is in the image, as will be done in CI environments, run
# `docker run --rm -it --env-file=.env harmony/netcdf-to-zarr-tests`

find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf

args="-v $(pwd):/home"
Expand Down
2 changes: 1 addition & 1 deletion example/dotenv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The environent. If set to "dev" or "test" the code will not attempt to call back to
# The environment. If set to "dev" or "test" the code will not attempt to call back to
# Harmony and will instead log the callbacks that would have been made.
ENV=dev

Expand Down
2 changes: 1 addition & 1 deletion harmony_netcdf_to_zarr/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
__main__.py
=========
Runs the harmony_gdal CLI
Runs the harmony_netcdf_to_zarr CLI
"""

import sys
Expand Down
3 changes: 2 additions & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pytest >= 5.1.2
safety >= 1.8.5
coverage >= 4.5.4
moto >= 1.3.14
moto >= 1.3.14
python-dotenv>=0.12.0
1 change: 0 additions & 1 deletion tests/util/file_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def create_full_dataset(filename=None):
[ -5.5, 0.0, 5.5],
[-11.0, -5.5, 0.0]
]
#lats.make_scale('lat')
lons[:, :] = np.rot90(lats, 3, axes=(0, 1))

times[0] = 166536 # January 1st 2020
Expand Down

0 comments on commit 619e476

Please sign in to comment.