Implement method for JobCalculation to create a restart builder #1962
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1962 +/- ##
===========================================
- Coverage 67.56% 67.49% -0.08%
===========================================
Files 324 324
Lines 33342 33390 +48
===========================================
+ Hits 22529 22538 +9
- Misses 10813 10852 +39
Continue to review full report at Codecov.
|
|
Do we need a new method for this or can/should this be handled by passing a parameter of |
|
I could not implement this with a toggle keyword in |
giovannipizzi
left a comment
There was a problem hiding this comment.
Can we add a test for this new function? (+ the two comments)
There was a problem hiding this comment.
Does this work? This does builder.options = {...}, can this be done directly or should we loop?
There was a problem hiding this comment.
I tested this manually and it works, because builder.options is just a mapping namespace, so assigning a dictionary works. But I will write some unit tests
There was a problem hiding this comment.
I'm not sure link.replace(namespace, '') is safe, e.g. if the sub-namespace has the same name it would remove both. Better link[len(namespace):] or something equivalent
d8addb8 to
c1cd4f7
Compare
c1cd4f7 to
b16f593
Compare
Pull Request Test Coverage Report for Build 3839
💛 - Coveralls |
The `get_builder` method will return a "clean" builder for the given
`JobProcess`, without any inputs defined. Here we implement `get_builder_restart`
for the `JobCalculation` that will also return a `JobProcessBuilder` but with
the inputs and options pre-set with those that were used for the original node.
The builder can then immediately be resubmitted to run another instance of that
calculation, while of course giving the chance to change one or more inputs.
For example:
calculation = load_node(<pk>) # Some completed JobCalculation node
builder = calculation.get_builder_restart()
results = run(builder)
b16f593 to
8a1e95d
Compare
|
@giovannipizzi I addressed your comments and added some unit tests, so it's ready for a second review |
Fixes #230
The
get_buildermethod will return a "clean" builder for the givenJobProcess, without any inputs defined. Here we implementget_builder_restartfor the
JobCalculationthat will also return aJobProcessBuilderbut withthe inputs and options pre-set with those that were used for the original node.
The builder can then immediately be resubmitted to run another instance of that
calculation, while of course giving the chance to change one or more inputs.
For example: