C2SM / Sirocco

AiiDA based Weather and climate workflow tool
1 stars 0 forks source link

Initialize code base #14

Open agoscinski opened 4 months ago

agoscinski commented 4 months ago

This is PR #12 with some additional changes that is based from the init-repo, so we can separate the repo structure and code base initialization. The module structure is

src
└── wcflow
    ├── core.py
    ├── __init__.py
    ├── _utils.py
    ├── wc
    │   ├── _classes.py
    │   ├── __init__.py
    │   └── _schema.py
    └── workgraph.py

The rough idea is that everything in the wc submodule is related to parsing of the file and converting it to a core.Workflow. The core.Workflow has all information to allow a convenient unrolling of the tasks over the periods. The workgraph.* is responsible for creating an AiiDA workgraph from a core.Workflow.

TODOs/Issues:

agoscinski commented 2 months ago

Notes from the meeting with @leclairm


We go with the schema library and pyaml, ditching strictyaml, because the anchors are still useful for our case.


We might want to change naming to

wc.Data -> wc.DataSpec core.Data -> core.DataSpec core.UnrolledData -> core.Data

@leclairm will rethink this


Some thoughts about relaxing the logic that a lagged date is only enforced if it is after the start_date

inputs:
  - icon_input:
    lag:
      condition: "possible" # other options could be "always" so the file should always exist
      value: '-P4M'

But for now it is okay

agoscinski commented 2 months ago

There was a small bug in the UnrolledDependency (used from variable) that has been fixed. The example should work now.