Skip to content

Raise a warning when trying to pass options to an autogenerated prefix. #37

@JHopeCollins

Description

@JHopeCollins

The OptionsManager ignores any options in the global Options database if it has not been given a prefix and had to generate one automatically:

# If no prefix is provided generate a default prefix
# and ignore any command line options
if options_prefix is None:
default_prefix = default_prefix or "petsctools_"
default_prefix = _validate_prefix(default_prefix)
self.options_prefix = f"{default_prefix}{next(self.count)}_"
self.parameters = parameters
self.to_delete = set(parameters)

That means if you try to pass something like -petsctools_0_ksp_monitor from the command line it will be silently ignored.
We should try to detect this case and raise a warning if someone tries to do this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions