metrumresearchgroup / bbr

R interface for model and project management
https://metrumresearchgroup.github.io/bbr/
Other
23 stars 2 forks source link

Sync bbi argument list with latest bbi #537

Closed kyleam closed 2 years ago

kyleam commented 2 years ago

This PR started with me just wanting to update BBI_ARGS for recent changes in bbi, in particular https://github.com/metrumresearchgroup/bbi/pull/279 and https://github.com/metrumresearchgroup/bbi/pull/280. This was the first time I looked closely at the .bbi_args handling and print_bbi_args, and I'm a bit confused by it and think it might make sense to rework things. But I still don't really have a clear picture (and maybe my impression is off the mark), so this series doesn't make any of those sorts of changes.

In addition to updating the option list, it


Example of new output:

bbr-print-args
kyleam commented 2 years ago

Maybe print a newline between each arg to make it easier to read.

I played around with a newline a bit and then settled on trying to make the different entries stand out by bolding the argument name and indenting subsequent lines. The main advantage I saw in avoiding the newline was preserving vertical screen real estate.

But that assumes the bolding works well to distinguish, and perhaps it didn't because...

Or (maybe instead of, maybe in addition to ^) make the name of the argument bold or something

... you suggest bolding next. You're talking about the first word of the entry, right? That doesn't appear bold on your end?

https://github.com/metrumresearchgroup/bbr/blob/d8640806023b758286e9c8b94a8b1c35eb278bb7/R/utils.R#L325-L325

Should we consider exporting the BBI_ARGS constant [...]

Yeah, I like that idea. The only thing I wonder is whether we should make clear that we're not committing to the structure/values. Don't know if that's worth worrying about.

kyleam commented 2 years ago

I asked:

That doesn't appear bold on your end?

Hmm, perhaps it's an rstudio server thing. If I try that with rstudio server, things look remarkably unbold:

rstudio-server

Before submitting this PR, I tested it out on rstudio desktop, my editor, and the plain terminal. It looks bold in all of those:

rstudio-desktop
editor
terminal

If cli::style_bold() doesn't play well with rstudio server, I guess the best option is probably to switch to using a color.

kyleam commented 2 years ago

If cli::style_bold() doesn't play well with rstudio server, [...]

By the way, my guess is that it is bolded, it's just very unimpressive bolding.

bold
bold-zoom
kyleam commented 2 years ago

Pushed an update to

I've rebased this on top of the current main due to the bbi drone update.

range-diff ``` 1: e35a9f22 = 1: 092ec3dd print_bbi_args: use cli to format message 2: 99415695 = 2: 37b9d342 print_bbi_args: highlight nfme options 3: 6fab267b = 3: 3726707b bbi args: reflow with Rstudio's "Reformat code" command 4: 9eaf8a9c = 4: bf6399ae bbi args: catch up with bbi options 5: d8640806 ! 5: b69ec632 bbi args: support printing compatibility notes @@ R/aaa.R flag = "--maxlim", - description = "RAW NMFE OPTION - Set the maximum values for the buffers used by Nonmem (if 0, don't pass -maxlim to nmfe) (default 2)" + description = "RAW NMFE OPTION - Set the maximum values for the buffers used by Nonmem (if 0, don't pass -maxlim to nmfe) (default 2)", -+ compatibility_note = "Default changed from unset to 2 with bbi v3.2.1" ++ compatibility_note = "Default changed from unset to 2 with bbi v3.2.0" ), mpi_exec_path = list( type = "character", -: -------- > 6: 7c8bd02b bbi args: export argument list for use with View() -: -------- > 7: d5adf708 print_bbi_args: color the variable name too ```