Skip to content

Add library functionality#4

Merged
irm-codebase merged 39 commits intomainfrom
feature-clio-lib
Mar 3, 2025
Merged

Add library functionality#4
irm-codebase merged 39 commits intomainfrom
feature-clio-lib

Conversation

@irm-codebase
Copy link
Member

@irm-codebase irm-codebase commented Feb 26, 2025

Turn clio into a python library that supports our operations. For general validation, interfacing, etc.
Think of this as the 'next-gen' eurocalliope-lib.

Features

  • Python setup using uv for extra fanciness.
  • CI for pull requests, with build and test runs for Linux / MacOS / Windows.
  • Functions:
    • INTERFACE.yaml parsing, validation and mermaid graph generation.
    • modulegraph generation (turn ugly snakemake rulegraph into modular ones!)

@irm-codebase
Copy link
Member Author

irm-codebase commented Feb 26, 2025

For now this will mostly support our data module docs generation (and avoid a lot of duplicate code across them).

@sjpfenninger no real need to review, but would like to hear your opinion on having this live in clio. We had some discussions and concluded that avoiding more repos was preferable since the specification and the library that supports it share the same version this way.

@brynpickering no SW changes in relation to the trial. I've added some extra functionality to the repo itself though. Only addition is the modulegraph stuff, to generate these:

image

@sjpfenninger
Copy link
Member

@sjpfenninger no real need to review, but would like to hear your opinion on having this live in clio. We had some discussions and concluded that avoiding more repos was preferable since the specification and the library that supports it share the same version this way.

That seems sensible to me!

Copy link
Member

@brynpickering brynpickering left a comment

Choose a reason for hiding this comment

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

Generally fine, although I don't know that using uv is actually a good thing...

@irm-codebase
Copy link
Member Author

irm-codebase commented Feb 28, 2025

Updated!

@brynpickering about uv.
One of the main reasons behind this switch was that it is really easy to separate requirements with it.

uv add pandas < -- will add pandas as a dependency
uv add mypy --dev <-- development dependency, never built
uv add geopandas --group geo <-- optional dependency, installed through clio_tools[geo].

It's honestly saving a lot of headaches, and it's not something that users will ever see or need to use.

@irm-codebase
Copy link
Member Author

@brynpickering thank you for the help!

I believe the package is ready. What is left to enable us to upload to conda-forge?

@irm-codebase irm-codebase merged commit 4cb5b79 into main Mar 3, 2025
5 checks passed
@irm-codebase irm-codebase deleted the feature-clio-lib branch March 4, 2025 15:19
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.

3 participants