PyBaMM icon indicating copy to clipboard operation
PyBaMM copied to clipboard

pybamm.JaxSolver docstring improvement

Open buddhiwisr opened this issue 1 year ago • 6 comments

Description

pybamm.JaxSolver. Arg method is optional. Link to jax.experimental.odeint and format as code. For method=‘BDF’ option summarise method used (use docstrings in jax_bdf_integrate.py) or simply link to the docstrings in jax_bdf_integrate.py

Fixes # (issue) API Docs - Small fixes suitable for first time contributors - pybamm.JaxSolver

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.

  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Optimization (back-end change that speeds up the code)
  • [ ] Bug fix (non-breaking change which fixes an issue)

Key checklist:

  • [ ] No style issues: $ pre-commit run (or $ nox -s pre-commit) (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)
  • [ ] All tests pass: $ python run-tests.py --all (or $ nox -s tests)
  • [ ] The documentation builds: $ python run-tests.py --doctest (or $ nox -s doctests)

You can run integration tests, unit tests, and doctests together at once, using $ python run-tests.py --quick (or $ nox -s quick).

Further checks:

  • [ ] Code is commented, particularly in hard-to-understand areas
  • [ ] Tests added that prove fix is effective or that feature works

buddhiwisr avatar Apr 11 '24 09:04 buddhiwisr

Hi, @buddhiwisr, a suggestion: could you also link to JAX's intersphinx inventory in the intersphinx_mapping dictionary in docs/conf.py? It will enable external links for the JAX documentation where jax.experimental.odeint is referenced. I think it should be "jax": ("https://jax.readthedocs.io/en/latest", None).

agriyakhetarpal avatar Apr 11 '24 11:04 agriyakhetarpal

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.58%. Comparing base (a553fe6) to head (4b8858c). Report is 3 commits behind head on develop.

:exclamation: Current head 4b8858c differs from pull request most recent head 6a15163

Please upload reports for the commit 6a15163 to get more accurate results.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3994      +/-   ##
===========================================
+ Coverage    99.55%   99.58%   +0.03%     
===========================================
  Files          288      257      -31     
  Lines        21789    21249     -540     
===========================================
- Hits         21692    21161     -531     
+ Misses          97       88       -9     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Apr 11 '24 11:04 codecov[bot]

@buddhiwisr Are you still on it?

arjxn-py avatar Apr 19 '24 10:04 arjxn-py

@arjxn-py I am not working on it anymore, afraid.

buddhiwisr avatar Apr 22 '24 08:04 buddhiwisr

Would you like to pick it up from here, @arjxn-py? Though the hackathon has passed, I think these contributions will still be useful

agriyakhetarpal avatar Apr 22 '24 18:04 agriyakhetarpal

Would you like to pick it up from here, @arjxn-py? Though the hackathon has passed, I think these contributions will still be useful

Sure, I'd be happy to

arjxn-py avatar Apr 22 '24 18:04 arjxn-py

Docs look correct now, but the example notebooks are failing. This passed right before this, so I am going to try just retriggering it

kratman avatar May 31 '24 15:05 kratman

Looks like doctests are failing because of ade96fa

arjxn-py avatar May 31 '24 16:05 arjxn-py

Looks like doctests are failing because of ade96fa

Makes sense. Jax doesn't provide mappings for stable because it doesn't have multi-versioned docs, it just deploys the latest version. Feel free to revert the change

agriyakhetarpal avatar May 31 '24 16:05 agriyakhetarpal

pipx run sphobjinv suggest -t 90 -u https://jax.readthedocs.io/en/latest/ odeint suggests that there is no odeint symbol in the Jax codebase, which is why no clickable link shows up. We'll probably need to update the docstring.

agriyakhetarpal avatar May 31 '24 17:05 agriyakhetarpal

pipx run sphobjinv suggest -t 90 -u https://jax.readthedocs.io/en/latest/ odeint suggests that there is no odeint symbol in the Jax codebase, which is why no clickable link shows up. We'll probably need to update the docstring.

Just giving the function name instead of direct linking should work, not the perfect solution but better than spending much time on something minor

cc: @kratman

arjxn-py avatar May 31 '24 17:05 arjxn-py