diff --git a/monitoring/uss_qualifier/resources/astm/f3548/v21/subscription_params.py b/monitoring/monitorlib/subscription_params.py similarity index 99% rename from monitoring/uss_qualifier/resources/astm/f3548/v21/subscription_params.py rename to monitoring/monitorlib/subscription_params.py index b9b5ae5bac..03f5020fad 100644 --- a/monitoring/uss_qualifier/resources/astm/f3548/v21/subscription_params.py +++ b/monitoring/monitorlib/subscription_params.py @@ -3,7 +3,6 @@ import datetime from typing import List, Optional, Self -import arrow import s2sphere from implicitdict import ImplicitDict from uas_standards.astm.f3548.v21.api import PutSubscriptionParameters diff --git a/monitoring/uss_qualifier/resources/astm/f3548/v21/__init__.py b/monitoring/uss_qualifier/resources/astm/f3548/v21/__init__.py index 6da048f501..e3eeca9f02 100644 --- a/monitoring/uss_qualifier/resources/astm/f3548/v21/__init__.py +++ b/monitoring/uss_qualifier/resources/astm/f3548/v21/__init__.py @@ -1 +1,21 @@ -from .dss import DSSInstanceResource, DSSInstancesResource +import warnings + +__all__ = ["DSSInstanceResource", "DSSInstancesResource", "PlanningAreaResource"] + + +# TODO remove the exposure of PlanningAreaResource (and revert this __init__.py file to a normal state) when enough time has passed +def __getattr__(name): + if name == "PlanningAreaResource": + warnings.warn( + "PlanningAreaResource has moved from 'resources.astm.f3548.v21' to 'resources'. Importing it from its current location is deprecated and will be removed in the future.", + UserWarning, + stacklevel=2, + ) + from monitoring.uss_qualifier.resources import PlanningAreaResource + + return PlanningAreaResource + elif name in {"DSSInstanceResource", "DSSInstancesResource"}: + from .dss import DSSInstanceResource, DSSInstancesResource + + return locals()[name] + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/monitoring/uss_qualifier/resources/planning_area.py b/monitoring/uss_qualifier/resources/planning_area.py index 30eab9612d..2b5075d8e4 100644 --- a/monitoring/uss_qualifier/resources/planning_area.py +++ b/monitoring/uss_qualifier/resources/planning_area.py @@ -14,11 +14,9 @@ from monitoring.monitorlib.geo import Volume3D, make_latlng_rect from monitoring.monitorlib.geotemporal import Volume4D +from monitoring.monitorlib.subscription_params import SubscriptionParams from monitoring.monitorlib.temporal import Time from monitoring.monitorlib.testing import make_fake_url -from monitoring.uss_qualifier.resources.astm.f3548.v21.subscription_params import ( - SubscriptionParams, -) from monitoring.uss_qualifier.resources.resource import Resource diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/dss/fragments/sub/crud/__init__.py b/monitoring/uss_qualifier/scenarios/astm/utm/dss/fragments/sub/crud/__init__.py index 4c1526ff10..ea247283e3 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/dss/fragments/sub/crud/__init__.py +++ b/monitoring/uss_qualifier/scenarios/astm/utm/dss/fragments/sub/crud/__init__.py @@ -4,10 +4,8 @@ from monitoring.monitorlib.fetch.rid import FetchedSubscription from monitoring.monitorlib.mutate.scd import MutatedSubscription +from monitoring.monitorlib.subscription_params import SubscriptionParams from monitoring.uss_qualifier.resources.astm.f3548.v21.dss import DSSInstance -from monitoring.uss_qualifier.resources.astm.f3548.v21.subscription_params import ( - SubscriptionParams, -) from monitoring.uss_qualifier.scenarios.scenario import TestScenarioType # TODO: add functions implementing checks documented in this package diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/dss/oir_explicit_sub_handling.py b/monitoring/uss_qualifier/scenarios/astm/utm/dss/oir_explicit_sub_handling.py index 2fa3bc64d4..0a9a065c2c 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/dss/oir_explicit_sub_handling.py +++ b/monitoring/uss_qualifier/scenarios/astm/utm/dss/oir_explicit_sub_handling.py @@ -13,15 +13,13 @@ from monitoring.monitorlib.fetch import QueryError from monitoring.monitorlib.geotemporal import Volume4D +from monitoring.monitorlib.subscription_params import SubscriptionParams from monitoring.prober.infrastructure import register_resource_type from monitoring.uss_qualifier.resources import PlanningAreaResource from monitoring.uss_qualifier.resources.astm.f3548.v21.dss import ( DSSInstance, DSSInstanceResource, ) -from monitoring.uss_qualifier.resources.astm.f3548.v21.subscription_params import ( - SubscriptionParams, -) from monitoring.uss_qualifier.resources.communications import ClientIdentityResource from monitoring.uss_qualifier.resources.interuss.id_generator import IDGeneratorResource from monitoring.uss_qualifier.resources.planning_area import PlanningAreaSpecification diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/dss/validators/subscription_validator.py b/monitoring/uss_qualifier/scenarios/astm/utm/dss/validators/subscription_validator.py index d8b4faa6ac..1831f3dfa7 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/dss/validators/subscription_validator.py +++ b/monitoring/uss_qualifier/scenarios/astm/utm/dss/validators/subscription_validator.py @@ -7,9 +7,7 @@ from monitoring.monitorlib.fetch.scd import FetchedSubscription, FetchedSubscriptions from monitoring.monitorlib.mutate.scd import MutatedSubscription from monitoring.monitorlib.schema_validation import F3548_21 -from monitoring.uss_qualifier.resources.astm.f3548.v21.subscription_params import ( - SubscriptionParams, -) +from monitoring.monitorlib.subscription_params import SubscriptionParams from monitoring.uss_qualifier.scenarios.astm.utm.dss.validators import ( fail_with_schema_errors, )