Skip to content

Refactor Configuration System & Extend Documentation

Frederik Hennig requested to merge fhennig/configuration into master

This MR introduces an extensive refactoring of the pystencils-sfg configuration system, adds documentation and user guide sections about configuration, and extends the test suite.

Configuration System

  • Replace pystencilssfg.configuration by pystencilssfg.config; replace SfgConfiguration by SfgConfig
  • Clean up structure and sections of SfgConfig
  • Use an Option descriptor to separately model default values and keep track of unset options
    • The value None will now always represent an unset option, i.e. one that the user has not specified. The default value for that option is still encapsulated by the Option descriptor, and will be returned as a fallback when calling get_option.
  • Refactor command-line parsing and conflict checking between command-line and inline options
  • Refactor configuration modules:
    • Replace sfg_config() by configure_sfg(config: SfgConfig), which gets a config object and must mutate that object to set the project configuration
    • Introduce project_info() function that must return the project info object, instead of setting it on the configuration
    • Deprecate CONFIGURATOR_SCRIPT cmake variable in favor of CONFIG_MODULE
  • Add various test cases for configuration (inline and command-line)
  • Add test cases for the CLI interface

Documentation

  • Style: Expand sidebar navigation into sections
  • Document the new configuration system
  • Extend the generator script user guide with information on configuration and cmdline invocation
  • Extend the project integration guide with info on config modules

Merge request reports