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

Improve print order of state variables in settings module. #106

Merged
merged 4 commits into from
Apr 12, 2022

Conversation

sbrodehl
Copy link
Collaborator

@sbrodehl sbrodehl commented Apr 7, 2022

Improve print order of state variables in settings module

This MR sorts state variables based on their (nested) module name in case-insensitive, alphabetical order, with parameters always on top.

Description

Setup:
Use settings module to print state variables.

Problem:
Some variables were hard to find between nested modules.

Previously:
Note the ** and <--, which are variables of different modules, which are not printed as a group.

d           = ...  **
sa│Aa│a     = ...
  │  │b     = ...
  │Ab       = ...  <--
  │D        = ...  <--
  │L│a      = ...
  │ │b      = ...
  │M        = ...  <--
  │Sa│a     = ...
  │  │ba    = ...
  │  │bb│ta = ...
  │  │  │tb = ...
  │Sb       = ...  <--
  │Sca│a    = ...
  │   │b    = ...
  │Scb│a    = ...
  │   │b    = ...
  │Ta       = ...  <--
  │Tb│m     = ...
  │ │n      = ...
  │a        = ...  <--
sb          = ...  **
v           = ...  **

New Behavior:

d           = ...  **
sb          = ...  **
v           = ...  **
sa│a        = ...  <--
  │Ab       = ...  <--
  │D        = ...  <--
  │M        = ...  <--
  │Sb       = ...  <--
  │Ta       = ...  <--
sa│Aa│a     = ...
  │  │b     = ...
  │L│a      = ...
  │ │b      = ...
  │Sa│a     = ...
  │  │ba    = ...
  │  │bb│ta = ...
  │  │  │tb = ...
  │Sca│a    = ...
  │   │b    = ...
  │Scb│a    = ...
  │   │b    = ...
  │Tb│m     = ...
  │ │n      = ...

Things done in this MR

  • Create tree of state variables, sorts parameters and modules separately, and first list parameters, then sorted modules.

Check all before creating this PR:

  • Documentation adapted
  • unit tests adapted / created

Example Usage

Use the settings module to list state variables.

@sbrodehl sbrodehl requested a review from da-h April 12, 2022 11:45
@da-h
Copy link
Owner

da-h commented Apr 12, 2022

Great improvement of readability of the output!

Thanks for making this project better for everyone. 👍 🚀

@da-h da-h merged commit e70f187 into da-h:master Apr 12, 2022
github-actions bot pushed a commit that referenced this pull request Apr 12, 2022
Improve print order of state variables in settings module.
@sbrodehl sbrodehl deleted the dev-settings-print-order branch April 12, 2022 14:02
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

Successfully merging this pull request may close these issues.

2 participants