-
Notifications
You must be signed in to change notification settings - Fork 68
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
Recipe runner CLI entry point #1160
Conversation
Codecov Report
@@ Coverage Diff @@
## tonytung-recipe #1160 +/- ##
==================================================
+ Coverage 88.66% 88.86% +0.2%
==================================================
Files 137 140 +3
Lines 5168 5244 +76
==================================================
+ Hits 4582 4660 +78
+ Misses 586 584 -2
Continue to review full report at Codecov.
|
0a09822
to
b90d84d
Compare
a52a19e
to
72ac99c
Compare
72ac99c
to
3ed2d41
Compare
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.
Awesome work. Looking for docs. 👀
"--output", type=str, multiple=True, metavar="OUTPUT_FILE_PATH", | ||
help="output file paths to write recipe outputs to") | ||
@click.pass_context | ||
def run_recipe(ctx, recipe, input, output): |
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 needs usage examples. It's also not clear what any of the parameters must contain for the run to be valid. That should probably be documented here.
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 recipe dependent. Please let me know if #1245 is adequate.
"""Runs a recipe with a given set of inputs and outputs.""" | ||
config = StarfishConfig() | ||
|
||
backend, relativeurl, _ = resolve_path_or_url( |
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.
General style question: We have a bunch of custom classes, and in this case I needed to follow 3 wrapper functions in slicedimage.io to find out that this backend
is a subclass of slicedimage.backends.Backend
.
Since we have type hints, I would find it helpful to use them in the cases of our custom classes, so that developers have a better sense of what the code is doing.
In this case:
backend: slicedimage.io.Backend
relativeurl: str
backend, relativeurl, _ = resolve_path_or_url(
recipe, backend_config=config.slicedimage)
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.
Sure, I can do this.
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.
Correction: Backend
was never exposed.
I will correct this.
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.
|
||
|
||
@starfish.command("recipe") | ||
@click.option("--recipe", required=True, type=str, metavar="RECIPE_PATH_OR_URL") |
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 wonder why we have a public run
method now that we can run recipes and you've shown this to be faster.
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.
For API users.
@@ -0,0 +1,54 @@ | |||
primary_image = file_inputs[0] |
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 great. We need to doc how this works and what your mini-language can do.
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.
3ed2d41
to
a1df8d5
Compare
"decode", "PerRoundMaxChannelDecoder", | ||
target_assignment, codebook) | ||
|
||
file_outputs[0] = decoded |
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 this mean you only output once at the end of the pipeline?
That would definitely explain why this process is way faster the exporting and importing after each step
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, that is true. The speed improvements (IMO) is mostly from not starting up the starfish process repeatedly.
a1df8d5
to
b626228
Compare
b626228
to
d12119c
Compare
d12119c
to
741cfa1
Compare
741cfa1
to
3a22448
Compare
95c4e7a
to
487113c
Compare
a2a7266
to
ae0df91
Compare
483d545
to
1ba8b25
Compare
7724f21
to
715e3d8
Compare
3d55d00
to
62295fc
Compare
62295fc
to
538cb0d
Compare
9957b8d
to
ab77e27
Compare
ab77e27
to
50b80ed
Compare
28fcd4f
to
612307c
Compare
612307c
to
742bb54
Compare
742bb54
to
9b8329b
Compare
9b8329b
to
d74a613
Compare
I'm going to land this, free free to leave any post-land comments, @ambrosejcarr / @kne42 |
Test plan:
pytest starfish/test/full_pipelines/recipe
Depends on #1192
Fixes #311