-
Notifications
You must be signed in to change notification settings - Fork 35
pymultifit
submission
#233
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
Comments
Editor in Chief checksHi there! Thank you for submitting your package for pyOpenSci Please check our Python packaging guide for more information on the elements
Editor commentsI think there's enough novelty behind the multifitter and distribution approaches discussed to move forward with a full review. (For clarity, My only concern is regarding the accuracy benchmarks throwing For example, with Beta/home/sarl-ws-5/PycharmProjects/pyMultiFit/src/pymultifit/distributions/utilities_d.py:168: RuntimeWarning: overflow encountered in power
numerator = y**(alpha - 1) * (1 - y)**(beta - 1)
/home/sarl-ws-5/PycharmProjects/pyMultiFit/src/pymultifit/distributions/utilities_d.py:168: RuntimeWarning: overflow encountered in multiply
numerator = y**(alpha - 1) * (1 - y)**(beta - 1) Arcsinehttps://pymultifit.readthedocs.io/latest/benchmarks/_bm_accuracy.html#arcsine() /home/sarl-ws-5/PycharmProjects/pyMultiFit/src/pymultifit/distributions/utilities_d.py:71: RuntimeWarning: invalid value encountered in sqrt
pdf_ = 1 / (np.pi * np.sqrt(y * (1 - y)))
/home/sarl-ws-5/PycharmProjects/pyMultiFit/src/pymultifit/distributions/utilities_d.py:71: RuntimeWarning: divide by zero encountered in divide
pdf_ = 1 / (np.pi * np.sqrt(y * (1 - y)))
/home/sarl-ws-5/PycharmProjects/pyMultiFit/benchmarks/functions.py:30: RuntimeWarning: invalid value encountered in subtract
pdf_abs_diff = np.abs(pdf_custom - pdf_scipy) + EPSILON |
Hi @coatless Thanks for getting back. I've been meaning to address those issues for a while but was waiting for a response before I proceeded. I've updated the required functions, and they shouldn't give the same issues now. The only issue now is that in Cheers. |
@syedalimohsinbukhari any reason for not directly using ![]() Could you restore the docstring for |
Hi @coatless, I think this image should clear things up. The For reference, wiki article and scipy docs. Thanks for the headsup for |
Hi @coatless Just letting you know that |
@syedalimohsinbukhari thanks! I'm going to work on getting an editor assigned to move the review forward. |
@coatless Awesome!! Looking forward to it. |
Hi @coatless I'm working on some updates and wanted to ask if it'll be okay to push the next version or should I just keep the version as is since I've already mentioned it for submission. |
@syedalimohsinbukhari go for it! We're still working on getting editors. |
@syedalimohsinbukhari Thanks for your patience. I've secured an editor to further move the review along. I am happy to announce that @Batalex will be the editor for your submission. |
Hi @Batalex. Welcome, and I'm looking forward to working with you. |
Hello @syedalimohsinbukhari, nice to meet you. |
As mentioned previously, I've updated the submission version for |
Hey, thanks for letting us know. My personal policy when it comes to the reviews I lead as the editor is as follows:
|
Hi @g4brielvs and @KristinaGagalova 👋 Thank you for volunteering to review for pyOpenSci! Please don't hesitate to introduce yourselves. @syedalimohsinbukhari, I am pleased to report that we have our two reviewers 🎉 Please fill out our pre-review surveyBefore beginning your review, please fill out our pre-review survey. This helps us improve all aspects of our review and better understand our community. No personal data will be shared from this survey - it will only be used in an aggregated format by our Executive Director to improve our processes and programs.
The following resources will help you complete your review:
Please note that we will review the revision Please get in touch with any questions or concerns! Your review is due: May 19thReviewers: @g4brielvs, @KristinaGagalova |
Hey there @syedalimohsinbukhari, Pyproject.tomlI would advise migrating as much as possible from There are several benefits to this approach: dependencies groups, having the linter/formatter/test configuration in one single file, using the standard tooling, better readability… Automated toolingI always recommend setting up automation to handle "the boring stuff": code format, linter, type checker, running tests, building docs, etc. FormatterIt seems that you already have some kind of IDE built-in formatter for your project (or you spent quite some time yourself aligning those brackets and commas by hand :D). By enforcing a format using a CLI tool such as Task runnerBuilding / maintaining a package is hard. By using a task runner, you can trivialize a part of this burden by using a third-party tool to delegate the complex commands to run. Here is what it can look like. Of course, this specific example is not directly applicable to # noxfile.py
import nox
nox.options.default_venv_backend = "uv"
nox.options.reuse_venv = "yes"
nox.options.sessions = ["fmt", "lint"]
@nox.session()
def fmt(session: nox.Session) -> None:
"""Format source code."""
session.run(
"uv",
"sync",
"--frozen",
"--only-group",
"fmt",
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
)
session.run("ruff", "format", "src", "tests")
@nox.session()
def lint(session: nox.Session) -> None:
"""Lint source code."""
session.run(
"uv",
"sync",
"--frozen",
"--group",
"lint",
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
)
session.run("ruff", "check", "--fix", "src")
session.run("ruff", "check", "--fix", "tests")
session.run("mypy", "src")
@nox.session()
def tests(session: nox.Session) -> None:
"""Run the unit tests."""
session.run_install(
"uv",
"sync",
"--frozen",
"--group",
"unit",
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
)
session.run("python", "-m", "pytest", *session.posargs)
Then, you get this nice user experience out of the box:
Want to format and lint your code? Just run Your GitHub workflows are simplified as well: tests:
name: Unit test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install nox (and other tools if you need them)
run: pipx install nox
- name: Run tests
run: nox -s tests
Type checkerI commend your efforts on adding some type annotations but while doing so, you must be absolutely certain that they are correct. import numpy as np
from matplotlib import pyplot as plt
from src.pymultifit import EPSILON
from src.pymultifit.fitters import GammaFitterSR
from src.pymultifit.generators import multi_gamma_sr
params = [(2, 2, 1, 5), (4, 6, 2, 1), (1, 3, 2, 9)]
x = np.linspace(EPSILON, 15, 1000)
noise_level = 0.05
y = multi_gamma_sr(x, params=params, noise_level=noise_level) In the last line,
The fix is absolutely not trivial. Sure, we could change
? Unfortunately, numeric data structures are one of the hardest problems when it comes to type annotations. The main takeaways here are:
To help you with the first point ("the rest of the code base coherent with this design decision"), I encourage you to use a type checker. Yes, another tool to get familiar with :D Be warned that running a type checker for the first time will probably highlight dozens of issues throughout your codebase. It just happens that we make plenty of assumptions while writing code. For instance, in Misc.
|
Hi @Batalex, Thanks for the insight; I always welcome any and all suggestions/recommendations. I'll be sure to address these issues. Cheers. |
Hi, just dropping in here to confirm something. I've worked ahead of v1.0.6 but couldn't push it before the reviewers were assigned. Those corrections are somewhat significantly different from the version submitted in a few functions. Keeping in mind that the review is for v1.0.6, I've made a branch that's just a couple of minor corrections ahead of the submitted version, pyopensci-review. If it is okay with everyone, I intend to keep the review's correction there before merging into main. If you have any other suggestions, please let me know. |
Hi @syedalimohsinbukhari, Package ReviewPlease check off boxes as applicable, and elaborate in comments below. Your review is not limited to these topics, as described in the reviewer guide
DocumentationThe package includes all the following forms of documentation:
Readme file requirements
The README should include, from top to bottom:
NOTE: If the README has many more badges, you might want to consider using a table for badges: see this example. Such a table should be more wide than high. (Note that the a badge for pyOpenSci peer-review will be provided upon acceptance.)
UsabilityReviewers are encouraged to submit suggestions (or pull requests) that will improve the usability of the package as a whole.
Functionality
For packages also submitting to JOSS
Note: Be sure to check this carefully, as JOSS's submission requirements and scope differ from pyOpenSci's in terms of what types of packages are accepted. The package contains a
Final approval (post-review)
Estimated hours spent reviewing: ~2Review CommentsThe package is thoughtfully designed and well-documented, which reflects best practices in modularity, extensibility, and usability. Please find constructive suggestions aimed at improving the developer and user experience further.
Style suggestions:
Other suggestions:
|
@syedalimohsinbukhari Thank you fit submitting this package for review. I'll conclude my comments this week. Apologies for the delay. |
Uh oh!
There was an error while loading. Please reload this page.
Submitting Author: Syed Ali Mohsin Bukhari (@syedalimohsinbukhari)
All current maintainers: (@syedalimohsinbukhari)
Package Name:
pymultifit
One-Line Description of Package: A python library for fitting data with multiple models.
Repository Link: https://github.com/syedalimohsinbukhari/pyMultiFit
Version submitted:
v1.0.3v1.0.6EiC: @coatless
Editor: @Batalex
Reviewer 1: @g4brielvs
Reviewer 2: @KristinaGagalova
Archive: TBD
JOSS DOI: TBD
Version accepted: TBD
Date accepted (month/day/year): TBD
Code of Conduct & Commitment to Maintain Package
Description
pymultifit
is built primarily to solve one problem, to fit multiple models (and mixture models) to a given data. Be it multipleGaussian
,Laplacian
, or a mixture of such models, this package aims to deal with multi-model data fitting. The package also provides easy-to-useBaseDistribution
andBaseFitter
classes for respective user-defined functions.Scope
Please indicate which category or categories.
Check out our package scope page to learn more about our
scope. (If you are unsure of which category you fit, we suggest you make a pre-submission inquiry):
Domain Specific
Community Partnerships
If your package is associated with an
existing community please check below:
For all submissions, explain how and why the package falls under the categories you indicated above. In your explanation, please address the following points (briefly, 1-2 sentences for each):
Researchers, data scientists, and statisticians who work with datasets requiring multi-model fitting for robust analysis and modeling.
Apart from scipy, lmfit, and scikit-learn the general purpose scientific packages, there exists PyAutoFit, a Python-based probabilistic programming language built on Bayesian inference. Another notable library is Mixture-Models, which specializes in advanced optimization techniques for fitting various families of mixture models, including Gaussian mixture models and their variants. Both libraries are powerful tools for specific use cases, and I recently came to know about them during my search of existing options.
While these libraries offer robust solutions for hierarchical modeling (PyAutoFit) or a diverse array of pre-defined mixture models (Mixture-Models), pyMultiFit distinguishes itself through its simplicity of use and its focus on simplicity of use. Specifically, it is designed to provide a lightweight and user-friendly framework for fitting multi-model data, including custom mixture models (for example, gaussian + laplace + line). pymultifit also provides easy-to-use base classes that can be modified for any distribution/fitter purposes.
One of the more prominent features of pyMultiFit is the BaseFitter template class that provides custom fitting to any definable function with minimal boilerplate code. All the plotting and boundary functionalities are handled inside the template class so that the user can focus solely on running through multiple models quickly without thinking about how to manage multiple models of the same type or even of different types.
Additionally, the generators template function provides the user with an N-model data generator function with added noise capability to mimic real-life scenarios of whatever distribution the user might want.
If you made a pre-submission enquiry, please paste the link to the corresponding issue, forum post, or other discussion, or
@tag
the editor you contacted:pymultifit
presubmission #221Technical checks
For details about the pyOpenSci packaging requirements, see our packaging guide. Confirm each of the following by checking the box. This package:
Publication Options
JOSS Checks
paper.md
matching JOSS's requirements with a high-level description in the package root or ininst/
.Note: JOSS accepts our review as theirs. You will NOT need to go through another full review. JOSS will only review your paper.md file. Be sure to link to this pyOpenSci issue when a JOSS issue is opened for your package. Also be sure to tell the JOSS editor that this is a pyOpenSci reviewed package once you reach this step.
Are you OK with Reviewers Submitting Issues and/or pull requests to your Repo Directly?
This option will allow reviewers to open smaller issues that can then be linked to PR's rather than submitting a more dense text based review. It will also allow you to demonstrate addressing the issue via PR links.
Confirm each of the following by checking the box.
Please fill out our survey
submission and improve our peer review process. We will also ask our reviewers
and editors to fill this out.
P.S. Have feedback/comments about our review process? Leave a comment here
Editor and Review Templates
The editor template can be found here.
The review template can be found here.
Footnotes
Please fill out a pre-submission inquiry before submitting a data visualization package. ↩
The text was updated successfully, but these errors were encountered: