Skip to content

feat: add C implementation for stats/base/dists/erlang/pdf - #10554

Merged
Planeshifter merged 7 commits into
stdlib-js:developfrom
rautelaKamal:feat/stats/base/dists/erlang/pdf-c-port
Sep 2, 2026
Merged

Planeshifter merged 7 commits into
stdlib-js:developfrom
rautelaKamal:feat/stats/base/dists/erlang/pdf-c-port

Conversation

@rautelaKamal

@rautelaKamal rautelaKamal commented Feb 27, 2026 •

Copy link
Copy Markdown
Contributor

Ref #3575.

Description

What is the purpose of this pull request?

This pull request:

  • Adds a C implementation for @stdlib/stats/base/dists/erlang/pdf, fulfilling the open RFC [RFC]: Add C implementation for @stdlib/stats/base/dists/erlang/pdf #3575.
  • Validates that the shape parameter k is a non-negative integer using stdlib_base_is_nonnegative_integer(k).
  • Reuses the existing Gamma distribution implementation by safely proxying the evaluation directly to the stdlib_base_dists_gamma_pdf C function, since the Erlang distribution is mathematically a special case of the Gamma distribution.
  • Integrates standard N-API bindings, Makefile, include.gypi, binding.gyp, and the native.js benchmarks & tests.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

I utilized an AI coding assistant to help scaffold the C implementations, N-API bindings, makefiles, and native benchmarks. The logic was reviewed and verified manually to ensure mathematical correctness and alignment with standard project practices.


@stdlib-js/reviewers

@stdlib-bot stdlib-bot added Statistics Issue or pull request related to statistical functionality. Needs Review A pull request which needs code review. Good First PR A pull request resolving a Good First Issue. labels Feb 27, 2026
@stdlib-bot

stdlib-bot commented Feb 27, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report

No coverage information available.

@rautelaKamal
rautelaKamal force-pushed the feat/stats/base/dists/erlang/pdf-c-port branch 5 times, most recently from a9a7359 to 37e1576 Compare February 27, 2026 23:54
@Om-A-osc

Copy link
Copy Markdown
Contributor

@rautelaKamal
CI checks failing for package.json.
Order of keys is important for package.json linting. Maybe have a look at lib/node_modules/@stdlib/stats/base/dists/erlang/mean/package.json and try rearranging.

@Planeshifter Planeshifter added Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels Mar 4, 2026
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Mar 5, 2026
@Planeshifter Planeshifter removed the Needs Review A pull request which needs code review. label Mar 10, 2026
@Planeshifter Planeshifter changed the title feat: add C implementation for stats/base/dists/erlang/pdf feat: add C implementation for stats/base/dists/erlang/pdf Mar 10, 2026
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Mar 10, 2026
@rautelaKamal
rautelaKamal force-pushed the feat/stats/base/dists/erlang/pdf-c-port branch 2 times, most recently from 0a4edf9 to c7e4246 Compare April 5, 2026 18:45
@github-actions github-actions Bot mentioned this pull request Apr 6, 2026
@rautelaKamal
rautelaKamal force-pushed the feat/stats/base/dists/erlang/pdf-c-port branch 3 times, most recently from 260f6d5 to 69a1a9a Compare April 7, 2026 11:52
@rautelaKamal
rautelaKamal force-pushed the feat/stats/base/dists/erlang/pdf-c-port branch from 69a1a9a to 005a3e9 Compare April 12, 2026 07:00
@rautelaKamal
rautelaKamal requested a review from a team April 20, 2026 13:14
@Planeshifter

Copy link
Copy Markdown
Member

/stdlib merge

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Sep 2, 2026
@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Sep 2, 2026
- Add missing dependencies to manifest.json benchmark conf (round, eps)
- Add missing dependency to manifest.json examples conf (round)
- Add @Private annotation to native.js JSDoc block
- Use double literal 1.0 instead of integer 1 for k param in README C example
- Remove spurious blank line before related section in README
The integer literal signals that k is conceptually an integer parameter,
even though the C type is double.

@Planeshifter Planeshifter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's land it! Thanks!

@Planeshifter Planeshifter removed Needs Review A pull request which needs code review. Needs Changes Pull request which needs changes before being merged. labels Sep 2, 2026
@Planeshifter
Planeshifter merged commit 2e86bc4 into stdlib-js:develop Sep 2, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Good First PR A pull request resolving a Good First Issue. Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants