Skip to content

docs: tutorials for parametric args, QMC, VEGAS error and NN training - #247

Merged
gomezzz merged 2 commits into
developfrom
docs/feature-tutorials
Jul 24, 2026
Merged

docs: tutorials for parametric args, QMC, VEGAS error and NN training#247
gomezzz merged 2 commits into
developfrom
docs/feature-tutorials

Conversation

@gomezzz

@gomezzz gomezzz commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

What

Tutorial documentation for the 0.6 features and two long-open doc requests. Adds four sections to docs/source/tutorial.rst:

Notes

Test plan

  • sphinx-build -W -b html docs/source builds clean

Closes #125, #186. Roadmap F4.

…ining

Adds tutorial coverage for the 0.6 features and long-open doc requests:

- "Passing parameters to the integrand": the args= argument as a lambda-free way
  to integrate parametric integrands (#187).
- "Quasi-Monte Carlo with Sobol points": using rng=Sobol(...) with MonteCarlo.
- VEGAS section: return_error=True / VEGASResult and minimum-N guidance.
- "Training a neural network through an integral": a runnable example minimizing
  an integrated loss, with gradients flowing through the quadrature (#125).

Closes #125, #186.
@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown

Overall Coverage

Coverage Report
FileStmtsMissCoverMissing
torchquad
   __init__.py25292%63–64
torchquad/integration
   base_integrator.py49786%28, 71–74, 78, 113, 117, 122
   boole.py30390%53, 72–75
   gaussian.py51394%83, 107, 127
   grid_integrator.py97397%49, 163, 267
   integration_grid.py49492%64–65, 132, 135
   monte_carlo.py93397%77, 99, 228
   rng.py60788%71–74, 93–94, 102
   simpson.py29390%51, 70–73
   utils.py1311192%35–36, 102, 173, 177, 184, 196, 198, 204, 299, 306
   vegas.py161498%100–101, 187, 334
   vegas_map.py103892%247–257
torchquad/utils
   deployment_test.py1926367%53–55, 65–66, 69–70, 78–79, 91–93, 164, 175–176, 180–181, 183–184, 196–199, 211–213, 221, 232–234, 237, 247, 250, 253, 256–259, 267–275, 280–288, 297–306, 316–323
   enable_cuda.py15660%17–22
   set_log_level.py14286%45–46
   set_precision.py34974%35–38, 50–51, 70–72
TOTAL122913889% 

Tests Skipped Failures Errors Time
92 0 💤 0 ❌ 0 🔥 2m 24s ⏱️

- Move the _multi_dim_integrand label back to the Multidimensional/Vectorized
  Integrands heading (the new sections had displaced it).
- Use single backslashes in the inline :math: roles so MathJax renders them.
- Make the Sobol example self-contained with a defined smooth integrand.
@gomezzz

gomezzz commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator Author

Claude: Thanks — great catches, both RST defects fixed in 5a0cfd0:

  1. Label anchor (Important): moved .. _multi_dim_integrand: back down to immediately precede the Multidimensional/Vectorized Integrands heading, so the :ref: from the vectorized-quadrature section resolves to the right anchor again.

  2. Inline math (Important): switched \theta/\int/\,/\sqrt{N} to single backslashes so MathJax renders them (the double-backslash cases elsewhere are inside a .. code:: Python docstring, so those stay).

  3. Undefined integrand: the Sobol example now defines a small smooth_integrand so it's self-contained like the others.

  4. Merge order: acknowledged — this documents Sobol (feat: add Sobol quasi-Monte Carlo sampler #244), return_error (feat: add opt-in VEGAS error reporting (return_error) #245) and args= (feat: forward integrand args via integrate(..., args=...) #246), so it should merge after them. Flagged in the PR description.

sphinx-build -W still builds clean.

@gomezzz
gomezzz merged commit 4cd41e4 into develop Jul 24, 2026
9 checks passed
@gomezzz
gomezzz deleted the docs/feature-tutorials branch July 24, 2026 20:19
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