Skip to content

Commit

Permalink
Merge pull request #53 from openmethane/remove-json-scripts
Browse files Browse the repository at this point in the history
Remove scripts for transforming NetCDF to JSON
  • Loading branch information
aethr authored Nov 22, 2024
2 parents 45ded01 + 66465b1 commit c522b2b
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 300 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
run: |
cd /opt/project
cp .env.example .env
python -m pytest -r a -v tests/integration/test_domain_json.py
python -m pytest -r a -v tests/integration/test_domain.py
env:
CDSAPI_KEY: ${{ secrets.CDSAPI_ADS_KEY }}
CDSAPI_URL: https://ads.atmosphere.copernicus.eu/api
Expand Down
1 change: 1 addition & 0 deletions changelog/53.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove scripts to transform NetCDF files to JSON which are no longer needed
117 changes: 0 additions & 117 deletions scripts/omDomainJSON.py

This file was deleted.

129 changes: 0 additions & 129 deletions scripts/omGeoJSON.py

This file was deleted.

27 changes: 27 additions & 0 deletions tests/integration/test_domain.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import numpy

def test_domain_attributes(input_domain):
# Check domain matches projection used in calculations
assert type(input_domain.attrs["TRUELAT1"]) == numpy.float32
assert type(input_domain.attrs["TRUELAT2"]) == numpy.float32
assert type(input_domain.attrs["MOAD_CEN_LAT"]) == numpy.float32
assert type(input_domain.attrs["STAND_LON"]) == numpy.float32
assert type(input_domain.attrs["XCENT"]) == numpy.float64
assert type(input_domain.attrs["YCENT"]) == numpy.float64

assert type(input_domain.attrs['DX']) == numpy.float32
assert input_domain.attrs['DX'] > 0
assert type(input_domain.attrs['DX']) == numpy.float32
assert input_domain.attrs['DY'] > 0

# Check domain matches projection used in calculations
def test_domain_projection(config, input_domain):
assert str(input_domain.attrs["TRUELAT1"]) in str(config.crs)
assert str(input_domain.attrs["TRUELAT2"]) in str(config.crs)
assert str(input_domain.attrs["MOAD_CEN_LAT"]) in str(config.crs)
assert str(input_domain.attrs["STAND_LON"]) in str(config.crs)
assert str(input_domain.attrs["XCENT"]) in str(config.crs)
# TODO: is this a problem?
# assert str(input_domain.attrs["YCENT"]) in str(config.crs)


53 changes: 0 additions & 53 deletions tests/integration/test_domain_json.py

This file was deleted.

0 comments on commit c522b2b

Please sign in to comment.