Skip to content

Commit

Permalink
refactor the cli names
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmad Wahid <ahmedwahid16101@gmail.com>
  • Loading branch information
Ahmad-Wahid committed Jan 17, 2024
1 parent 1890856 commit 23820b2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 22 deletions.
26 changes: 13 additions & 13 deletions flexmeasures/cli/data_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ def new_account(name: str, roles: str, consultancy_account: Account | None):
@click.option("--username", required=True)
@click.option("--email", required=True)
@click.option(
"--account-id",
"--account",
"--account-id",
"account_id",
type=int,
required=True,
Expand Down Expand Up @@ -274,8 +274,8 @@ def new_user(
help="Timezone as string, e.g. 'UTC' or 'Europe/Amsterdam'",
)
@click.option(
"--asset-id",
"--asset",
"--asset-id",
"generic_asset_id",
required=True,
type=int,
Expand Down Expand Up @@ -371,8 +371,8 @@ def add_asset_type(**kwargs):
help="Longitude of the asset's location",
)
@click.option(
"--account-id",
"--account",
"--account-id",
type=int,
required=False,
cls=DeprecatedOption,
Expand All @@ -381,8 +381,8 @@ def add_asset_type(**kwargs):
help="Add asset to this account. Follow up with the account's ID. If not set, the asset will become public (which makes it accessible to all users).",
)
@click.option(
"--asset-type-id",
"--asset-type",
"--asset-type-id",
"generic_asset_type_id",
required=True,
type=int,
Expand Down Expand Up @@ -742,8 +742,8 @@ def add_beliefs(
help="Annotation ends at this datetime. Follow up with a timezone-aware datetime in ISO 6801 format. Defaults to one (nominal) day after the start of the annotation.",
)
@click.option(
"--account-id",
"--account",
"--account-id",
"account_ids",
type=click.INT,
multiple=True,
Expand All @@ -753,8 +753,8 @@ def add_beliefs(
help="Add annotation to this organisation account. Follow up with the account's ID. This argument can be given multiple times.",
)
@click.option(
"--asset-id",
"--asset",
"--asset-id",
"generic_asset_ids",
type=int,
multiple=True,
Expand All @@ -764,8 +764,8 @@ def add_beliefs(
help="Add annotation to this asset. Follow up with the asset's ID. This argument can be given multiple times.",
)
@click.option(
"--sensor-id",
"--sensor",
"--sensor-id",
"sensor_ids",
type=int,
multiple=True,
Expand All @@ -775,8 +775,8 @@ def add_beliefs(
help="Add annotation to this sensor. Follow up with the sensor's ID. This argument can be given multiple times.",
)
@click.option(
"--user-id",
"--user",
"--user-id",
"user_id",
type=int,
required=True,
Expand Down Expand Up @@ -858,8 +858,8 @@ def add_annotation(
help="The ISO 3166-1 country/region or ISO 3166-2 sub-region for which to look up holidays (such as US, BR and DE). This argument can be given multiple times.",
)
@click.option(
"--asset-id",
"--asset",
"--asset-id",
"generic_asset_ids",
type=click.INT,
multiple=True,
Expand All @@ -869,8 +869,8 @@ def add_annotation(
help="Add annotations to this asset. Follow up with the asset's ID. This argument can be given multiple times.",
)
@click.option(
"--account-id",
"--account",
"--account-id",
"account_ids",
type=click.INT,
multiple=True,
Expand Down Expand Up @@ -937,8 +937,8 @@ def add_holidays(
@fm_add_data.command("forecasts", cls=DeprecatedOptionsCommand)
@with_appcontext
@click.option(
"--sensor-id",
"--sensor",
"--sensor-id",
"sensor_ids",
multiple=True,
required=True,
Expand Down Expand Up @@ -1069,8 +1069,8 @@ def create_schedule(ctx):
@create_schedule.command("for-storage", cls=DeprecatedOptionsCommand)
@with_appcontext
@click.option(
"--sensor-id",
"--sensor",
"--sensor-id",
"power_sensor",
type=SensorIdField(),
required=True,
Expand Down Expand Up @@ -1293,8 +1293,8 @@ def add_schedule_for_storage(
@create_schedule.command("for-process", cls=DeprecatedOptionsCommand)
@with_appcontext
@click.option(
"--sensor-id",
"--sensor",
"--sensor-id",
"power_sensor",
type=SensorIdField(),
required=True,
Expand Down
9 changes: 5 additions & 4 deletions flexmeasures/cli/data_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ def delete_structure(force):
@fm_delete_data.command("measurements", cls=DeprecatedOptionsCommand)
@with_appcontext
@click.option(
"--sensor-id",
"--sensor",
"--sensor-id",
"sensor_id",
type=int,
cls=DeprecatedOption,
Expand Down Expand Up @@ -193,8 +193,8 @@ def delete_measurements(
"--force/--no-force", default=False, help="Skip warning about consequences."
)
@click.option(
"--sensor-id",
"--sensor",
"--sensor-id",
"sensor_id",
type=int,
cls=DeprecatedOption,
Expand All @@ -217,8 +217,9 @@ def delete_prognoses(
@fm_delete_data.command("unchanged-beliefs", cls=DeprecatedOptionsCommand)
@with_appcontext
@click.option(
"--sensor",
"--sensor-id",
"--sensor" "sensor_id",
"sensor_id",
type=int,
cls=DeprecatedOption,
deprecated=["--sensor-id"],
Expand Down Expand Up @@ -302,8 +303,8 @@ def delete_unchanged_beliefs(
@fm_delete_data.command("nan-beliefs", cls=DeprecatedOptionsCommand)
@with_appcontext
@click.option(
"--sensor-id",
"--sensor",
"--sensor-id",
"sensor_id",
type=int,
cls=DeprecatedOption,
Expand Down
6 changes: 3 additions & 3 deletions flexmeasures/cli/data_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def fm_edit_data():
@fm_edit_data.command("attribute", cls=DeprecatedOptionsCommand)
@with_appcontext
@click.option(
"--asset-id",
"--asset",
"--asset-id",
"assets",
required=False,
multiple=True,
Expand All @@ -43,8 +43,8 @@ def fm_edit_data():
help="Add/edit attribute to this asset. Follow up with the asset's ID.",
)
@click.option(
"--sensor-id",
"--sensor",
"--sensor-id",
"sensors",
required=False,
multiple=True,
Expand Down Expand Up @@ -155,8 +155,8 @@ def edit_attribute(
@fm_edit_data.command("resample-data", cls=DeprecatedOptionsCommand)
@with_appcontext
@click.option(
"--sensor-id",
"--sensor",
"--sensor-id",
"sensor_ids",
multiple=True,
required=True,
Expand Down
4 changes: 2 additions & 2 deletions flexmeasures/cli/data_show.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,8 @@ def chart(
@fm_show_data.command("beliefs", cls=DeprecatedOptionsCommand)
@with_appcontext
@click.option(
"--sensor-id",
"--sensor",
"--sensor-id",
"sensors",
required=True,
multiple=True,
Expand Down Expand Up @@ -471,8 +471,8 @@ def chart(
help="Time at which beliefs had been known. Follow up with a timezone-aware datetime in ISO 6801 format.",
)
@click.option(
"--source-id",
"--source",
"--source-id",
"source",
required=False,
type=DataSourceIdField(),
Expand Down

0 comments on commit 23820b2

Please sign in to comment.