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

Allow passing scipy.stats univariate distributions to the lmo.l_* functions #183

Open
7 tasks
jorenham opened this issue Mar 29, 2024 · 0 comments
Open
7 tasks
Assignees
Labels
contrib Integration with 3rd party packages enhancement New feature or request
Milestone

Comments

@jorenham
Copy link
Owner

The current monkey-patched methods have several issues:

  • type annotations are impossible for extensions methods, and I've seen no attempts at a PEP that plans to add the required functionality
  • relies on undocumented scipy.stats.rv_* internals, which can break without warning
  • not guaranteed to work when using multiprocessing (it might be fine when using fork, but with e.g. spawn or joblib+loky I suspect it could break, although I have yet to test this).
  • difficult to document properly within mkdocs (hacks required), especially when considering that the docstring styles of scipy and lmo are incompatible.
  • negatively affects the performance of import lmo (the first time)

Instead, it'd be better to extend the lmo.l_* moment functions, making them accept the rv_ instances directly.

  • implement for discrete RV's
  • implement for continuous RV's
  • document the usage, and add (doctest) examples
  • write (hypothesis) tests for the discrete/continuous RV's in lmo.distributions and scipy.stats
  • use two sepearate TypedDict's for **kwargs for specifying extra options to the underlying sample- and population- L-moments estimators
  • add appropriate @overload's.
  • remove lmo.contrib.scipy_stats.l_rv_generic and the related monkey-patch machinery
@jorenham jorenham added enhancement New feature or request contrib Integration with 3rd party packages labels Mar 29, 2024
@jorenham jorenham self-assigned this Mar 29, 2024
@jorenham jorenham added this to the v0.14.0 milestone Mar 29, 2024
@jorenham jorenham modified the milestones: v0.14.0, v1.0.0 May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contrib Integration with 3rd party packages enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant