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

CLI commands to edit asset/sensor attributes #380

Merged
merged 16 commits into from Mar 4, 2022
Merged

Conversation

Flix6x
Copy link
Contributor

@Flix6x Flix6x commented Feb 28, 2022

This PR introduces a new CLI command to provide better control over editing key-value pairs in the attributes column of the generic asset and sensor tables. It also introduces the flexmeasures edit CLI group, to which I also moved the resample-data command (away from flexmeasures db-ops).
Note that I cherry-picked the GenericAssetField from another ongoing PR and introduce here the new marshmallow validator SensorField.

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>
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>
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>
@Flix6x Flix6x requested a review from nhoening February 28, 2022 23:44
@Flix6x Flix6x self-assigned this Feb 28, 2022
@Flix6x Flix6x added this to In progress in Update CLI commands for setting up Sensors and Assets via automation Feb 28, 2022
@coveralls
Copy link
Collaborator

coveralls commented Feb 28, 2022

Pull Request Test Coverage Report for Build 1934750476

  • 50 of 105 (47.62%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.2%) to 68.932%

Changes Missing Coverage Covered Lines Changed/Added Lines %
flexmeasures/data/schemas/sensors.py 6 11 54.55%
flexmeasures/cli/data_edit.py 37 87 42.53%
Totals Coverage Status
Change from base Build 1929585198: -0.2%
Covered Lines: 6704
Relevant Lines: 9237

💛 - 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.

Cool! I request one simple test of a successful addition of one attribute to one sensor.
And maybe a small renaming.

flexmeasures/cli/data_edit.py Show resolved Hide resolved
flexmeasures/data/schemas/sensors.py Outdated Show resolved Hide resolved
flexmeasures/cli/data_edit.py Show resolved Hide resolved
Update CLI commands for setting up Sensors and Assets automation moved this from In progress to Review in progress Mar 1, 2022
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
…problem with db sessions)

Signed-off-by: F.N. Claessen <felix@seita.nl>
@Flix6x Flix6x requested a review from nhoening March 3, 2022 11:27
Update CLI commands for setting up Sensors and Assets automation moved this from Review in progress to Reviewer approved Mar 3, 2022
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>
Signed-off-by: F.N. Claessen <felix@seita.nl>

# Conflicts:
#	flexmeasures/data/schemas/generic_assets.py
@Flix6x Flix6x merged commit 68ee6cd into main Mar 4, 2022
Update CLI commands for setting up Sensors and Assets automation moved this from Reviewer approved to Done Mar 4, 2022
@Flix6x Flix6x deleted the cli-to-edit-attributes branch March 4, 2022 18:21
@Flix6x Flix6x added this to the 0.9.0 milestone Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants