From 20bedbacb02d66605d1bdea03d27c1346134dcd3 Mon Sep 17 00:00:00 2001 From: "Janet L. Goldstein" <jgoldste@nrao.edu> Date: Mon, 28 Jun 2021 14:13:19 -0600 Subject: [PATCH] WS-507: Lay the groundwork for implementation of the ingestion manifest builder, using existing archive-metaproject ingestion builder as a guide. --- .../pexable/ingest_envoy/README.md | 3 ++ .../ingest_envoy/ingest_envoy/classes.py | 49 +++++++++++++++++++ .../executables/pexable/ingest_envoy/setup.py | 1 + .../pexable/ingest_envoy/test/__init__.py | 0 .../test/test_alma_ing_manifests.py | 33 +++++++++++++ .../test/test_evla_ing_manifests.py | 33 +++++++++++++ .../test/test_miscellaneous_manifests.py | 45 +++++++++++++++++ .../ingest_envoy/test/test_vlba_manifests.py | 23 +++++++++ 8 files changed, 187 insertions(+) create mode 100644 apps/cli/executables/pexable/ingest_envoy/ingest_envoy/classes.py create mode 100644 apps/cli/executables/pexable/ingest_envoy/test/__init__.py create mode 100644 apps/cli/executables/pexable/ingest_envoy/test/test_alma_ing_manifests.py create mode 100644 apps/cli/executables/pexable/ingest_envoy/test/test_evla_ing_manifests.py create mode 100644 apps/cli/executables/pexable/ingest_envoy/test/test_miscellaneous_manifests.py create mode 100644 apps/cli/executables/pexable/ingest_envoy/test/test_vlba_manifests.py diff --git a/apps/cli/executables/pexable/ingest_envoy/README.md b/apps/cli/executables/pexable/ingest_envoy/README.md index 6efa7cfe8..4cd7fcaeb 100644 --- a/apps/cli/executables/pexable/ingest_envoy/README.md +++ b/apps/cli/executables/pexable/ingest_envoy/README.md @@ -1 +1,4 @@ # Ingestion Envoy + +This is a Python port of the ingestion manifest builder in archive-metaproject. +See https://open-confluence.nrao.edu/display/SSA/Ingestion+Manifests. diff --git a/apps/cli/executables/pexable/ingest_envoy/ingest_envoy/classes.py b/apps/cli/executables/pexable/ingest_envoy/ingest_envoy/classes.py new file mode 100644 index 000000000..a9ae76670 --- /dev/null +++ b/apps/cli/executables/pexable/ingest_envoy/ingest_envoy/classes.py @@ -0,0 +1,49 @@ +""" Objects pertaining to the various ingestion manifests """ + +from enum import Enum + + +class Telescope(Enum): + """Codifying the names of our telescopes, because Janet can't abide magic strings""" + + VLA = 1 + EVLA = 2 + ALMA = 3 + VLBA = 4 + GBT = 5 + NONE = 6 + + +class IngestionType(Enum): + """Types of ingestion we'll have to do""" + + # ALMA products + ALMA_SDM = Telescope.ALMA + ALMA_CAL = Telescope.ALMA + ALMA_AUDI = Telescope.ALMA + + # EVLA products + EVLA_SDM = Telescope.EVLA + EVLA_BDF = Telescope.EVLA + EVLA_CAL = Telescope.EVLA + + # RealFast projects + REALFAST_SDM = Telescope.EVLA + + # VLASS projects + VLASS_QUICKLOOK = Telescope.EVLA + + # VLBA ingestion. (IDI and UVFITS products are treated the same.) + VLBA_FITS = Telescope.VLBA + + # Coming Real Soon Now: VLBA Mark 4 product ingestion + VLBA_MARK4 = Telescope.VLBA + + # Also coming Real Soon: GBT execution block ingestion + GBT_EB = Telescope.GBT + + # Hot on its heels: LVLA execution block ingestion + LVLA_EB = Telescope.VLA + + # When we just don't know what we're dealing with + UNKNOWN = Telescope.NONE diff --git a/apps/cli/executables/pexable/ingest_envoy/setup.py b/apps/cli/executables/pexable/ingest_envoy/setup.py index 1fa3d5bda..5cbc999a2 100644 --- a/apps/cli/executables/pexable/ingest_envoy/setup.py +++ b/apps/cli/executables/pexable/ingest_envoy/setup.py @@ -20,6 +20,7 @@ setup( url="TBD", license="GPL", install_requires=requires, + tests_require=["pytest"], keywords=[], packages=find_packages(), classifiers=["Programming Language :: Python :: 3.8"], diff --git a/apps/cli/executables/pexable/ingest_envoy/test/__init__.py b/apps/cli/executables/pexable/ingest_envoy/test/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/apps/cli/executables/pexable/ingest_envoy/test/test_alma_ing_manifests.py b/apps/cli/executables/pexable/ingest_envoy/test/test_alma_ing_manifests.py new file mode 100644 index 000000000..da37adf8f --- /dev/null +++ b/apps/cli/executables/pexable/ingest_envoy/test/test_alma_ing_manifests.py @@ -0,0 +1,33 @@ +""" Test for the various types of ALMA ingestion manifests """ + +import pytest + + +@pytest.mark.skip("TODO: test_builds_alma_sdm_manifest") +def test_builds_alma_sdm_manifest(): + """ + Have we built a well-formed ALMA SDM ingestion manifest? + + :return: + """ + raise NotImplementedError + + +@pytest.mark.skip("TODO: test_builds_alma_cal_manifest") +def test_builds_alma_cal_manifest(): + """ + Have we built a well-formed ALMA calibration ingestion manifest? + + :return: + """ + raise NotImplementedError + + +@pytest.mark.skip("TODO: test_builds_alma_cal_manifest") +def test_builds_alma_audi_manifest(): + """ + Have we built a well-formed ALMA image ingestion manifest? + + :return: + """ + raise NotImplementedError diff --git a/apps/cli/executables/pexable/ingest_envoy/test/test_evla_ing_manifests.py b/apps/cli/executables/pexable/ingest_envoy/test/test_evla_ing_manifests.py new file mode 100644 index 000000000..5d6bff8d5 --- /dev/null +++ b/apps/cli/executables/pexable/ingest_envoy/test/test_evla_ing_manifests.py @@ -0,0 +1,33 @@ +""" Test for the various types of EVLA ingestion manifests """ + +import pytest + + +@pytest.mark.skip("TODO: test_builds_evla_sdm_manifest") +def test_builds_evla_sdm_manifest(): + """ + Have we built a well-formed EVLA SDM ingestion manifest? + + :return: + """ + raise NotImplementedError + + +@pytest.mark.skip("TODO: test_builds_evla_bdf_manifest") +def test_builds_evla_bdf_manifest(): + """ + Have we built a well-formed EVLA BDF ingestion manifest? + + :return: + """ + raise NotImplementedError + + +@pytest.mark.skip("TODO: test_builds_evla_cal_manifest") +def test_builds_evla_cal_manifest(): + """ + Have we built a well-formed EVLA calibration ingestion manifest? + + :return: + """ + raise NotImplementedError 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 new file mode 100644 index 000000000..f16175ae1 --- /dev/null +++ b/apps/cli/executables/pexable/ingest_envoy/test/test_miscellaneous_manifests.py @@ -0,0 +1,45 @@ +""" Tests for all the other types of ingestion manifests """ + +import pytest + + +@pytest.mark.skip("TODO: test_builds_realfast_sdm_manifest") +def test_builds_realfast_sdm_manifest(): + """ + Have we built a well-formed RealFast product ingestion manifest? + + :return: + """ + raise NotImplementedError + + +@pytest.mark.skip("TODO: test_builds_vlass_quicklook_manifest") +def test_builds_vlass_quicklook_manifest(): + """ + Have we built a well-formed VLASS quicklook product ingestion manifest? + + :return: + """ + raise NotImplementedError + + +@pytest.mark.skip("TODO: test_builds_gbt_manifest") +def test_builds_gbt_manifest(): + """ + Not yet in use, but sooner or later we'll need to create manifests + for ingestion of GBT products. + + :return: + """ + raise NotImplementedError + + +@pytest.mark.skip("TODO: test_builds_lvla_eb_manifest") +def test_builds_lvla_eb_manifest(): + """ + Not yet in use, but one of these days we'll need to create manifests + for ingestion of LVLA execution blocks. + + :return: + """ + raise NotImplementedError diff --git a/apps/cli/executables/pexable/ingest_envoy/test/test_vlba_manifests.py b/apps/cli/executables/pexable/ingest_envoy/test/test_vlba_manifests.py new file mode 100644 index 000000000..16cd3707f --- /dev/null +++ b/apps/cli/executables/pexable/ingest_envoy/test/test_vlba_manifests.py @@ -0,0 +1,23 @@ +""" Tests for VLBA product ingestion manifests """ + +import pytest + + +@pytest.mark.skip("TODO: test_builds_vlba_fits_manifest") +def test_builds_vlba_fits_manifest(): + """ + Have we built a well-formed VLBA IDI/UVFITS ingestion manifest? + + :return: + """ + raise NotImplementedError + + +@pytest.mark.skip("TODO: test_builds_vlba_mark4_manifest") +def test_builds_vlba_mark4_manifest(): + """ + Unused, but coming: Have we built a well-formed VLBA Mark 4 ingestion manifest? + + :return: + """ + raise NotImplementedError -- GitLab