Skip to content

Commit

Permalink
Move imports to the top of the file
Browse files Browse the repository at this point in the history
  • Loading branch information
arunkannawadi committed Oct 31, 2024
1 parent 0a80612 commit c6cae7f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions metadetect/lsst/measure.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from ..fitting import fit_mbobs_wavg, get_wavg_output_struct

from . import util
from .util import ContextNoiseReplacer
from .util import ContextNoiseReplacer, get_jacobian
from . import vis
from .defaults import DEFAULT_THRESH

Expand Down Expand Up @@ -657,7 +657,6 @@ def _extract_jacobian_at_source(exp, source):
Jacobian: ngmix.Jacobian
The local jacobian
"""
from .util import get_jacobian

orig_cen = exp.getWcs().skyToPixel(source.getCoord())

Expand Down
3 changes: 1 addition & 2 deletions metadetect/lsst/metadetect.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,6 @@ def fit_original_psfs_mbexp(mbexp, rng, wgts):
This can fail and flags will be set, but we proceed
"""
from .measure import extract_psf_image

assert len(wgts) == len(mbexp)
wsum = sum(wgts)
Expand All @@ -634,7 +633,7 @@ def fit_original_psfs_mbexp(mbexp, rng, wgts):
)
jac = get_jacobian(exp=exp, cen=cen)

psf_im = extract_psf_image(exp, cen)
psf_im = measure.extract_psf_image(exp, cen)

psf_cen = (np.array(psf_im.shape)-1.0)/2.0
psf_jacob = jac.copy()
Expand Down
6 changes: 2 additions & 4 deletions metadetect/lsst/skysub.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
)
from lsst.meas.algorithms import SourceDetectionConfig as OriginalSourceDetectionConfig
from lsst.pex.config import Config, ConfigurableField, Field
from lsst.pipe.base import Task

from lsst.pex.exceptions import RuntimeError as LSSTRuntimeError
from lsst.pipe.base import Task, TaskError

from .defaults import DEFAULT_THRESH
from . import util
Expand Down Expand Up @@ -64,8 +64,6 @@ def __init__(self, *args, **kwargs):
self.makeSubtask("back")

def run(self, exposure):
from lsst.pex.exceptions import RuntimeError as LSSTRuntimeError
from lsst.pipe.base.task import TaskError
if self.config.niter < 1:
raise ValueError(f'niter {self.config.niter} is less than 1')

Check warning on line 68 in metadetect/lsst/skysub.py

View check run for this annotation

Codecov / codecov/patch

metadetect/lsst/skysub.py#L68

Added line #L68 was not covered by tests

Expand Down

0 comments on commit c6cae7f

Please sign in to comment.