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

Make flexmeasures add schedule a subgroup #557

Merged
merged 2 commits into from Dec 16, 2022

Conversation

Flix6x
Copy link
Contributor

@Flix6x Flix6x commented Dec 16, 2022

Make flexmeasures add schedule a subgroup:

  • invoke a default subcommand
  • show a deprecation warning

(I also made the deprecation warning have the same styling as with click's deprecate=True flag.)

- invoke a default subcommand
- show a deprecation warning

Signed-off-by: F.N. Claessen <felix@seita.nl>
@Flix6x Flix6x requested a review from nhoening December 16, 2022 11:37
@Flix6x Flix6x self-assigned this Dec 16, 2022
@coveralls
Copy link
Collaborator

coveralls commented Dec 16, 2022

Pull Request Test Coverage Report for Build 3716805768

  • 11 of 17 (64.71%) changed or added relevant lines in 2 files are covered.
  • 15 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 65.491%

Changes Missing Coverage Covered Lines Changed/Added Lines %
flexmeasures/cli/data_add.py 4 5 80.0%
flexmeasures/cli/utils.py 7 12 58.33%
Files with Coverage Reduction New Missed Lines %
flexmeasures/api/v3_0/sensors.py 15 78.74%
Totals Coverage Status
Change from base Build 3695374498: -0.02%
Covered Lines: 6780
Relevant Lines: 9738

💛 - Coveralls

Copy link
Contributor

@nhoening nhoening left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment about naming the command.

And a note that we use this command in documentation (see my PR this is based on), which needs adaptation, as well.

flexmeasures/cli/data_add.py Outdated Show resolved Hide resolved
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
@nhoening nhoening merged commit 7321019 into refactor-scheduler-interface Dec 16, 2022
@nhoening nhoening deleted the add-schedule-subgroup branch December 16, 2022 22:17
Flix6x added a commit that referenced this pull request Dec 29, 2022
Add `flex_model` & `flex_context` to /schedules/trigger/ API endpoint, and refactor how flex configuration is deserialized (by the Scheduler implementation instead of by the API endpoint).


* Add flex_model & flex_context in API endpoint; refactor design for Scheduler implementations (moving some endpoint logic here);

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* add new schema modules

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* include two other flex context params in solver test

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* also support deprecated flex_context parameters, and align spelling of params with underscore in docstring

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* correctly handle flex-model validation errors when they come up in the endpoint

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* changelog: add deprecation warnings and mentions this PR

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* fix internal link

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* move flex-model and flex-context docs to notation module; small fixes in dummy custom scheduler

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* deprecate soc-sensor-id field, store soc states on the asset attributes in v3.0 as well, using a way that lets all schedulers save (parts of) it if they want.

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* check (and potentially fill in defaults for) soc_min and soc_max before we apply the schema (which expects non-nan values here)

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* make add schedule command work with our refactored scheduling code, small refactoring to save lines

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* rename the CLI command as it only represents storage right now (and we might choose that the CLI will be specific to our in-built flex models)

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* More thorough checks for passed soc-values in StorageScheduler, leads to small fix in API endpoint and scheduling tests

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* doc improvements from review

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* Change parameter names for flex model and context which come through the API to use hyphens, which is conventionally preferred.

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* Make `flexmeasures add schedule` a subgroup (#557)

* Make `flexmeasuress add schedule` a subgroup:
- invoke a default subcommand
- show a deprecation warning

Signed-off-by: F.N. Claessen <felix@seita.nl>

* adapt CLI command name so it's clearer what is being added

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Co-authored-by: Nicolas Höning <nicolas@seita.nl>

* add one missing documentation improvement from review

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* make sure hyphens are used in flex-model to the outside world (API, CLI)

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* smaller review items, mostly documentation

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* remove soc checks which added interpretation (should be part of another PR, if at all)

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* fixes to notation docs

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* make sure scheduling tests work on empty queues, with new fixture

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* remove two tests for previously removed util function

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* batch of small review comments

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* make get_data_source_info a class method of Scheduler

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* small simplification of get_data_source_for_job

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* specify min/max inclusiveness of roundtrip-efficiency parameter

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* create_scheduling_jobs accepts both object and ID

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* fix type hinting

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* API changelog & flex config introduction

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* two missing fixes

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* remove line about previously undocumented & now depreacated line

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* Deprecation headers for old fields that moved to flex-model and flex-context  (#564)

* Add deprecation and sunset response headers when deprecated fields are used

Signed-off-by: F.N. Claessen <felix@seita.nl>

* Refactor: duplicate code becomes util function

Signed-off-by: F.N. Claessen <felix@seita.nl>

* Correct deprecation and sunset links

Signed-off-by: F.N. Claessen <felix@seita.nl>

* rename to represent plural-default of param, update link to 3.0.5 API changelog

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Co-authored-by: Nicolas Höning <nicolas@seita.nl>

* refactor where the code lives that builds device equality constraints from soc targets

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* change a sentence in notation

Signed-off-by: Nicolas Höning <nicolas@seita.nl>

* Rename inspection to deserialization

Signed-off-by: F.N. Claessen <felix@seita.nl>

* Fix DummyScheduler in documentation

Signed-off-by: F.N. Claessen <felix@seita.nl>

* Simplify imports for plugin developers (also facilitates renaming the planning module without needing plugin developers to upgrade their code)

Signed-off-by: F.N. Claessen <felix@seita.nl>

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Co-authored-by: Felix Claessen <30658763+Flix6x@users.noreply.github.com>
Co-authored-by: F.N. Claessen <felix@seita.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants