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

feat: CLI can delete multiple sensors at once #734

Merged
merged 5 commits into from Jun 20, 2023

Conversation

Flix6x
Copy link
Contributor

@Flix6x Flix6x commented Jun 19, 2023

This PR let's you delete multiple sensors with a single call to flexmeasures delete sensor by passing the --id option multiple times. I also tried to streamline the help messages a bit for CLI usages of the SensorIDField.

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
@Flix6x Flix6x requested a review from Ahmad-Wahid June 19, 2023 13:28
@Flix6x Flix6x self-assigned this Jun 19, 2023
@Flix6x Flix6x added this to the 0.15.0 milestone Jun 19, 2023
Signed-off-by: F.N. Claessen <felix@seita.nl>
@Ahmad-Wahid
Copy link
Contributor

Ahmad-Wahid commented Jun 20, 2023

Just a thought, what if we pass a list of multiple sensor IDs and delete them. Like flexmeasures delete sensor --id [1,2] so far it's fine by passing the id multiple times.

@Flix6x
Copy link
Contributor Author

Flix6x commented Jun 20, 2023

what if we pass a list of multiple sensor IDs and delete them. Like flexmeasures delete sensor --id [1,2]

I like it, but I see the question in the context of a larger issue with how we support different ways of passing lists in various places in the CLI. In general, I like the idea of supporting different ways of passing lists:

  • Using an argument multiple times (like in this PR and various other command options of the flexmeasures add CLI group, which is based on https://click.palletsprojects.com/en/8.1.x/options/#multiple-options).
  • Using a comma separated list, like for instance --start-offset -3D,DB,1W in flexmeasures add report.
  • Using a JSON-like string like you suggest, similar to the --attributes field in flexmeasures add sensor.

It would be nice to better streamline the use of lists in CLI options. -> I opened #736.

Signed-off-by: F.N. Claessen <felix@seita.nl>
@Flix6x Flix6x merged commit 99cf03a into main Jun 20, 2023
5 of 7 checks passed
@Flix6x Flix6x deleted the feature/cli-delete-multiple-sensors-at-once branch June 20, 2023 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants