-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First prototype of a code base #14
Conversation
a2ca8c0
to
e030336
Compare
b35576c
to
2805125
Compare
a505b48
to
c392d73
Compare
c392d73
to
b1c0d72
Compare
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 @leclairm will rethink this Some thoughts about relaxing the logic that a lagged date is only enforced if it is after the 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, went once through the whole thing. Again, great work, @agoscinski! 🚀 A lot to digest, so I might have missed things. My comments consist mainly of questions for myself that would be nice to discuss for clarification.
As mentioned on Slack, when running the example, it's stuck. This might be the bug I found in the AiidaWorkGraph
, where for output in task.unrolled_inputs:
. Will test tomorrow. Apart from that, once we settle the strictyaml
discussion, I'd say LGTM, and then we can further iterate.
icon: | ||
inputs: | ||
- grid_file: | ||
arg_option: "-g" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't be needed with actual ICON, I suppose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How we integrate plugins is still an open question. But with the aiida builder we can get call input arguments and could technically support them, at least we can specify all orm data types that can be specified in a yaml file which should be most of them.
class TimeUtils: | ||
@staticmethod | ||
def duration_is_less_equal_zero(duration: Duration) -> bool: | ||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just <=
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not so easy to see on first glance but if the condition is: Even all are zero¿ or any is less than zero. If you do <= with the connection with and
conditions, then all would need to be less than zero, so (-1, 1, 1, 1, 1, 1) would note be fulfilled. If you use or
, then once one is zero the condition is already fulfilled, so (0, 1, 1, 1, 1, 1) would be fulfilled.
@@ -0,0 +1,21 @@ | |||
import argparse | |||
|
|||
from aiida.manage.configuration import load_profile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can just do from aiida import load_profile
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My pyright was unhappy with that^^. I general prefer for source code to be more verbose with their modules, but no strong opinions.
|
||
aiida_workgraph = workgraph.AiidaWorkGraph(core_workflow) | ||
print("Starting workflow please run `workgraph web start` in another terminal to start a GUI as webservice.") # noqa: T201 | ||
result = aiida_workgraph.run() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it work with submit()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should work. It is just that then one needs to have rabbitmq for running the tests. Therefore I thought to switch to pixi, since there I can install all this in the background so nonaiida user do not need to bother.
def __init__( | ||
self, | ||
name: str, | ||
inputs: list[str | dict] | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Task
class doesn't have inputs
and outputs
? Is Task
like a raw representation, directly from the YAML file? I suppose CycleTask
has a different purpose, as it also doesn't inherit from Task
? Maybe you can explain in the meeting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is Task like a raw representation, directly from the YAML file?
Yes the class CycleTask
represents a task in a cycle, while the python class Task
represents a task definition outside of the cycles.
Should add this to the doc.
|
||
class Cycle(_NamedBase): | ||
""" | ||
We never need to create instances of a cycle class so we only contains static methods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you can explain in the meeting.
@@ -0,0 +1,39 @@ | |||
#!/usr/bin/env python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be also under tests? Same script as for the example, right? It's here to then also be used for testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is used in the tests (see the test_config_small.yaml
). I think need remove icon.sh
and icon
as they are not used anymore. Need to verify that they are not needed.
Co-authored-by: Julian Geiger <[email protected]>
There was a small bug in the UnrolledDependency (used from variable) that has been fixed. The example should work now. |
Co-authored-by: Julian Geiger <[email protected]>
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
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:
verdi presto
before the tests to set up a profile, would be nicer if we could set up a profile within the tests