Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.0.0 #29

Merged
merged 52 commits into from
Jul 25, 2024
Merged

v1.0.0 #29

merged 52 commits into from
Jul 25, 2024

Conversation

MetinSa
Copy link
Collaborator

@MetinSa MetinSa commented Apr 29, 2024

This pull request will include all changes in the first new major ZodiPy release (v1.0.0) 🎉
 

Changes

  • Implement suggestions from pyOpenSci review ZodiPy pyOpenSci/software-submission#161
  • Create brand new interface with better Astropy integration
  • Support specifying an obstime and obspos per coordinate to make ZodiPy better fit for time-ordered analysis.

The new public interface will look something like:
The idea is that at the end of this, ZodiPy should be used maybe as:

import astropy.coordinates as coords
from astropy.time import Time
import astropy.units as u

import zodipy

coordinates = coords.SkyCoord(
    20*u.deg, 
    30*u.deg, 
    obstime=Time.now(),
    frame=coords.BarycentricMeanEcliptic,
)

model = zodipy.Model(25*u.micron)

emission = model.evaluate(coordinates, obspos="earth")

This will require major changes to the public API.

TODO:

  • Drop healpy as a dependency
  • Move bandpass related calculations and the two arguments freq and weights to the ZodiPy initializer. This only needs to happen once when the model is initialized, and not every time the methods are run.
  • Add new method which directly uses SkyCoord objects to unify theta, phi, lonlat, and obstime into one coord argument.
  • Remove all other methods, so that we only have one evaluate method with a signature on the form of evaluate(coords, obspos). The previous get_emission_ang, ``get_binned_emission_ang, get_emission_pix`, and `get_binned_emission_pix` are all deleted. Rather than internally converting from healpix and `theta` `phi` to `SkyCoord` this now has to happen on the user end, but this is trivial with Astropy-healpix.
  • Rename classes, methods, and arguments for a more a more consistent public API.
  • Implement new interpolation since scipy.interp1d is depcrated Replace SciPy's interp1d with new intended interpolation API #27 Attempts to fix #27, currently fails due to keyword arguments in interp_kind #28
  • Use astropy.models.physical_models.BlackBody instead of custom Plancks law implementation
  • See if we can integrate synphot to do bandpass evaluations This was decided to be a bit overkill for the simple trapezoidal integration required by ZodiPy (see Use synphot package to perform bandpass integration #21 )
  • Refactor the bandpass and blackbody internals to use astropy.modeling.physical_models.BlackBody
  • Make sure ZodiPy is ready for Numpy 2.0 by running the new ruff rule ("NPY201")
  • Rewrite tests to use new API and get back to 99% coverage
  • Rewrite usage with new example on readme, index, and usage pages.
  • Re-enable ruff on docs.
  • Test if calling 'cartesian.xyz' is a cached property or a computation.
  • Rewrite tabluate_number_density function.
  • ~~Make the multiprocessing.Pool object be injected instead of created if desired. ~~This does currently not work as intended. Move to another release or drop feature until requested.

MetinSa added 18 commits April 25, 2024 10:19
…signatures, as these really only make sense in that context (I think). Also, start the migration from healpy to astropy-healpix
… search is much slower than to just compute the angular separation between the pointing
Replace healpy with astropy-healpi. Add new API to directly support SkyCoord objects. Move freq and weights arguments to Zodipy object initialization and away from methods
@MetinSa MetinSa marked this pull request as draft April 29, 2024 16:07
@MetinSa MetinSa marked this pull request as ready for review April 29, 2024 16:41
@MetinSa MetinSa marked this pull request as draft April 29, 2024 17:20
@MetinSa MetinSa changed the title Complete API overhaul for more direct astropy integration - V1.0.0 Complete interface overhaul with better astropy integration - v1.0.0 Apr 29, 2024
@MetinSa MetinSa marked this pull request as ready for review May 6, 2024 11:41
MetinSa added 25 commits May 7, 2024 08:11
…integration of near observer dust where its brightest
Add support for specifying an `obstime` and `obspos` per coordinate.
… to the model initialization. Refactor variable and function names.
…nate. Split the main body of the `evaluate` method into its separate function for easier multiprocessing. Modify error messages for invalid input arguments.
…resulted in parallel evaluation being computed in sequence.
@MetinSa MetinSa requested a review from nostutzer July 25, 2024 13:29
@nostutzer nostutzer merged commit 3a85cab into main Jul 25, 2024
8 checks passed
@MetinSa MetinSa deleted the v1.0.0 branch July 25, 2024 13:36
Copy link
Contributor

@nostutzer nostutzer left a comment

Choose a reason for hiding this comment

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

Looks good :)

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