Skip to content
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 a "show all parameters" flag for all DIALS programs #2543

Open
phyy-nx opened this issue Oct 31, 2023 · 6 comments
Open

Add a "show all parameters" flag for all DIALS programs #2543

phyy-nx opened this issue Oct 31, 2023 · 6 comments

Comments

@phyy-nx
Copy link
Member

phyy-nx commented Oct 31, 2023

One of the most important things I tell new users is to "remember the phrase that pays":

dials.anyprogram -c -e 10 -a 2 | less

It dumps the most useful info possible to a scrollable screen but it is quite the spell users need to know. I suggest a new flag, something like --show-detailed-help or something that shows the -h help strings + the -c -e 10 -a 2 help strings. Bonus points if it drops you into a scrollable screen (like less).

For reference, if it's useful:

phenix.refine -h
--show_defaults=EXPERT_LEVEL
                        Print parameters visible at the given expert level
                        (integer value or "all") and exit. Optionally, append
                        .help, .more, or .all to the expert level, for
                        example:  --show-defaults=all.help

all.help works similarly to what I'm describing above.

@rjgildea
Copy link
Contributor

I added the ability to pass multiple -hhh and /or -vvv for precisely this reason 🙂
#1920

@phyy-nx
Copy link
Member Author

phyy-nx commented Oct 31, 2023

Oh yeah! Thanks @rjgildea!

Looking more, I see -vvv in the help string but not -hhh:

$ dials.index -h
usage: dials.index [options] models.expt strong.refl

optional arguments:
  -c, --show-config     Show the configuration parameters.
  -a ATTRIBUTES_LEVEL, --attributes-level ATTRIBUTES_LEVEL
                        Set the attributes level for showing configuration parameters
  -e EXPERT_LEVEL, --expert-level EXPERT_LEVEL
                        Set the expert level for showing configuration parameters
  -h, --help            Show this help message and exit. Can be specified multiple times to increase
                        verbosity.
  -v                    Increase verbosity (can be specified multiple times)
  --phil FILE           PHIL files to read. Pass '-' for STDIN. Can be specified multiple times, but
                        duplicates ignored.

This program attempts to perform autoindexing...

So can we call out -hhh in the same screen?

Also, -a2 is really what I am looking for here to get the help strings. Using your convention from #1920, could we change it to this?

-h equivalent to -ce0a0
-hh equivalent to -ce1a1
-hhh equivalent to -ce2a2
-hhhh equivalent to -ce3a2

@rjgildea
Copy link
Contributor

-hhh is mentioned implicitly?

  -h, --help            Show this help message and exit. Can be specified multiple times to increase
                        verbosity.
  -v                    Increase verbosity (can be specified multiple times)

I think you want e.g. -hhhvv to get the equivalent of -c2e2. I think the example given in the PR isn’t quite correct as support for multiple verbosity was added in a later commit:

-h equivalent to -ce0
-hh equivalent to -ce1
-hhhv equivalent to -ce2a1

c560a62

@phyy-nx
Copy link
Member Author

phyy-nx commented Oct 31, 2023

-hhh is mentioned implicitly?

Ah, missed that

I think you want e.g. -hhhvv to get the equivalent of -c2e2

Huh! Didn't get that I could combine them. That is nice. I wonder though if wouldn't help to be explicit? Something like this?

  -h, --help            Show this help message and exit. Can be specified multiple times to increase verbosity.
  -v                    Increase verbosity (can be specified multiple times)
  --all-help            Show all parameters and help available and exit (equivalent to -c -e10 -a2)

@dagewa
Copy link
Member

dagewa commented Nov 3, 2023

If you go ahead with this, I would suggest -H as the short form for --all-help

@ndevenish
Copy link
Member

I've always thought that a "common parameters shown in -h" would be useful. It's always somewhat hard to justify -ce4 when teaching DIALS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants