Skip to content

cgi initial commit#4

Merged
sunnydean merged 7 commits intomainfrom
cgi-merge
Apr 2, 2026
Merged

cgi initial commit#4
sunnydean merged 7 commits intomainfrom
cgi-merge

Conversation

@ClaudioCandeloriCGI
Copy link
Copy Markdown
Collaborator

Added YAML Template Generation
Added Stac Generation from YAML Templates using the functions already present in the library.
Made Template and Stac generation commands importable (for Jupyter Notebooks) and executable from CLI in Local
Added tests

I will update the documentation, guide and examples after this MR.

@sunnydean
Copy link
Copy Markdown
Collaborator

sunnydean commented Mar 31, 2026

Thanks for the PR!

Since this is aimed as a executable script, can you move this commit to under the earthcode/cli please

Comment thread pyproject.toml Outdated
"pydantic>=2.12.5,<3",
"requests>=2.32.5,<3",
"tokenizers>=0.22.2,<1",
"PyYAML>=6.0.3",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please pin down the highest version of PyYaml please

Comment thread pixi.toml Outdated
onnxruntime = ">=1.24.1,<2"
platformdirs = ">=4.5.0,<5"
tokenizers = ">=0.22.2,<1"
PyYAML = ">=6.0.3"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please pin down the highest version of PyYaml please

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you also need to update pixi lock file so the environment is consistent (or else tests fail/etc)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that the pixi.lock file is meant to be updated automatically with the "pixi install" cmd, but as you know I can't do this on my work laptop due to enterprise restrictions.

Comment thread earthcode/workflow_generator.py Outdated
workflow_record = create_workflow_record(workflow_metadata)

# save this file and copy it to the catalog/workflows/{workflow-id}/record.json
with open(os.path.join(target, 'workflow_record.json'), 'w') as f:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how you plan to use it internally but this will fail the actual validation since it's missing links from the workflow catalog to the generated file. So this will fail validation generally just by itself.

You can save the workflow record using earthcode.git.add.save_workflow_record_to_osc this will automatically handle the required links.

There are similar functions for projects, experiments, products, etc....

note that you'll need clone of the osc repo for this!

@sunnydean
Copy link
Copy Markdown
Collaborator

thanks Claudio, I've added a minor refactor;

please see if the test is a realistic integration test of how you might call the function. If yes, then the generated stac items should also pass the open-science-catalog-validation when you commit them to https://opensciencedata.esa.int/catalog.

@sunnydean sunnydean merged commit 361e116 into main Apr 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants