Skip to content

numba accelerated special functions#942

Merged
saransh13 merged 4 commits into
masterfrom
special-fcns
Jun 8, 2026
Merged

numba accelerated special functions#942
saransh13 merged 4 commits into
masterfrom
special-fcns

Conversation

@saransh13

Copy link
Copy Markdown
Member

a few of the functions such as exp1 implemented previously were not correct for complex arguments. The latest implementation fixes that.

Also included is a new special function wofzwhich implements the Faddeeva function for complex arguments.

Both these are needed for the new peak shapes to deal with x-ray induced heating experiments.

The PR removes some unused constants in the herd.core.constants and moves all the special function implementation to hexrd.core.fitting.special. The paths in hexrd.powder.wppf.peakfunctions and hexed.core.fitting.peakfunctions have been updated to reflect this move.

Also added tests for these new functions by comparing them to spicy.special.

@saransh13 saransh13 requested a review from psavery June 5, 2026 21:02
@codecov

codecov Bot commented Jun 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.55157% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 72.65%. Comparing base (9d9c4fe) to head (929af0c).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
hexrd/core/fitting/special.py 99.54% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #942      +/-   ##
==========================================
+ Coverage   72.62%   72.65%   +0.03%     
==========================================
  Files         142      143       +1     
  Lines       21940    22083     +143     
==========================================
+ Hits        15933    16045     +112     
- Misses       6007     6038      +31     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

saransh13 and others added 2 commits June 8, 2026 09:57
…ecial functions

Also remove unused constants and include more tests for wofz and exp1 functions.

We also must enable numba JIT coverage instead of disabling
numba JIT now.
The numba flag that uploads coverage info for compiled functions
only works for Python3.11. It should get fixed upstream sometime.
Until then, there's no issue with just using Python3.11 for
code coverage measurements.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
psavery added 2 commits June 8, 2026 10:09
We need to seed the tests for reproducible behavior. In theory,
the tests should always pass, but seeding removes any flakiness.

We also removed an unused import.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
This is completely necessary for exp1exp to work correctly.

This commit also removes the unnecessary threshold changes.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>

@psavery psavery left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Made a few minor fixes. LGTM

@saransh13 saransh13 merged commit a757a57 into master Jun 8, 2026
17 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants