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 method to write default config to Tool and Component. #2378

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Commits on Nov 29, 2023

  1. Add method to write default config to Tool and Component.

    Issues are: when default value is undefined, the default config is then non valid and make it difficult to understand what value we're supposed to use.
    ccossou committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    d5f6963 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b308dff View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d2b2094 View commit details
    Browse the repository at this point in the history
  4. Automatically comment parameters that are Undefined to keep them docu…

    …mented but not crashing everything in case they're optional.
    ccossou committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    91bd4fc View commit details
    Browse the repository at this point in the history
  5. Help message now provided for classes in config_writer.

    In practice, it's the first line of its docstring. Formatting is done in a separate function because I also need that for trait help, as it's sometime a multiline string that is very badly rendered otherwise.
    ccossou committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    33f07b8 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    42a24f1 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    548e370 View commit details
    Browse the repository at this point in the history
  8. default value now get the dynamic default value if the static one is …

    …undefined.
    
    Note that get_default_value() was deprecated anyway, and they advise to use .default_value instead. But this is the static value, meaning you'll get more undefined that what really is.
    ccossou committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    7fcba1a View commit details
    Browse the repository at this point in the history
  9. In config writer: default value now write on multiple lines when a li…

    …st of values is encountered (e.g. quality criteria)
    ccossou committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    3fd1de2 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    93d0899 View commit details
    Browse the repository at this point in the history
  11. List are now formatted one line per element.

    isinstance(obj, list) was not working because traitlets.List and derivatives are not considered list type.
    
    config_files trait is also commented because it crashed with the empty list as default.
    ccossou committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    8642e35 View commit details
    Browse the repository at this point in the history