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

Add C fastpath for statistics.NormalDist.inv_cdf() #81979

Closed
rhettinger opened this issue Aug 9, 2019 · 18 comments
Closed

Add C fastpath for statistics.NormalDist.inv_cdf() #81979

rhettinger opened this issue Aug 9, 2019 · 18 comments
Assignees
Labels
3.8 only security fixes 3.9 only security fixes easy extension-modules C modules in the Modules dir

Comments

@rhettinger
Copy link
Contributor

BPO 37798
Nosy @rhettinger, @taleinat, @stevendaprano, @corona10
PRs
  • bpo-37798: Add C fastpath for statistics.NormalDist.inv_cdf() #15266
  • [3.8] bpo-37798: Add C fastpath for statistics.NormalDist.inv_cdf() (GH-15266) #15441
  • bpo-37798: Update test_statistics.py #15453
  • [3.8] bpo-37798: Test both Python and C versions in test_statistics.py (GH-15453) #15467
  • bpo-37798: Minor code formatting and comment clean-ups #15526
  • [3.8] bpo-37798: Minor code formatting and comment clean-ups. (GH-15526) #15527
  • bpo-37798: Fix _statistics module doc #15546
  • [3.8] bpo-37798: Fix _statistics module doc (GH-15546) #15660
  • bpo-37798: Prevent undefined behavior in direct calls to the C helper… #16149
  • [3.8] bpo-37798: Prevent undefined behavior in direct calls to the C helper function. (GH-16149) #16160
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/rhettinger'
    closed_at = <Date 2019-08-24.18:14:59.781>
    created_at = <Date 2019-08-09.04:43:26.916>
    labels = ['extension-modules', 'easy', '3.8', '3.9']
    title = 'Add C fastpath for statistics.NormalDist.inv_cdf()'
    updated_at = <Date 2019-09-15.17:04:03.394>
    user = 'https://github.com/rhettinger'

    bugs.python.org fields:

    activity = <Date 2019-09-15.17:04:03.394>
    actor = 'rhettinger'
    assignee = 'rhettinger'
    closed = True
    closed_date = <Date 2019-08-24.18:14:59.781>
    closer = 'rhettinger'
    components = ['Extension Modules']
    creation = <Date 2019-08-09.04:43:26.916>
    creator = 'rhettinger'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37798
    keywords = ['patch', 'easy (C)']
    message_count = 18.0
    messages = ['349273', '349521', '349527', '350335', '350336', '350337', '350338', '350384', '350389', '350390', '350403', '350558', '350561', '350794', '351078', '351079', '352479', '352481']
    nosy_count = 4.0
    nosy_names = ['rhettinger', 'taleinat', 'steven.daprano', 'corona10']
    pr_nums = ['15266', '15441', '15453', '15467', '15526', '15527', '15546', '15660', '16149', '16160']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue37798'
    versions = ['Python 3.8', 'Python 3.9']

    @rhettinger
    Copy link
    Contributor Author

    Create new module: Modules/_statisticsmodule.c

    Add a function: _normal_dist_inv_cdf(p, mu, sigma) |-> x

    Mostly, it should be a cut-and-paste from the pure Python version, just add argument processing and semi-colons.

    Expect to measure a manyfold speedup.

    @rhettinger rhettinger added 3.9 only security fixes extension-modules C modules in the Modules dir easy labels Aug 9, 2019
    @corona10
    Copy link
    Member

    @rhettinger

    Hi, Can I work on this issue?
    It might be my first C module addition task for CPython.

    @rhettinger
    Copy link
    Contributor Author

    Can I work on this issue?
    It might be my first C module addition task for CPython.

    Yes. This issue would be a good place to start.

    @rhettinger
    Copy link
    Contributor Author

    New changeset 0a18ee4 by Raymond Hettinger (Dong-hee Na) in branch 'master':
    bpo-37798: Add C fastpath for statistics.NormalDist.inv_cdf() (GH-15266)
    0a18ee4

    @rhettinger
    Copy link
    Contributor Author

    New changeset 5779c53 by Raymond Hettinger (Miss Islington (bot)) in branch '3.8':
    bpo-37798: Add C fastpath for statistics.NormalDist.inv_cdf() (GH-15266) (GH-15441)
    5779c53

    @rhettinger
    Copy link
    Contributor Author

    Thanks for doing the work one this. Nice work :-)

    There's one more step. Can you please amend to the tests to run both the pure python and C versions. See Lib/test/test_heapq.py for an example of how to this.

    @rhettinger rhettinger added the 3.8 only security fixes label Aug 23, 2019
    @corona10
    Copy link
    Member

    There's one more step. Can you please amend to the tests to run both the
    pure python and C versions.

    Sure, I will take look at it!

    @rhettinger
    Copy link
    Contributor Author

    New changeset 8ad22a4 by Raymond Hettinger (Dong-hee Na) in branch 'master':
    bpo-37798: Test both Python and C versions in test_statistics.py (GH-15453)
    8ad22a4

    @rhettinger rhettinger self-assigned this Aug 24, 2019
    @rhettinger
    Copy link
    Contributor Author

    New changeset d5a66bc by Raymond Hettinger (Miss Islington (bot)) in branch '3.8':
    bpo-37798: Test both Python and C versions in test_statistics.py (GH-15453) (GH-15467)
    d5a66bc

    @rhettinger
    Copy link
    Contributor Author

    Thank you again. This was nice work.

    @corona10
    Copy link
    Member

    Thank you for the mentoring of this work.
    It was great experience for me!

    @rhettinger
    Copy link
    Contributor Author

    New changeset 6fee0f8 by Raymond Hettinger in branch 'master':
    bpo-37798: Minor code formatting and comment clean-ups. (GH-15526)
    6fee0f8

    @rhettinger
    Copy link
    Contributor Author

    New changeset 56c4d2d by Raymond Hettinger (Miss Islington (bot)) in branch '3.8':
    bpo-37798: Minor code formatting and comment clean-ups. (GH-15526) (GH-15527)
    56c4d2d

    @corona10
    Copy link
    Member

    @rhettinger
    If you are okay, Can you review PR 15546, please?
    IMHO, this issue should be fixed ASAP...
    Thanks again

    @taleinat
    Copy link
    Contributor

    taleinat commented Sep 3, 2019

    New changeset 0cf832a by Tal Einat (Dong-hee Na) in branch 'master':
    bpo-37798: Fix _statistics module doc (GH-15546)
    0cf832a

    @taleinat
    Copy link
    Contributor

    taleinat commented Sep 3, 2019

    New changeset 58067d2 by Tal Einat (Miss Islington (bot)) in branch '3.8':
    bpo-37798: Fix _statistics module doc (GH-15546)
    58067d2

    @rhettinger
    Copy link
    Contributor Author

    New changeset 6e27a0d by Raymond Hettinger in branch 'master':
    bpo-37798: Prevent undefined behavior in direct calls to the C helper function. (bpo-16149)
    6e27a0d

    @rhettinger
    Copy link
    Contributor Author

    New changeset d6fdfc8 by Raymond Hettinger (Miss Islington (bot)) in branch '3.8':
    bpo-37798: Prevent undefined behavior in direct calls to the C helper function. (GH-16149) (GH-16160)
    d6fdfc8

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes 3.9 only security fixes easy extension-modules C modules in the Modules dir
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants