-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add mockup of idea for CLI #8
base: main
Are you sure you want to change the base?
Conversation
09d6351
to
024932f
Compare
I like this interface. I suspect we'll have to alias |
Would it be useful to have a mission parameter at this level? I'm worried that the Roman and JWST pipelines may have similar names and confuse the end user. Otherwise I think this is a great improvement. |
I was thinking of referring to the pipeline and step classes by their fully-qualified names:
And if a user wanted to list only romancal pipelines they would pass a pattern to the "list" command:
Would it be better to refer to them by class name (without module path)? In which case we would need to break the CLI commands down by mission, or add a --mission flag to each command. One thing I like about the fully-qualified names is that they're compatible with steps that are shared among the missions. |
Two questions: Is there a reason to distinguish between On running, is there an option to use a local configuration file? |
There was mention of deprecating |
@nden @jdavies-st and everyone else, how do you feel about the current inheritance relationship between Step and Pipeline? I personally feel that it's awkward, but I have limited experience using them. If we think we'll eventually want to break that relationship then maybe we should keep them separate in the CLI, but if we're happy with treating Pipeline as a special case of Step then perhaps it does make sense to merge them together. Although keeping them separate does provide a natural way to list them separately, and in the future there might be other operations that need to behave differently between steps and pipelines.
Rumor has it that config files are being retired? Or is that only for the default configs? It strikes me that config files, pars files, and CLI arguments may be too many ways to accomplish the same thing. Would users be content with only the CLI arguments? They could create shell scripts for commonly used configurations. Or alternatively, would it be enough to support only config files from the CLI and drop the single parameter arguments? |
Concerning Step vs. Pipeline: Currently Regarding the config file: The inclusion of the CRDS component is to provide parameters that are instrument/mode-dependent and in no way replaces or deprecates any other method of parameter setting. About whether there are too many ways of setting parameters, that is definitely something to discuss. About scope of this issue: What is the goal? As presented, it looks like |
The goal of this is to define a CLI interface to stpipe which is more standard than what we have now and is closer to *nix CLIs. As for step vs pipeline, I had the same initial reaction as @stscieisenhamer. But I wonder if the difference has some significance to end users. For example, We need to support the par files in CRDS as a possible input. |
For step vs pipeline and whether to treat them differently - from an OOP perspective, a pipeline isn't really a kind of step, it's more like a container or steps (has-a rather than is-a relationship) - sort of like HDULists versus HDUs. While they are indeed quite well wedded architecturally, maybe some of that wedding was a bit like forcing square pegs into round holes. |
When stpipe was developed many years ago, I think much of the impetus came from the belief that users wouldn't want to use Python and would much prefer using command line tools. Fast forward to now, and we have data processing using stpipe while many INS testers use the Python interface to steps and pipelines. Stpipe is indeed convenient to use for doing one-off runs of steps or pipelines. But however we go ahead with a CLI interface, we should make sure that each option has a clear equivalent in Python that will always give the same behaviour. |
One option is to list fully-qualified names but allow use of simple class names if there is no ambiguity. |
Concerning user-presentation: My limited experience is with INS and since they are often very concerned about individual steps, there is no need for the separation. However, with the general community, there is probably good reason to make a distinction. |
For reference current https://jwst-pipeline.readthedocs.io/en/latest/jwst/stpipe/user_step.html and include Also undocumented (at least I didn't find it) but still working is adding the |
Subcommand options (discussed in 2021-01-25 meeting):
|
In the poll, I voted for option 2. However, to be clear about the choice, this is a vote more to be against the formalization of pipeline vs. step as in command keywords such as
operates only on And note the phrasing And an unrelated request: For the good of humanity, consider making any class specification case-insensitive. |
The Slack poll shows Base stpipe command:
List registered steps/pipelines:
Describe a single step or pipeline (including parameters):
Print a config to stdout:
Run a step or pipeline:
|
Here's an outline of a stpipe CLI tool:
The base
stpipe
script asks the user to choose whether to work withpipeline
orstep
commands:Pipeline commands might include
list
available pipelines,describe
a pipeline (various detailed info including a list of steps), andrun
a pipeline:The
list
command outputs each available pipeline class (registered via entry point):The
run
command is similar to existingstrun
:Similar commands would be implemented within
step
.