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

Simplify settings help message #1052

Merged
merged 7 commits into from
Dec 20, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 8 additions & 16 deletions openfecli/parameters/plan_network_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,21 +180,14 @@ def load_yaml_planner_options(path: Optional[str], context) -> PlanNetworkOption


_yaml_help = """\
Path to planning settings yaml file

Currently it can contain sections for customising the
atom mapper and network planning algorithm,
these are addressed using a `mapper:` or `network:` key in the yaml file.
The algorithm to be used for these sections is then specified by the `method:` key.
For choosing mappers, either the LomapAtomMapper or KartografAtomMapper are allowed choices,
while for the network planning algorithm either the generate_minimal_spanning_tree or
generate_minimal_redundant_network options are allowed.
Finally, a `settings:` key can be given to customise the algorithm,
with allowable options corresponding to the keyword arguments of the Python API for these algorithms.

For example, this is a valid settings yaml file to specify that
the Lomap atom mapper should be used forbidding element changes,
while the generate_minimal_redundant_network function used to plan the network
Path to a YAML file specifying the atom mapper (`mapper:`) and/or network planning algorithm (`network:`) to use.

Supported atom mapper choices include `LomapAtomMapper` or `KartografAtomMapper`.
Supported network planning algorithms include `generate_minimal_spanning_tree` or `generate_minimal_redundant_network`.
atravitz marked this conversation as resolved.
Show resolved Hide resolved

The `settings:` allows for passing in any keyword arguments of the method's corresponding Python API.

For example:
::

mapper:
Expand All @@ -208,7 +201,6 @@ def load_yaml_planner_options(path: Optional[str], context) -> PlanNetworkOption
mst_num: 3
"""


YAML_OPTIONS = Option(
'-s', "--settings", "yaml_settings",
type=click.Path(exists=True, dir_okay=False),
Expand Down
Loading