Skip to content

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

Merged
nhoening merged 4 commits intorefactor-scheduler-interfacefrom
flex-model-and-flex-context-deprecation-headers
Dec 27, 2022
Merged

Deprecation headers for old fields that moved to flex-model and flex-context #564
nhoening merged 4 commits intorefactor-scheduler-interfacefrom
flex-model-and-flex-context-deprecation-headers

Conversation

@Flix6x
Copy link
Contributor

@Flix6x Flix6x commented Dec 27, 2022

Also tests whether:

  • the deprecation and sunset headers are introduced when the old fields are used, and
  • the headers are not introduced when the old fields aren't used.

…e used

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
from flexmeasures.utils.time_utils import to_http_time


def deprecate_field(
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we rename this to deprecate_fields (plural)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My hope is that the more typical use case will be to deprecate a single field, but sure.

… changelog

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
@nhoening nhoening merged commit b053994 into refactor-scheduler-interface Dec 27, 2022
@nhoening nhoening deleted the flex-model-and-flex-context-deprecation-headers branch December 27, 2022 17: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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants