From 0c8e8b57fe03d9a2a58feac43f28816d292ace7a Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Tue, 24 Oct 2023 14:55:58 -0400 Subject: [PATCH] Switch to using `configobj` coming from `astropy` --- src/stpipe/config_parser.py | 12 ++++++------ src/stpipe/log.py | 5 +++-- src/stpipe/pipeline.py | 3 ++- tests/test_config_parser.py | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/stpipe/config_parser.py b/src/stpipe/config_parser.py index 09065be1..f5fd10b6 100644 --- a/src/stpipe/config_parser.py +++ b/src/stpipe/config_parser.py @@ -10,17 +10,17 @@ from asdf import ValidationError as AsdfValidationError from asdf import open as asdf_open - -from . import utilities -from .config import StepConfig -from .datamodel import AbstractDataModel -from .extern.configobj.configobj import ( +from astropy.extern.configobj.configobj import ( ConfigObj, Section, flatten_errors, get_extra_values, ) -from .extern.configobj.validate import ValidateError, Validator, VdtTypeError +from astropy.extern.configobj.validate import ValidateError, Validator, VdtTypeError + +from . import utilities +from .config import StepConfig +from .datamodel import AbstractDataModel from .utilities import _not_set # Configure logger diff --git a/src/stpipe/log.py b/src/stpipe/log.py index c0dbbb16..cfb53982 100644 --- a/src/stpipe/log.py +++ b/src/stpipe/log.py @@ -9,9 +9,10 @@ import threading from contextlib import contextmanager +from astropy.extern.configobj import validate +from astropy.extern.configobj.configobj import ConfigObj + from . import config_parser -from .extern.configobj import validate -from .extern.configobj.configobj import ConfigObj STPIPE_ROOT_LOGGER = "stpipe" DEFAULT_FORMAT = "%(asctime)s - %(name)s - %(levelname)s - %(message)s" diff --git a/src/stpipe/pipeline.py b/src/stpipe/pipeline.py index 357cc0a0..9ce3c1ac 100644 --- a/src/stpipe/pipeline.py +++ b/src/stpipe/pipeline.py @@ -4,8 +4,9 @@ from collections.abc import Sequence from os.path import dirname, join +from astropy.extern.configobj.configobj import ConfigObj, Section + from . import config_parser, crds_client, log -from .extern.configobj.configobj import ConfigObj, Section from .step import Step, get_disable_crds_steppars from .utilities import _not_set diff --git a/tests/test_config_parser.py b/tests/test_config_parser.py index bef530c0..d1e5cbb5 100644 --- a/tests/test_config_parser.py +++ b/tests/test_config_parser.py @@ -2,9 +2,9 @@ from collections.abc import Mapping import pytest +from astropy.extern.configobj.configobj import ConfigObj, Section from stpipe import config_parser -from stpipe.extern.configobj.configobj import ConfigObj, Section from stpipe.utilities import _not_set