-
Notifications
You must be signed in to change notification settings - Fork 20
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
quickrun CLI command #171
quickrun CLI command #171
Conversation
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.
I think this will require a Transformation
not just a DAG. A DAG doesn't quite have enough info to analyse itself, the results it passes out are paths to raw data, the Transformation has a reference to the Protocol, which has the gather()
method to analyse that data.
Re serialising, since I think where this might become less preferable is when thinking about storage, the storage system isn't privy to knowing what strings are actually paths, and so serialising them as |
openfecli/commands/quickrun.py
Outdated
from gufe.protocols.protocoldag import execute, ProtocolDAG | ||
dct = json.load(dagfile) | ||
dag = ProtocolDAG.from_dict(dct) | ||
result = execute(dag) |
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.
create a gufe.Context
with a temp dir. and pass in here
openfecli/commands/quickrun.py
Outdated
""" | ||
import gufe | ||
from gufe.protocols.protocoldag import execute | ||
print("Loading file...") |
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.
this is fine for quick and dirty, but we need to figure out how we're doing logging eventually
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.
lgtm, would be nice to also test failure modes
openfecli/commands/quickrun.py
Outdated
import gufe | ||
from gufe.protocols.protocoldag import execute | ||
print("Loading file...") | ||
dct = json.load(transformation) |
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.
also worth thinking about wrapping each step in a try/except and catching any errors? (speaking of, what are these errors...)
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.
If there are errors that we can handle, then we could. If this is just to avoid dumping a stack trace, then let click do it for it (it does it automatically).
Codecov ReportBase: 92.12% // Head: 92.29% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #171 +/- ##
==========================================
+ Coverage 92.12% 92.29% +0.17%
==========================================
Files 59 59
Lines 4076 4140 +64
==========================================
+ Hits 3755 3821 +66
+ Misses 321 319 -2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
So, apparently I had already written a test for this, and I'd just forgotten about it. Assuming the MacOS tests pass, this is ready for review. |
openfecli/commands/quickrun.py
Outdated
print("Planning the campaign...") | ||
dag = trans.create() | ||
print("Running the campaign...") | ||
dagresult = execute(dag) |
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.
We should have a way to pass shared
here? That way the files aren't temporary?
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.
Added -d
/ --directory
option. Can rename to --shared
if that makes more sense.
Still need to test that; it didn't seem used in a manual test with the DummyProtocol
, but that may be the protocol.
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.
Thanks, --directory
seems like the best option for users imho :)
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.
couple of points but looks good
Still need to add tests for this. Also, it looks like DummyProtocol isn't doing any file output here ... need to figure out why
@IAlibay @richardjgowers : This should be ready for another look. I haven't tested the shared directory stuff yet, since |
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.
this looks fine to me
My understanding is that if |
I meant that if a directory is provided, then someone will have to do the equivalent of |
It creates the directory. I've not had to create them for things to work for the example notebooks. |
Takes a
ProtocolDAG
saved as JSON, runs the DAG, and returns results.A few things before this is ready to merge:
ProtocolDAG
or a serializedTransformation
. These are essentially equivalent, but there's some discussion to be had on what it means from user experience.Path
objects, and whether any non-JSON-serializables other thanPath
s are allowed return values.Merge FixThis isn't actually needed here, but will be needed in the future.ProtocolUnit
deserialization gufe#62GufeTokenizable
support to atom mappings (included in Using gufe protocols #142, but might split that part off of that PR)Resolves #172.