Skip to content

Conversation

@b-biswas
Copy link
Collaborator

@b-biswas b-biswas commented Aug 4, 2025

No description provided.

@codecov
Copy link

codecov bot commented Aug 4, 2025

Codecov Report

❌ Patch coverage is 92.14660% with 60 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.94%. Comparing base (56c5176) to head (211c5bc).

Files with missing lines Patch % Lines
...d_metadetect/jaxify/tests/test_jax_deep_metacal.py 64.82% 51 Missing ⚠️
deep_field_metadetect/jaxify/jax_metacal.py 95.29% 8 Missing ⚠️
deep_field_metadetect/jaxify/observation.py 98.24% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #30      +/-   ##
==========================================
- Coverage   99.05%   96.94%   -2.11%     
==========================================
  Files          20       28       +8     
  Lines        1689     2421     +732     
==========================================
+ Hits         1673     2347     +674     
- Misses         16       74      +58     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@b-biswas b-biswas requested a review from beckermr August 5, 2025 17:03
- ngmix
- numba
- numpy
- jax<0.7.0
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you comment on this restriction?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it related to JAX-GalSim?

Copy link
Owner

@beckermr beckermr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor changes, but looks great!

return True


def ngmix_obs_to_dfmd_obs(obs: ngmix.observation.Observation) -> DFMdetObservation:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a doc string.

)


def dfmd_obs_to_ngmix_obs(dfmd_obs) -> Observation:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a doc string.



def get_gauss_reconv_psf_galsim(psf, step=DEFAULT_STEP, flux=1):
def get_gauss_reconv_psf_galsim(psf, step=DEFAULT_STEP, flux=1, dk=None, kim_size=None):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dk is not in the doc string.


def _render_psf_and_build_obs(image, obs, reconv_psf, weight_fac=1):
def _render_psf_and_build_obs(
image, obs, reconv_psf, weight_fac=1, max_min_fft_size=None
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's call this max_min_fft_size just fft_size since it is used to set the FFT size directly. We should make this change everywhere.

Comment on lines +407 to +420
if dfmd_obs1.has_bmask() or dfmd_obs2.has_bmask():
new_bmask = _extract_attr(dfmd_obs1, "bmask", jnp.int32) | _extract_attr(
dfmd_obs2, "bmask", jnp.int32
)

if dfmd_obs1.has_ormask() or dfmd_obs2.has_ormask():
new_ormask = _extract_attr(dfmd_obs1, "ormask", jnp.int32) | _extract_attr(
dfmd_obs2, "ormask", jnp.int32
)

if dfmd_obs1.has_noise() or dfmd_obs2.has_noise():
new_noise = _extract_attr(dfmd_obs1, "noise") + _extract_attr(
dfmd_obs2, "noise"
)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does JIT properly handle these if statements. Have you tested that?

)

# now add in noise corr to make it match the wide noise
# TODO: is it after to vextorize?
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to address this item?

force_maxk_psf=0.0,
max_min_fft_size=1024,
):
"""Do metacalibration for a combination of wide+deep datasets."""
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function should have a complete doc string.

mcal_res[k] = dfmd_obs_to_ngmix_obs(mcal_res[k])
mcal_res[k].psf.galsim_obj = reconv_psf

return mcal_res, kinfo
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should return only one value if we can.

force_maxk_psf=0.0,
max_min_fft_size=1024,
) -> dict:
"""Run deep-field metadetection for a simple scenario of a single band
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doc string is not complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants