Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nikki-t committed May 16, 2024
1 parent f001961 commit 7abf2f5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions hydrocron/db/track_status.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""
Hydrocron class to track status of ingested granules.
Note: Current usage uses a JSON file as a substitute for a DynamoDB table and
queries that JSON file to determine what has been ingested. If this is
Note: Current usage uses a JSON file as a substitute for a DynamoDB table and
queries that JSON file to determine what has been ingested. If this is
implemented we should query the Hydrocron reaches and nodes tables.
"""

Expand Down Expand Up @@ -30,7 +30,7 @@

class Track:
"""
Class to track the status of ingested granules and submit missed or
Class to track the status of ingested granules and submit missed or
newly discovered granules for Hydrocron database ingestion.
"""

Expand Down Expand Up @@ -167,14 +167,14 @@ def track_status(self):
json.dump(hydrocron_granules, json_file, indent=2)

# Report on granules that have been set to to_ingest
to_ingest = {key:value for key,value in self.hydrocron_granules.items() if value["status"] == "to_ingest"}
to_ingest = {key: value for key, value in self.hydrocron_granules.items() if value["status"] == "to_ingest"}
with open(f"{TMP_WORKSPACE}/granule_toingest_{self.revision_end.strftime('%Y%m%dT%H%M%S')}.json", 'w', encoding="utf-8") as json_file:
json.dump(to_ingest, json_file, indent=2)

# Report on granules that have been set to ingested
ingested = {key:value for key,value in self.hydrocron_granules.items() \
if value["status"] == "ingested" and \
datetime.datetime.strptime(value["revision_date"], "%Y-%m-%dT%H:%M:%S.%fZ") != self.revision_start}
ingested = {key: value for key, value in self.hydrocron_granules.items()
if value["status"] == "ingested" and
datetime.datetime.strptime(value["revision_date"], "%Y-%m-%dT%H:%M:%S.%fZ") != self.revision_start}
with open(f"{TMP_WORKSPACE}/granule_ingested_{self.revision_end.strftime('%Y%m%dT%H%M%S')}.json", 'w', encoding="utf-8") as json_file:
json.dump(ingested, json_file, indent=2)

Expand Down

0 comments on commit 7abf2f5

Please sign in to comment.