Skip to content

Commit 43e3aea

Browse files
Merge pull request #6 from deepesdl/tejas-xxx-align-with-latest-schema
align all the records generated with latest schema
2 parents 624357a + 32068d8 commit 43e3aea

18 files changed

+1183
-441
lines changed

.github/workflows/unittest-workflow.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ jobs:
2121
shell: bash -l {0}
2222
run: |
2323
cd /home/runner/work/deep-code/deep-code
24-
pip install .[dev]
24+
pip install -e ".[dev]"
25+
26+
- name: Lint with ruff
27+
run: |
28+
pip install ruff
29+
ruff check
2530
2631
- name: Run unit tests
2732
shell: bash -l {0}

README.md

Lines changed: 20 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -56,25 +56,26 @@ pytest --cov-report html --cov=deep-code
5656
providing different utility functions.
5757
Use the --help option with these subcommands to get more details on usage.
5858

59-
The CLI retrieves the Git username and personal access token from a hidden file named .gitaccess. Ensure this file is located in the same directory where you execute the CLI
59+
The CLI retrieves the Git username and personal access token from a hidden file named
60+
.gitaccess. Ensure this file is located in the same directory where you execute the CLI
6061
command.
6162

62-
### deep-code publish-product
63-
64-
Publish a dataset which is a result of an experiment to the EarthCODE
65-
open-science catalog.
66-
67-
```commandline
68-
deep-code publish-dataset /path/to/dataset-config.yaml
69-
```
70-
7163
#### .gitaccess example
7264

7365
```
7466
github-username: your-git-user
7567
github-token: personal access token
7668
```
7769

70+
### deep-code publish
71+
72+
Publish the experiment, workflow and dataset which is a result of an experiment to
73+
the EarthCODE open-science catalog.
74+
75+
```commandline
76+
deep-code publish /path/to/dataset-config.yaml /path/to/workflow-config.yaml
77+
```
78+
7879
#### dataset-config.yaml example
7980

8081
```
@@ -92,42 +93,26 @@ cf_parameter:
9293
- name: hydrology
9394
```
9495

95-
dataset-id has to be a valid dataset-id from `deep-esdl-public` s3 or your team bucket.
96-
97-
### deep-code publish-workflow
96+
dataset-id has to be a valid dataset-id from `deep-esdl-public` s3 bucket or your team
97+
bucket.
9898

99-
Publish a workflow/experiment to the EarthCODE open-science catalog.
100-
101-
```commandline
102-
deep-code publish-workflow /path/to/workflow-config.yaml
103-
```
10499
#### workflow-config.yaml example
105100

106101
```
107-
workflow_id: "4D Med hydrology cube generation"
102+
workflow_id: "esa-cci-permafrost"
108103
properties:
109-
title: "Hydrology cube generation recipe"
110-
description: "4D Med cube generation"
104+
title: "ESA CCI permafrost"
105+
description: "cube generation workflow for esa-cci-permafrost"
111106
keywords:
112107
- Earth Science
113108
themes:
114-
- Atmosphere
115-
- Ocean
116-
- Evaporation
109+
- cryosphere
117110
license: proprietary
118111
jupyter_kernel_info:
119-
name: deepesdl-xcube-1.7.1
112+
name: deepesdl-xcube-1.8.3
120113
python_version: 3.11
121-
env_file: https://git/env.yml
122-
links:
123-
- rel: "documentation"
124-
type: "application/json"
125-
title: "4DMed Hydrology Cube Generation Recipe"
126-
href: "https://github.com/deepesdl/cube-gen/tree/main/hydrology/README.md"
127-
- rel: "jupyter-notebook"
128-
type: "application/json"
129-
title: "Workflow Jupyter Notebook"
130-
href: "https://github.com/deepesdl/cube-gen/blob/main/hydrology/notebooks/reading_hydrology.ipynb"
114+
env_file: "https://github.com/deepesdl/cube-gen/blob/main/Permafrost/environment.yml"
115+
jupyter_notebook_url: "https://github.com/deepesdl/cube-gen/blob/main/Permafrost/Create-CCI-Permafrost-cube-EarthCODE.ipynb"
131116
contact:
132117
- name: Tejas Morbagal Harish
133118
organization: Brockmann Consult GmbH

deep_code/cli/main.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import click
88

9-
from deep_code.cli.publish import publish_dataset, publish_workflow
9+
from deep_code.cli.publish import publish
1010

1111

1212
@click.group()
@@ -15,8 +15,7 @@ def main():
1515
pass
1616

1717

18-
main.add_command(publish_dataset)
19-
main.add_command(publish_workflow)
18+
main.add_command(publish)
2019

2120
if __name__ == "__main__":
2221
main()

deep_code/cli/publish.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,16 @@
66

77
import click
88

9-
from deep_code.tools.publish import DatasetPublisher, WorkflowPublisher
9+
from deep_code.tools.publish import Publisher
1010

1111

12-
@click.command(name="publish-dataset")
12+
@click.command(name="publish")
1313
@click.argument("dataset_config", type=click.Path(exists=True))
14-
def publish_dataset(dataset_config):
14+
@click.argument("workflow_config", type=click.Path(exists=True))
15+
def publish(dataset_config, workflow_config):
1516
"""Request publishing a dataset to the open science catalogue.
1617
"""
17-
publisher = DatasetPublisher()
18-
publisher.publish_dataset(dataset_config_path=dataset_config)
19-
20-
21-
@click.command(name="publish-workflow")
22-
@click.argument("workflow_metadata", type=click.Path(exists=True))
23-
def publish_workflow(workflow_metadata):
24-
25-
workflow_publisher = WorkflowPublisher()
26-
workflow_publisher.publish_workflow(workflow_config_path=workflow_metadata)
18+
publisher = Publisher(
19+
dataset_config_path=dataset_config, workflow_config_path=workflow_config
20+
)
21+
publisher.publish_all()

deep_code/constants.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
# Permissions are hereby granted under the terms of the MIT License:
55
# https://opensource.org/licenses/MIT.
66

7-
OSC_SCHEMA_URI = "https://stac-extensions.github.io/osc/v1.0.0-rc.3/schema.json"
7+
OSC_SCHEMA_URI = "https://stac-extensions.github.io/osc/v1.0.0/schema.json"
88
CF_SCHEMA_URI = "https://stac-extensions.github.io/cf/v0.2.0/schema.json"
9+
THEMES_SCHEMA_URI = "https://stac-extensions.github.io/themes/v1.0.0/schema.json"
10+
OSC_THEME_SCHEME = "https://github.com/stac-extensions/osc#theme"
911
OSC_REPO_OWNER = "ESA-EarthCODE"
1012
OSC_REPO_NAME = "open-science-catalog-metadata-testing"
1113
OSC_BRANCH_NAME = "add-new-collection"
@@ -14,3 +16,16 @@
1416
)
1517
OGC_API_RECORD_SPEC = "http://www.opengis.net/spec/ogcapi-records-1/1.0/req/record-core"
1618
WF_BRANCH_NAME = "add-new-workflow-from-deepesdl"
19+
VARIABLE_BASE_CATALOG_SELF_HREF = "https://esa-earthcode.github.io/open-science-catalog-metadata/variables/catalog.json"
20+
PRODUCT_BASE_CATALOG_SELF_HREF = "https://esa-earthcode.github.io/open-science-catalog-metadata/products/catalog.json"
21+
DEEPESDL_COLLECTION_SELF_HREF = (
22+
"https://esa-earthcode.github.io/open-science-catalog-metadata/projects/deepesdl"
23+
"/collection.json"
24+
)
25+
BASE_URL_OSC = "https://esa-earthcode.github.io/open-science-catalog-metadata"
26+
EXPERIMENT_BASE_CATALOG_SELF_HREF = "https://esa-earthcode.github.io/open-science-catalog-metadata/experiments/catalog.json"
27+
WORKFLOW_BASE_CATALOG_SELF_HREF = (
28+
"https://esa-earthcode.github.io/open-science-catalog-metadata/workflows/catalog"
29+
".json"
30+
)
31+
PROJECT_COLLECTION_NAME = "deep-earth-system-data-lab"

0 commit comments

Comments
 (0)