diff --git a/apps/cli/executables/pexable/ingest_envoy/ingest_envoy/ingest.py b/apps/cli/executables/pexable/ingest_envoy/ingest_envoy/ingest.py index e6c1bfa41399edad406ce98af69771d1421b2618..30e4095b1ad5220952209b930b7e41386ea5ee07 100644 --- a/apps/cli/executables/pexable/ingest_envoy/ingest_envoy/ingest.py +++ b/apps/cli/executables/pexable/ingest_envoy/ingest_envoy/ingest.py @@ -3,7 +3,7 @@ import sys from pathlib import Path -from ingest_envoy.ingestion_manifest_writer import EvlaCalIngestionManifestWriter +from ingest_envoy.ingestion_manifest import IngestionManifest from ingest_envoy.utilities import ScienceProductType @@ -24,6 +24,4 @@ def main(): # ValueError will be thrown if ingestion_type isn't a known ScienceProductType ingestion_type = ScienceProductType.from_str(ingestion_type) - writer = EvlaCalIngestionManifestWriter(ingestion_type, source_dir) - writer.write_evla_cal_manifest(locator) - # IngestionManifest(source_dir, ingestion_type, locator).create() + IngestionManifest(source_dir, ingestion_type, locator).create() diff --git a/apps/cli/executables/pexable/ingest_envoy/ingest_envoy/ingestion_manifest_writer.py b/apps/cli/executables/pexable/ingest_envoy/ingest_envoy/ingestion_manifest_writer.py index 9d823a9fcd3ce4c1f7b4261c7674a6968dc6b4f3..c823bf861582ff98206d2b6d74d775978eafa161 100644 --- a/apps/cli/executables/pexable/ingest_envoy/ingest_envoy/ingestion_manifest_writer.py +++ b/apps/cli/executables/pexable/ingest_envoy/ingest_envoy/ingestion_manifest_writer.py @@ -1,6 +1,4 @@ """Build an ingestion manifest file""" - - import json import logging import re @@ -132,7 +130,7 @@ class EvlaCalIngestionManifestWriter: raise NotImplementedError(f"{self.sp_type}") @staticmethod - def format_timestamp(start_time: DateTime) -> str: + def format_timestamp(datetime: DateTime) -> str: """ Format the current time as follows: input format: @@ -140,25 +138,11 @@ class EvlaCalIngestionManifestWriter: desired output format as yyyy_MM_dd_'T'HH_mm_ss.SSS: 2021_07_01'T'13_49_17.237 - :param start_time: current pendulum timestamp + :param datetime: current pendulum timestamp :return: timestamp suitable for ingestion manifest filename """ - time_str = str(start_time) - # change hyphens and colons to underscores - timestamp = time_str.replace("-", "_", len(time_str)) - timestamp = timestamp.replace(":", "_", len(timestamp)) - # chop off the last bit - timestamp = timestamp.split("+")[0] - # now timestamp ends with ss.###....; round to 3 places - ts_parts = timestamp.split("_") - seconds = float(ts_parts[len(ts_parts) - 1]) - rounded = round(seconds, 3) - timestamp = timestamp.replace(str(seconds), str(rounded)) - # finally, the T in single quotes - timestamp = timestamp.replace("T", "'T'") - - return timestamp + return datetime.format("YYYY_MM_DD'T'hh_mm_ss.SSS") @staticmethod def manifest_filename() -> str: diff --git a/apps/cli/executables/pexable/ingest_envoy/test/test_miscellaneous_manifests.py b/apps/cli/executables/pexable/ingest_envoy/test/test_miscellaneous_manifests.py index 396ae846005afda1e5efb42410c015e72c25516d..2ae870effaa02ad4e06a599e32cee74983c7a384 100644 --- a/apps/cli/executables/pexable/ingest_envoy/test/test_miscellaneous_manifests.py +++ b/apps/cli/executables/pexable/ingest_envoy/test/test_miscellaneous_manifests.py @@ -9,7 +9,6 @@ import pytest from ingest_envoy.ingestion_manifest import IngestionManifest from ingest_envoy.utilities import ScienceProductType -# ingest_path import IS used; keep it from .conftest import populate_fake_ingest_path, WANTED_FILENAMES, UNWANTED logger = logging.getLogger(IngestionManifest.__name__)