-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Includes: - Python dependencies file and instructions - CI - Actual fixes
- Loading branch information
Showing
17 changed files
with
190 additions
and
50 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Continuous integration | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
cache: "pip" | ||
- name: Install dependencies | ||
run: pip install -r requirements.txt | ||
- name: Validate collections | ||
run: python scripts/validate_collection.py |
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
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 |
---|---|---|
|
@@ -8,10 +8,10 @@ | |
"spatial":{ | ||
"bbox":[ | ||
[ | ||
"-180", | ||
"90", | ||
"-90", | ||
"180" | ||
-180, | ||
90, | ||
-90, | ||
180 | ||
] | ||
] | ||
}, | ||
|
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 |
---|---|---|
|
@@ -8,10 +8,10 @@ | |
"spatial":{ | ||
"bbox":[ | ||
[ | ||
"-180", | ||
"90", | ||
"-90", | ||
"180" | ||
-180, | ||
90, | ||
-90, | ||
180 | ||
] | ||
] | ||
}, | ||
|
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
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 |
---|---|---|
|
@@ -8,10 +8,10 @@ | |
"spatial":{ | ||
"bbox":[ | ||
[ | ||
"-180", | ||
"90", | ||
"-90", | ||
"180" | ||
-180, | ||
90, | ||
-90, | ||
180 | ||
] | ||
] | ||
}, | ||
|
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
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 |
---|---|---|
|
@@ -8,10 +8,10 @@ | |
"spatial":{ | ||
"bbox":[ | ||
[ | ||
"-125.0", | ||
"24.0", | ||
"-75.0", | ||
"43.0" | ||
-125.0, | ||
24.0, | ||
-75.0, | ||
43.0 | ||
] | ||
] | ||
}, | ||
|
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
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
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
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 |
---|---|---|
|
@@ -8,10 +8,10 @@ | |
"spatial":{ | ||
"bbox":[ | ||
[ | ||
"-180", | ||
"90", | ||
"-90", | ||
"180" | ||
-180, | ||
90, | ||
-90, | ||
180 | ||
] | ||
] | ||
}, | ||
|
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 |
---|---|---|
|
@@ -8,10 +8,10 @@ | |
"spatial":{ | ||
"bbox":[ | ||
[ | ||
"-180", | ||
"90", | ||
"-90", | ||
"180" | ||
-180, | ||
90, | ||
-90, | ||
180 | ||
] | ||
] | ||
}, | ||
|
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 |
---|---|---|
|
@@ -8,10 +8,10 @@ | |
"spatial":{ | ||
"bbox":[ | ||
[ | ||
"-0.14", | ||
"6.10", | ||
"1.80", | ||
"11.13" | ||
-0.14, | ||
6.10, | ||
1.80, | ||
11.13 | ||
] | ||
] | ||
}, | ||
|
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pip-tools | ||
pystac[validation] |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# | ||
# This file is autogenerated by pip-compile with Python 3.11 | ||
# by the following command: | ||
# | ||
# pip-compile | ||
# | ||
attrs==23.1.0 | ||
# via jsonschema | ||
build==1.0.3 | ||
# via pip-tools | ||
click==8.1.7 | ||
# via pip-tools | ||
jsonschema==4.17.3 | ||
# via pystac | ||
packaging==23.1 | ||
# via build | ||
pip-tools==7.3.0 | ||
# via -r requirements.in | ||
pyproject-hooks==1.0.0 | ||
# via build | ||
pyrsistent==0.19.3 | ||
# via jsonschema | ||
pystac[validation]==1.8.3 | ||
# via -r requirements.in | ||
python-dateutil==2.8.2 | ||
# via pystac | ||
six==1.16.0 | ||
# via python-dateutil | ||
wheel==0.41.2 | ||
# via pip-tools | ||
|
||
# The following packages are considered to be unsafe in a requirements file: | ||
# pip | ||
# setuptools |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env python3 | ||
|
||
"""Validates all collections in ingestion-data/collections""" | ||
|
||
import json | ||
import sys | ||
from pathlib import Path | ||
|
||
from pystac import Collection, STACValidationError | ||
|
||
root = Path(__file__).parents[1] | ||
collections = root / "ingestion-data" / "collections" | ||
|
||
errors = dict() | ||
for path in collections.rglob("*.json"): | ||
try: | ||
collection = Collection.from_file(str(path)) | ||
except Exception as error: | ||
errors[path.name] = { | ||
"type": "error", | ||
"message": f"cannot read collection, {type(error)}: {error}", | ||
} | ||
continue | ||
try: | ||
collection.validate() | ||
except STACValidationError as error: | ||
if isinstance(error.source, list): | ||
message = [str(e) for e in error.source] | ||
else: | ||
message = str(error.source) | ||
errors[path.name] = { | ||
"type": "invalid", | ||
"message": message, | ||
} | ||
|
||
if errors: | ||
json.dump(errors, sys.stdout, indent=2) | ||
sys.exit(1) |