Skip to content

Fix/torch review feedback#55

Open
sasso-effe wants to merge 3 commits into
esa:mainfrom
sasso-effe:fix/torch-review-feedback
Open

Fix/torch review feedback#55
sasso-effe wants to merge 3 commits into
esa:mainfrom
sasso-effe:fix/torch-review-feedback

Conversation

@sasso-effe

@sasso-effe sasso-effe commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

This PR fixes problems created by #54.

Fixes:

  • magic attributes broken: from ._core import * doesn't re-export dunder names. Fixed python/polyhedral_gravity/__init__.py to explicitly re-import __version__, __parallelization__, __commit__, and __logging__ from _core. Verified polyhedral_gravity.__version__ etc. work again at the package level.
  • PEP 8 naming: renamed variables in python/polyhedral_gravity/torch.py and test/python/test_gravity_model_torch.py to be PEP 8 compliant, and checked them using ruff. I also changed variables; names that, even if PEP 8 compliant, were too obscure.
  • Docs: added a "PyTorch Interface" section to docs/quickstart/examples_python.rst and docs/api/python.rst, with links to notebooks. Also, I made the PyTorch Interface mention in README.md more concise.
  • Runtime regression check: ran script/measure_runtime.pyon the pre-PR baseline (d71c8f8) vs. this branch:
Configuration Before (pre-PR) After (this branch) Δ
evaluate, 2000×1 pt 4022.1 µs/pt 3998.1 µs/pt -0.6%
evaluate, 1×2000 pts 2773.6 µs/pt 2760.9 µs/pt -0.5%
GravityEvaluable, 2000×1 pt 2767.8 µs/pt 2764.6 µs/pt -0.1%
GravityEvaluable, 1×2000 pts 2777.7 µs/pt 2762.9 µs/pt -0.2%

All differences are within run-to-run noise.

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.

1 participant