Skip to content

Commit

Permalink
Merge ff04703 into e4c77cc
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad-Wahid committed May 31, 2023
2 parents e4c77cc + ff04703 commit cc99d5b
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions documentation/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ New features
* Introduction of the classes `Reporter` and `PandasReporter` [see `PR #641 <https://www.github.com/FlexMeasures/flexmeasures/pull/641>`_]
* Add CLI command ``flexmeasures add report`` [see `PR #659 <https://www.github.com/FlexMeasures/flexmeasures/pull/659>`_]
* Add CLI command ``flexmeasures show reporters`` [see `PR #686 <https://www.github.com/FlexMeasures/flexmeasures/pull/686>`_]
* Add CLI command ``flexmeasures show schedulers`` [see `PR #708 <https://github.com/FlexMeasures/flexmeasures/pull/708>`_]

Bugfixes
-----------
Expand Down
1 change: 1 addition & 0 deletions documentation/cli/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ of which some are referred to in this documentation.
``flexmeasures show data-sources`` List available data sources.
``flexmeasures show beliefs`` Plot time series data.
``flexmeasures show reporters`` List available reporters.
``flexmeasures show schedulers`` List available schedulers.
================================================= =======================================


Expand Down
5 changes: 5 additions & 0 deletions flexmeasures/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ def create( # noqa C901

app.reporters = get_classes_module("flexmeasures.data.models.reporting", Reporter)

# Register Schedulers
from flexmeasures.data.models.planning import Scheduler

app.schedulers = get_classes_module("flexmeasures.data.models.planning", Scheduler)

# add auth policy

from flexmeasures.auth import register_at as register_auth_at
Expand Down
24 changes: 24 additions & 0 deletions flexmeasures/cli/data_show.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,4 +400,28 @@ def list_reporters():
)


@fm_show_data.command("schedulers")
@with_appcontext
def list_schedulers():
"""
Show available schedulers.
"""

click.echo("Schedulers:\n")
click.echo(
tabulate(
[
(
scheduler_name,
scheduler_class.__version__,
scheduler_class.__author__,
scheduler_class.__module__,
)
for scheduler_name, scheduler_class in app.schedulers.items()
],
headers=["name", "version", "author", "module"],
)
)


app.cli.add_command(fm_show_data)

0 comments on commit cc99d5b

Please sign in to comment.