From 9e78b28aab6a320cc564c6001ebfd656d49a5397 Mon Sep 17 00:00:00 2001 From: David Michaels Date: Sat, 30 Mar 2024 15:32:49 -0400 Subject: [PATCH] ingester progress tracking work --- dcicutils/progress_constants.py | 14 ++++++++++---- pyproject.toml | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/dcicutils/progress_constants.py b/dcicutils/progress_constants.py index 8fd06d190..fc3943064 100644 --- a/dcicutils/progress_constants.py +++ b/dcicutils/progress_constants.py @@ -1,11 +1,17 @@ from datetime import datetime from enum import Enum - # Constants for progress tracking for smaht-submitr. # Here only to share between smaht-portal, snovault, and smaht-submitr. -class PROGRESS_INGESTER(Enum): + +class _Enum(Enum): + # Automatically make enumerators within the enumeration resolve to its value property. + def __get__(self, instance, owner): + return self.value + + +class PROGRESS_INGESTER(_Enum): VALIDATION = "ingester_validation" INITIATE = "ingester_initiate" PARSE_LOAD_INITIATE = "ingester_parse_initiate" @@ -20,7 +26,7 @@ class PROGRESS_INGESTER(Enum): NOW = lambda: str(datetime.utcnow()) # noqa -class PROGRESS_PARSE(Enum): +class PROGRESS_PARSE(_Enum): LOAD_START = "parse_start" LOAD_ITEM = "parse_item" LOAD_DONE = "parse_done" @@ -46,7 +52,7 @@ class PROGRESS_PARSE(Enum): NOW = lambda: str(datetime.utcnow()) # noqa -class PROGRESS_LOADXL(Enum): +class PROGRESS_LOADXL(_Enum): START = "loadxl_start" START_SECOND_ROUND = "loadxl_start_second_round" ITEM = "loadxl_item" diff --git a/pyproject.toml b/pyproject.toml index 7db03bc7f..5ff010889 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "dcicutils" -version = "8.8.1.1b15" # TODO: To become 8.8.2 +version = "8.8.1.1b16" # TODO: To become 8.8.2 description = "Utility package for interacting with the 4DN Data Portal and other 4DN resources" authors = ["4DN-DCIC Team "] license = "MIT"