From 2534b6ede67733f81e9a371b3d7d53a446bbbbe7 Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Thu, 9 Nov 2023 16:24:28 -0500 Subject: [PATCH] Use future annotations --- src/stcal/ramp_fitting/ols_cas22/_fit.pyx | 5 +++-- tests/test_jump_cas22.py | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/stcal/ramp_fitting/ols_cas22/_fit.pyx b/src/stcal/ramp_fitting/ols_cas22/_fit.pyx index 5764b139..06098a54 100644 --- a/src/stcal/ramp_fitting/ols_cas22/_fit.pyx +++ b/src/stcal/ramp_fitting/ols_cas22/_fit.pyx @@ -26,6 +26,7 @@ fit_ramps : function for jumps (if use_jump is True) and bad pixels (via the dq array). This is the primary externally callable function. """ +from __future__ import annotations import numpy as np cimport numpy as cnp @@ -42,7 +43,7 @@ from stcal.ramp_fitting.ols_cas22._jump cimport (Thresh, n_pixel_offsets) from stcal.ramp_fitting.ols_cas22._ramp cimport ReadPattern, from_read_pattern -from typing import NamedTuple, Optional +from typing import NamedTuple # Initialize numpy for cython use in this module @@ -87,7 +88,7 @@ class RampFitOutputs(NamedTuple): parameters: np.ndarray variances: np.ndarray dq: np.ndarray - fits: Optional[list] = None + fits: list | None = None @boundscheck(False) diff --git a/tests/test_jump_cas22.py b/tests/test_jump_cas22.py index 87a701c9..a6966a02 100644 --- a/tests/test_jump_cas22.py +++ b/tests/test_jump_cas22.py @@ -2,7 +2,10 @@ import pytest from numpy.testing import assert_allclose -from stcal.ramp_fitting.ols_cas22._jump import fill_fixed_values, _fill_pixel_values, FixedOffsets, PixelOffsets +from stcal.ramp_fitting.ols_cas22._jump import (fill_fixed_values, + _fill_pixel_values, + FixedOffsets, + PixelOffsets) from stcal.ramp_fitting.ols_cas22._ramp import from_read_pattern, init_ramps from stcal.ramp_fitting.ols_cas22 import fit_ramps, Parameter, Variance, JUMP_DET