|
5 | 5 | [](https://github.com/psf/black) |
6 | 6 | [](https://github.com/deepesdl/deep-code/blob/main/LICENSE) |
7 | 7 |
|
8 | | -`deep-code` is a lightweight python tool that comprises a command line interface(CLI) |
9 | | -and Python API providing utilities that aid integration of DeepESDL datasets, |
10 | | -experiments with EarthCODE. |
11 | | - |
12 | | -The first release will focus on implementing the publish feature of DeepESDL |
13 | | -experiments/workflow as OGC API record and Datasets as an OSC stac collection. |
14 | | - |
15 | | -## Setup |
16 | | - |
17 | | -## Install |
18 | | -`deep-code` will be available in PyPI for now and will be available in conda-forge |
19 | | -in the near future. Till the stable release, |
20 | | -developers/contributors can follow the below steps to install deep-code. |
21 | | - |
22 | | -## Installing from the repository for Developers/Contributors |
23 | | - |
24 | | -To install deep-code directly from the git repository, clone the repository, and execute the steps below: |
25 | | - |
26 | | -```commandline |
27 | | -conda env create |
28 | | -conda activate deep-code |
29 | | -pip install -e . |
30 | | -``` |
31 | | - |
32 | | -This installs all the dependencies of `deep-code` into a fresh conda environment, |
33 | | -and installs deep-code from the repository into the same environment. |
34 | | - |
35 | | -## Testing |
36 | | - |
37 | | -To run the unit test suite: |
38 | | - |
39 | | -```commandline |
40 | | -pytest |
41 | | -``` |
42 | | - |
43 | | -To analyze test coverage |
44 | | -```shell |
45 | | -pytest --cov=deep-code |
46 | | -``` |
47 | | - |
48 | | -To produce an HTML coverage report |
49 | | - |
50 | | -```commandline |
51 | | -pytest --cov-report html --cov=deep-code |
52 | | -``` |
53 | | - |
54 | | -## deep_code usage |
55 | | - |
56 | | -`deep_code` provides a command-line tool called deep-code, which has several subcommands |
57 | | -providing different utility functions. |
58 | | -Use the --help option with these subcommands to get more details on usage. |
59 | | - |
60 | | -The CLI retrieves the Git username and personal access token from a hidden file named |
61 | | -.gitaccess. Ensure this file is located in the same directory where you execute the CLI |
62 | | -command. |
63 | | - |
64 | | -#### .gitaccess example |
65 | | - |
66 | | -``` |
67 | | -github-username: your-git-user |
68 | | -github-token: personal access token |
69 | | -``` |
70 | | -### deep-code generate-config |
71 | | - |
72 | | -Generates starter configuration templates for publishing to EarthCODE openscience |
73 | | -catalog. |
74 | | - |
75 | | -#### Usage |
76 | | -``` |
77 | | -deep-code generate-config [OPTIONS] |
78 | | -``` |
79 | | - |
80 | | -#### Options |
81 | | - --output-dir, -o : Output directory (default: current) |
82 | | - |
83 | | -#### Examples: |
84 | | -``` |
85 | | -deep-code generate-config |
86 | | -deep-code generate-config -o ./configs |
87 | | -``` |
88 | | - |
89 | | -### deep-code publish |
90 | | - |
91 | | -Publishes metadata of experiment, workflow and dataset to the EarthCODE open-science |
92 | | -catalog |
93 | | - |
94 | | -### Usage |
95 | | -``` |
96 | | -deep-code publish DATASET_CONFIG WORKFLOW_CONFIG [--environment ENVIRONMENT] [--mode |
97 | | -all|dataset|workflow] |
98 | | - ``` |
99 | | - |
100 | | -#### Arguments |
101 | | - DATASET_CONFIG - Path to the dataset configuration YAML file |
102 | | - (e.g., dataset-config.yaml) |
103 | | - |
104 | | - WORKFLOW_CONFIG - Path to the workflow configuration YAML file |
105 | | - (e.g., workflow-config.yaml) |
106 | | - |
107 | | -#### Options |
108 | | - --dataset-config, - Explict path to dataset config |
109 | | - --workflow-config, - Explicit path to workflow config |
110 | | - --environment, -e - Target catalog environment: |
111 | | - production (default) | staging | testing |
112 | | - --mode, -m Publishing mode: |
113 | | - all (default) | dataset | workflow |
114 | | - |
115 | | -#### Examples: |
116 | | -1. Publish to staging catalog |
117 | | -``` |
118 | | -deep-code publish dataset-config.yaml workflow-config.yaml --environment=staging |
119 | | -``` |
120 | | -2. Publish to testing catalog |
121 | | -``` |
122 | | -deep-code publish dataset-config.yaml workflow-config.yaml -e testing |
123 | | -``` |
124 | | -3. Publish to production catalog |
125 | | -``` |
126 | | -deep-code publish dataset-config.yaml workflow-config.yaml |
127 | | -``` |
128 | | -4. Publish Dataset only |
129 | | -``` |
130 | | -deep-code publish dataset-config.yaml -m dataset |
131 | | -
|
132 | | -deep-code publish --dataset-config dataset.yaml -m dataset |
133 | | -``` |
134 | | -5. Publish Workflow only |
135 | | -``` |
136 | | -deep-code publish workflow-config.yaml -m workflow |
137 | | -
|
138 | | -deep-code publish --workflow-config workflow.yaml -m workflow |
139 | | -``` |
140 | | -#### dataset-config.yaml example |
141 | | - |
142 | | -``` |
143 | | -dataset_id: esa-cci-permafrost-1x1151x1641-1.0.0.zarr |
144 | | -collection_id: esa-cci-permafrost |
145 | | -osc_themes: |
146 | | - - cryosphere |
147 | | -osc_region: global |
148 | | -# non-mandatory |
149 | | -documentation_link: https://deepesdl.readthedocs.io/en/latest/datasets/esa-cci-permafrost-1x1151x1641-0-0-2-zarr |
150 | | -access_link: s3://deep-esdl-public/esa-cci-permafrost-1x1151x1641-1.0.0.zarr |
151 | | -dataset_status: completed |
152 | | -``` |
153 | | - |
154 | | -dataset-id has to be a valid dataset-id from `deep-esdl-public` s3 bucket or your team |
155 | | -bucket. |
156 | | - |
157 | | -#### workflow-config.yaml example |
158 | | - |
159 | | -``` |
160 | | -workflow_id: "esa-cci-permafrost" |
161 | | -properties: |
162 | | - title: "ESA CCI permafrost" |
163 | | - description: "cube generation workflow for esa-cci-permafrost" |
164 | | - keywords: |
165 | | - - Earth Science |
166 | | - themes: |
167 | | - - cryosphere |
168 | | - license: proprietary |
169 | | - jupyter_kernel_info: |
170 | | - name: deepesdl-xcube-1.8.3 |
171 | | - python_version: 3.11 |
172 | | - env_file: "https://github.com/deepesdl/cube-gen/blob/main/Permafrost/environment.yml" |
173 | | -jupyter_notebook_url: "https://github.com/deepesdl/cube-gen/blob/main/Permafrost/Create-CCI-Permafrost-cube-EarthCODE.ipynb" |
174 | | -contact: |
175 | | - - name: Tejas Morbagal Harish |
176 | | - organization: Brockmann Consult GmbH |
177 | | - links: |
178 | | - - rel: "about" |
179 | | - type: "text/html" |
180 | | - href: "https://www.brockmann-consult.de/" |
181 | | -``` |
| 8 | +`deep-code` is a lightweight Python CLI and API that turns DeepESDL datasets and |
| 9 | +workflows into EarthCODE Open Science Catalog metadata. It can generate starter configs, |
| 10 | +build STAC collections and OGC API records, and open pull requests to the target |
| 11 | +EarthCODE metadata repository (production, staging, or testing). |
| 12 | + |
| 13 | +## Features |
| 14 | +- Generate starter dataset and workflow YAML templates. |
| 15 | +- Publish dataset collections, workflows, and experiments via a single command. |
| 16 | +- Build STAC collections and catalogs for Datasets and their corresponding variables |
| 17 | + automatically from the dataset metadata. |
| 18 | +- Build OGC API records for Workflows and Experiments from your configs. |
| 19 | +- Flexible publishling targets i.e production/staging/testing EarthCODE metadata |
| 20 | + repositories with GitHub automation. |
0 commit comments