-
Notifications
You must be signed in to change notification settings - Fork 45
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
List parameters and their annotations in global
section with -h
option
#976
Comments
We had something like this when all parameters were defined in a So the best that can be done, but perhaps already good enough, is to list all parameter definitions (and their comments) in the script, regardless the workflow. Then there can be weird things such as parameters with the same names but different type/meaning that were designed for different workflows. |
I see, that is why I thought we had that option before.
I'm a bit confused here: for this workflow for example:
Then in the command line |
The behavior is that |
I see, okay I think this is fair enough. Banning it entirely may be a bit restrictive. |
Let me know how this works. Note that in the early versions of SoS when all parameters are defined in a separate section, we include comments before parameter definition as comments for the parameter. This is deprecated because it can be confused with section comment, which we still honor. E.g.
We could enforce something like
if it is helpful. |
Just noticed that comment after
|
This is great! Here is what I have for a workflow I'm on right now, for example:
Now some suggestions:
and makes it very clear that those are parameters? Other than that, this is mostly perfect, making SoS now very much like an executable, particularly when dockerized. |
Try again. |
Cool, although when I tried to add comments:
This is fine I guess, because I figure it might be hard to properly add line-wrap etc unless trying to do some serious parsing ... |
We have not decided how to add comments to parameters yet. |
Well, I would like this more:
if possible :) |
But we have the ambiguity of
|
Unless we can introduce some convention such as
|
Indeed. I was originally proposing the roxygen convention |
My gut feeling is that sos should try to "understand what users write" instead of "force users to write in sos way". I mean, instead of introducing some complex rules such as
I would rather do
|
is implemented. Let me know how it works. |
Okay you are saying that comments immediately before parameter will be parameter comment? That is reasonable to me. And the way to distinguish is to use line breaks? I checked the current behavior. It is good! |
Yes. Consecutive comments immediately after section header will be section comment, consecutive comments immediately before parameter definition will be parameter comment. |
Okay maybe another finally minor point, sorry for being a nuisance: in the help message, those parameters are termed BTW this looks nice to me:
|
Need to go. I also tried to change
to
You can change this or other formats at the end of |
Great! I find the 24 character rule does not always work well, so I changed it to new line for all comments,
I'm quite happy with the outcome. |
The output is actually not accurate because the workflows could be triggered by targets. These are more difficult to collect and display though. |
This update lists the targets the script provides and another way to start the script |
After more thought, I think having section comment before the section makes more sense and is more consistent. I mean
That is to say, anything immediately before section header or parameter will be their comment. One additional rule could be the second comment block would be script description
|
Documented here. The advantage of the new convention is that you can do
without worrying about conflicts with script and section comments. |
I want to demonstrate this feature with one of the SoS examples but I noticed this issue:
The script has
apparently because I did not have a comment for |
Try again. |
In my RNA-seq DE example, I noticed that for comment strings starting at the begining of a cell then the content will not be displayed with
you see that |
Yes, I changed the comment style for plain sos, but forgot to change sos notebook. Perhaps you have not noticed, the sos comment style has been changed to "before content". That is to say, comments immediately before the section header (and parameter definition) will be comment for the header (and parameter). This style is more consistent than, for example, having comments after section header and before parameter etc, and avoids confusion of a common scenario
When comes to sos notebook, currently sos extracts lines after section headers so that we do not extract magics in cases such as
This works before since We still have problem with script comment though. Currently the plain format takes the second comment block as script comment, but there is no such concept in the notebook format. |
Yes, and this is now I currently implements in SoS Notebook. I think with the exception of the first comment in the cell everything works as expected even though you said you did not change it for notebooks. That is, in SoS Notebook lines before section header are actually extracted, but not when they are the first lines of cell. |
Please check if everything works ok now (extract from sos, not sos-notebook, which is still broken), and if not, change the sample notebook and test case to demonstrate the problem. |
It works now for my example:
and this is extracted from SoS Notebook (am I missing something again?)! So i'm not sure if I should close the ticket ... |
…ot yet test JS code. vatlab/sos#976
The extraction was implemented in |
I see what you meant now! Okay this ticket is about |
So suppose I have this workflow:
it neatly lists all steps in the workflow. But under
[global]
I have something like this:Correct me if I am wrong, but I thought we can list parameters with
-v
? I do not think it works, though. It would be great if we can list parameters along with what they are, eg:Not sure if
#
is the best identifier for parameter comments to show, but we can also do##
or#'
(roxygen
convention). I'm just saying that showing parameter options could be useful when I make quick software-type of workflows for others to run without looking into the details.The text was updated successfully, but these errors were encountered: