diff --git a/obstools/__init__.py b/obstools/__init__.py index e84a32b..c2af11c 100644 --- a/obstools/__init__.py +++ b/obstools/__init__.py @@ -8,8 +8,7 @@ # # @author: tbowers -"""Init File -""" +"""Init File""" # Imports for signal and log handling diff --git a/obstools/neocp_ephem.py b/obstools/neocp_ephem.py index a90bf77..29c4d67 100644 --- a/obstools/neocp_ephem.py +++ b/obstools/neocp_ephem.py @@ -87,7 +87,7 @@ .. warning:: This module is not yet functional! - + """ # Built-In Libraries diff --git a/obstools/scrub_deveny_pickup.py b/obstools/scrub_deveny_pickup.py index 348bc06..288a2b6 100644 --- a/obstools/scrub_deveny_pickup.py +++ b/obstools/scrub_deveny_pickup.py @@ -60,6 +60,7 @@ import ccdproc.utils.slices import matplotlib.pyplot as plt import numpy as np + # from pypeit import msgs import pypeit.spec2dobj import scipy.fft @@ -1012,7 +1013,9 @@ def package_into_fits( suffix (Default: False) """ # Add a little history - time_str = datetime.datetime.now(datetime.UTC).isoformat(sep=" ", timespec="seconds") + time_str = datetime.datetime.now(datetime.UTC).isoformat( + sep=" ", timespec="seconds" + ) history_str = f"Written by package obstools: {time_str} UTC" # For the image HDUs, include a basic header img_hdr = astropy.io.fits.Header({"BUNIT": "ADU", "HISTORY": history_str}) diff --git a/obstools/tests/test_celestial_time.py b/obstools/tests/test_celestial_time.py index 2f712aa..d508107 100644 --- a/obstools/tests/test_celestial_time.py +++ b/obstools/tests/test_celestial_time.py @@ -11,8 +11,7 @@ # @author: tbowers # pylint: disable=missing-function-docstring -"""Celestial Time Utilities TEST Module -""" +"""Celestial Time Utilities TEST Module""" import numpy as np import pytest diff --git a/obstools/tests/test_deveny_grangle.py b/obstools/tests/test_deveny_grangle.py index 5dbdb6f..3206cf7 100644 --- a/obstools/tests/test_deveny_grangle.py +++ b/obstools/tests/test_deveny_grangle.py @@ -11,8 +11,7 @@ # @author: tbowers # pylint: disable=missing-function-docstring -"""DeVeny Grating Angle Calculator TEST Module -""" +"""DeVeny Grating Angle Calculator TEST Module""" import numpy as np diff --git a/obstools/tests/test_lmi_etc.py b/obstools/tests/test_lmi_etc.py index 66d4722..8d24c67 100644 --- a/obstools/tests/test_lmi_etc.py +++ b/obstools/tests/test_lmi_etc.py @@ -11,8 +11,7 @@ # @author: tbowers # pylint: disable=missing-function-docstring -"""LMI Exposure Time Calculator TEST Module -""" +"""LMI Exposure Time Calculator TEST Module""" import numpy as np import pytest diff --git a/obstools/tests/test_utils.py b/obstools/tests/test_utils.py index 52b18b0..ebd1677 100644 --- a/obstools/tests/test_utils.py +++ b/obstools/tests/test_utils.py @@ -11,8 +11,7 @@ # @author: tbowers # pylint: disable=missing-function-docstring -"""Utility TEST Module -""" +"""Utility TEST Module""" from obstools import utils @@ -40,6 +39,12 @@ def test_flatten_comprehension(): pass +def test_flatten_itertools(): + nested_str = [["a", "b", "c"], ["d"], ["e"], ["f"], ["g"]] + flat_str = utils.flatten_itertools(nested_str) + assert flat_str == ["a", "b", "c", "d", "e", "f", "g"] + # Add other types of tests here... + def test_gaussfit(): pass diff --git a/obstools/utils.py b/obstools/utils.py index 8cca85d..7c8227c 100644 --- a/obstools/utils.py +++ b/obstools/utils.py @@ -153,7 +153,7 @@ def flatten_itertools(nested_list: list[list]) -> list: :obj:`list` The flattened list """ - return [itertools.chain.from_iterable(nested_list)] + return [item for item in itertools.chain.from_iterable(nested_list)] def gaussfit(