From e8f9ded09cf176742409dfaad599de49279e9ba5 Mon Sep 17 00:00:00 2001
From: spencer <swilbur@usgs.gov>
Date: Fri, 16 Aug 2024 15:07:22 -0600
Subject: [PATCH] Reformatted a couple files and added comments to explain
 recent changes

---
 geomagio/api/ws/DataApiQuery.py | 19 +------------------
 geomagio/api/ws/algorithms.py   |  5 +++--
 2 files changed, 4 insertions(+), 20 deletions(-)

diff --git a/geomagio/api/ws/DataApiQuery.py b/geomagio/api/ws/DataApiQuery.py
index 16bc7180..a1716691 100644
--- a/geomagio/api/ws/DataApiQuery.py
+++ b/geomagio/api/ws/DataApiQuery.py
@@ -151,24 +151,7 @@ class DataApiQuery(BaseModel):
         return values
 
 
-# Added a new class to be used within the algorithms.py module.
-
-
-# Ask Josh --> Do we need to add all the same validators here as we do for the class DataAPIQuery?
-# class FilterDataApiQuery(BaseModel):
-#     id: str
-#     starttime: UTCDateTime = None
-#     endtime: UTCDateTime = None
-#     elements: List[str] = DEFAULT_ELEMENTS
-#     input_sampling_period: SamplingPeriod
-#     output_sampling_period: SamplingPeriod
-#     sampling_period: None
-#     data_type: Union[DataType, str] = DataType.VARIATION
-#     format: Union[OutputFormat, str] = OutputFormat.IAGA2002
-#     data_host: Union[DataHost, str] = DataHost.DEFAULT #This parameter also has no meaning in the Filter alrogithm use case
-
-
-# The new class inheriting from DataApiQuery
+# The new class inheriting everything except input/output_sampling period from DataApiQuery
 class FilterDataApiQuery(DataApiQuery):
     input_sampling_period: SamplingPeriod = SamplingPeriod.SECOND
     output_sampling_period: SamplingPeriod = SamplingPeriod.MINUTE
diff --git a/geomagio/api/ws/algorithms.py b/geomagio/api/ws/algorithms.py
index 43bdd8ba..60c877e8 100644
--- a/geomagio/api/ws/algorithms.py
+++ b/geomagio/api/ws/algorithms.py
@@ -49,8 +49,9 @@ def get_dbdt(
     name="Filtered Algorithm",
 )
 def get_filter(
-    ##### New query parameter defined below. I am using the DataApiQuery so retreive all the same info from
-    # get_Data_factory and using the SamplingPeriod class to define input and output sampling period.
+    ##### New query parameter defined below. I am using a new query defined in DataApitQuerr.
+    # This relies on the new filter.py module and the get_filter_data function
+    # to define input and output sampling period.
     # I remember us discussing a different name for these variables, possibly inital_sampling_period, but I couldn't remember what we settled on.
     query: FilterDataApiQuery = Depends(get_filter_data_query),
 ) -> Response:
-- 
GitLab