Skip to content

Conversation

@matthewfeickert
Copy link
Member

@matthewfeickert matthewfeickert commented Oct 3, 2025

Description

  • Remove support for PyTorch from the codebase.
    • This is a breaking change.
    • Remove the PyTorch backend and optimize/opt_pytorch.py.
  • Remove use of PyTorch from the tests.
    • Remove PyTorch lower bounds from tests/constraints.txt.
    • Remove comparison of tensor library backends in tests/test_backend_consistency.py as there is only NumPy and JAX now.
  • Remove all docs and examples that mention or use PyTorch.
  • Remove mentions of PyTorch in all parts of the website and REAMDE except for historical purposes like the release notes, JOSS paper, and notes about early pyhf research in FAQs.
    • For abstract use term "automatic differentiation".
  • Update NumPy backend docstrings to accommodate NumPy v2.0 returns.

Factorizes out parts of PR #2566 and removes additional documentation pieces.

Affected Issues

Please describe the purpose of this pull request in some detail. Reference and link to any relevant issues or pull requests.

Checklist Before Requesting Reviewer

  • Tests are passing
  • "WIP" removed from the title of the pull request
  • Selected an Assignee for the PR to be responsible for the log summary

Before Merging

For the PR Assignees:

  • Summarize commit messages into a comprehensive review of the PR
* Remove support for PyTorch from the codebase.
   - This is a breaking change.
   - Remove the PyTorch backend and optimize/opt_pytorch.py.
* Remove use of PyTorch from the tests.
   - Remove PyTorch lower bounds from tests/constraints.txt.
   - Remove comparison of tensor library backends in
     tests/test_backend_consistency.py as there is only NumPy and JAX now.
* Remove all docs and examples that mention or use PyTorch.
* Remove mentions of PyTorch in all parts of the website and REAMDE except
  for historical purposes like the release notes, JOSS paper, and notes
  about early pyhf research in FAQs.
   - For abstract use term "automatic differentiation".
* Update NumPy backend docstrings to accommodate NumPy v2.0 returns.

Co-authored-by: Giordon Stark <[email protected]>

@matthewfeickert matthewfeickert self-assigned this Oct 3, 2025
@matthewfeickert matthewfeickert added the feat/enhancement New feature or request label Oct 3, 2025
@matthewfeickert matthewfeickert added the Breaking Results in a known breaking change label Oct 3, 2025
@github-project-automation github-project-automation bot moved this to In progress in pyhf v0.8.0 Oct 3, 2025
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@matthewfeickert matthewfeickert added docs Documentation related API Changes the public API Docker Involving Docker images or builds python Pull requests that update Python code labels Oct 3, 2025
@codecov
Copy link

codecov bot commented Oct 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.23%. Comparing base (7eda55b) to head (d9c025d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2611      +/-   ##
==========================================
- Coverage   98.25%   98.23%   -0.03%     
==========================================
  Files          67       65       -2     
  Lines        4360     4193     -167     
  Branches      600      591       -9     
==========================================
- Hits         4284     4119     -165     
+ Misses         46       45       -1     
+ Partials       30       29       -1     
Flag Coverage Δ
contrib 97.97% <100.00%> (+0.08%) ⬆️
doctest 98.09% <100.00%> (-0.03%) ⬇️
unittests-3.10 96.27% <100.00%> (+0.01%) ⬆️
unittests-3.11 96.27% <100.00%> (+0.01%) ⬆️
unittests-3.12 96.27% <100.00%> (?)
unittests-3.8 96.27% <100.00%> (+0.01%) ⬆️
unittests-3.9 96.32% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

@matthewfeickert matthewfeickert marked this pull request as ready for review October 3, 2025 07:28
@matthewfeickert matthewfeickert requested a review from kratsg October 3, 2025 07:29
>>> a = pyhf.tensorlib.astensor([[10, 7, 4], [3, 2, 1]])
>>> pyhf.tensorlib.percentile(a, 50)
3.5
np.float64(3.5)
Copy link
Member Author

Choose a reason for hiding this comment

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

Note that docstrings for NumPy got updated as NumPy can now be NumPy v2.0 and so the docstest changed.

@matthewfeickert matthewfeickert force-pushed the feat/drop-pytorch-backend branch from 78744ce to d9c025d Compare October 6, 2025 23:09
@kratsg kratsg merged commit c30e337 into scikit-hep:main Oct 7, 2025
21 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in pyhf v0.8.0 Oct 7, 2025
@matthewfeickert matthewfeickert deleted the feat/drop-pytorch-backend branch October 7, 2025 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Changes the public API Breaking Results in a known breaking change Docker Involving Docker images or builds docs Documentation related feat/enhancement New feature or request python Pull requests that update Python code

Projects

Status: Done

2 participants