Skip to content

statmorph package re-review #421

Closed

Description

@vrodgom

Hello,

I recently made several improvements to the statmorph affiliated package and I believe that the scores can now be updated. The original PR and review can be found here.

I have implemented the vast majority of the comments and recommendations from the review, which was very helpful. Please find below my response to the points raised in the review.

Thanks,
Vicente

CC: @pllim @hamogu


Integration with Astropy ecosystem

  • I have removed the custom normalize() function and replaced it with astropy.visualization.simple_norm().
  • As suggested, I have replaced scipy.ndimage.convolve with astropy.convolution.convolve. However, regarding the FFT versions, there would be a significant performance cost in replacing scipy.signal.fftconvolve with astropy.convolution.convolve_fft. The latter seems to be about an order of magnitude slower (more details here and here). This is perhaps the most time-consuming part of the code (during the Sersic profile fitting), so I would strongly favor keeping scipy.signal.fftconvolve for now.
  • I have replaced the custom _mode() function with photutils.background.ModeEstimatorBackground.
  • Regarding the custom _quantile() function, I did not use numpy.percentile() because it sorts the input array, while _quantile() assumes that the array is already sorted. Therefore, _quantile() is infinitely faster than numpy.percentile() for sorted arrays (because it skips the sorting), which is always the case when _quantile() is called in statmorph. This represents the other most time-consuming part of the code (the calculation of the "multimode" statistic), so it is important to keep this custom _quantile() function.

Documentation

  • As suggested, I have embedded the notebook tutorial into the documentation using nbsphinx.
  • The public function utils.normalize() was removed, while utils.get_ax() was made private.

Testing

  • The package now has a more extensive test suite that achieves 96% coverage.
  • As suggested, the package now has CI running (GitHub Actions).

Python 3 compatibility

  • I have dropped support for Python 2.

Activity

  1. pllim commented on Jan 14, 2021

    @pllim
    Member

    This package has been (re)reviewed for inclusion in the Astropy affiliated package ecosystem by a member of the Astropy community as well as myself, and I have synthesized the results of the review here.

    You can find out more about our review criteria in Reviewing affiliated packages. For each of the review categories below, we have listed the score and have included some comments when the score is not green.

    Functionality/Scope Specialized package
    No further comments
    Integration with Astropy ecosystem Green
    astropy.visualization.simple_norm is now used.

    astropy.convolution.convolve is now used. astropy.convolution.convolve_fft was not used because it is reportedly 10x slower, but turning off certain options would result in a huge performance improvement. Either astropy.convolution.convolve_fft or scipy.signal.fftconvolve is acceptable, especially if the extra features astropy provides are not needed.

    photutils.background.ModeEstimatorBackground is now used.

    The author's custom _quantile() function is faster because it does not need to sort the data. The input data are already sorted (this was missed in the last review), so this makes complete sense.
    Documentation Green
    ReadTheDocs now includes a tutorial from the notebook content.

    utils.normalize() was removed and get_ax() is now a private function.
    Testing Green
    There are now unit tests and the package has 96% coverage overall: 96% coverage for statmorph.py and 99% for image_diagnostics.py.

    The package is now using GitHub Actions for CI. However, the CI is triggered only for push and scheduled events, not pull requests (see .github/workflows/ci.yml#L3). It would be better if CI was enabled for pull requests to run the test suite on user contributions before the code is merged.
    Development status Green
    There has been a lot of activity from the developer in the last 3 months.
    Python 3 compatibility Green
    The "__future__" imports have been removed from the code. However, the setup.py doesn't state the minimum required Python version. This is recommended assuming the packaging does not support all Python >= 3.0.

    The utils/image_diagnostics.py module has a hard dependency on matplotlib, but matplotlib is not listed as a required dependency, nor is it listed in the setup install_requires. Alternatively, matplotlib could be made an optional dependency by moving the matplotlib imports inside the make_figure function.

    Summary/Decision: Everything looks great, and we're happy to confirm that this package maintains its status as an affiliated package! 🏆

    If you have any follow-up questions or disagree with any of the comments above, leave a comment and we can discuss it here. At any point in future you can request a re-review of the package if you believe any of the scores should be updated - contact the affiliated package editors listed on the Astropy team page, and we will do a new review.

    p.s. Previous review available at #315 (comment) .

  2. vrodgom commented on Jan 17, 2021

    @vrodgom
    ContributorAuthor

    Thanks! I have implemented the last few comments (about CI and package dependencies).

  3. pllim commented on Jan 17, 2021

    @pllim
    Member

    Awesome. Thanks, @vrodgom !

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions