Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add examples sections to docstrings of characteristic curves in sympy.physics._biomechanics #25743

Merged

Conversation

brocksam
Copy link
Contributor

References to other Issues or PRs

Forms part of the CZI biomechanics work program described in #24240. Follows directly on from #25441, #25509, #25516, #25519, and #25530.

Brief description of what is fixed or changed

This PR adds examples sections to the class-level docstrings of the characteristics curves in sympy.physics._biomechanics.curve where they're missing.

I have not added any documentation beyond docstrings, nor have I added the docstrings to the online documentation yet. For the reasoning above this would likely need significant rewriting after any API changes. Documentation will be contributed in a future PR when the whole biomechanics module is moved to sympy/physics/biomechanics.

Other comments

I have specifically left the release notes entry empty. These will be added in the PR that moves the whole biomechanics module to sympy/physics/biomechanics.

Release Notes

NO ENTRY

@sympy-bot
Copy link

Hi, I am the SymPy bot. I'm here to help you write a release notes entry. Please read the guide on how to write release notes.

  • No release notes entry will be added for this pull request.
Click here to see the pull request description that was parsed.
<!-- Your title above should be a short description of what
was changed. Do not include the issue number in the title. -->

#### References to other Issues or PRs
<!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
format, e.g. "Fixes #1234" (see
https://tinyurl.com/auto-closing for more information). Also, please
write a comment on that issue linking back to this pull request once it is
open. -->

Forms part of the CZI biomechanics work program described in https://github.com/sympy/sympy/issues/24240. Follows directly on from #25441, #25509, #25516, #25519, and #25530.

#### Brief description of what is fixed or changed

This PR adds examples sections to the class-level docstrings of the characteristics curves in `sympy.physics._biomechanics.curve` where they're missing.

I have not added any documentation beyond docstrings, nor have I added the docstrings to the online documentation yet. For the reasoning above this would likely need significant rewriting after any API changes. Documentation will be contributed in a future PR when the whole biomechanics module is moved to `sympy/physics/biomechanics`.

#### Other comments

I have specifically left the release notes entry empty. These will be added in the PR that moves the whole biomechanics module to `sympy/physics/biomechanics`.

#### Release Notes

<!-- Write the release notes for this release below between the BEGIN and END
statements. The basic format is a bulleted list with the name of the subpackage
and the release note for this PR. For example:

* solvers
  * Added a new solver for logarithmic equations.

* functions
  * Fixed a bug with log of integers. Formerly, `log(-x)` incorrectly gave `-log(x)`.

* physics.units
  * Corrected a semantical error in the conversion between volt and statvolt which
    reported the volt as being larger than the statvolt.

or if no release note(s) should be included use:

NO ENTRY

See https://github.com/sympy/sympy/wiki/Writing-Release-Notes for more
information on how to write release notes. The bot will check your release
notes automatically to see if they are formatted correctly. -->

<!-- BEGIN RELEASE NOTES -->
NO ENTRY
<!-- END RELEASE NOTES -->

@brocksam brocksam added CZI: Codegen/Biomech Sam Brockie's CZI-funded postdoc work on codegen and biomechanics physics.biomechanics labels Sep 29, 2023
@brocksam brocksam marked this pull request as ready for review September 29, 2023 14:01
@github-actions
Copy link

github-actions bot commented Sep 29, 2023

Benchmark results from GitHub Actions

Lower numbers are good, higher numbers are bad. A ratio less than 1
means a speed up and greater than 1 means a slowdown. Green lines
beginning with + are slowdowns (the PR is slower then master or
master is slower than the previous release). Red lines beginning
with - are speedups.

Significantly changed benchmark results (PR vs master)

Significantly changed benchmark results (master vs previous release)

| Change   | Before [8059df73] <sympy-1.12^0>   | After [191a72d6]    |   Ratio | Benchmark (Parameter)                                                |
|----------|------------------------------------|---------------------|---------|----------------------------------------------------------------------|
| -        | 94.3±5ms                           | 59.3±0.4ms          |    0.63 | integrate.TimeIntegrationRisch02.time_doit_risch(10)                 |
| +        | 22.7±0.9μs                         | 40.9±1μs            |    1.8  | integrate.TimeIntegrationRisch03.time_doit(1)                        |
| -        | 7.20±0.03ms                        | 3.92±0.09ms         |    0.54 | logic.LogicSuite.time_load_file                                      |
| -        | 2.19±0.1ms                         | 670±20μs            |    0.31 | polys.TimePREM_LinearDenseQuadraticGCD.time_op(3, 'sparse')          |
| -        | 10.7±0.4ms                         | 1.99±0.01ms         |    0.19 | polys.TimePREM_LinearDenseQuadraticGCD.time_op(5, 'sparse')          |
| -        | 378±8μs                            | 82.5±0.2μs          |    0.22 | polys.TimePREM_QuadraticNonMonicGCD.time_op(1, 'sparse')             |
| -        | 5.10±0.3ms                         | 368±1μs             |    0.07 | polys.TimePREM_QuadraticNonMonicGCD.time_op(3, 'sparse')             |
| -        | 10.8±0.04ms                        | 1.11±0ms            |    0.1  | polys.TimePREM_QuadraticNonMonicGCD.time_op(5, 'sparse')             |
| -        | 6.51±0.2ms                         | 4.03±0.01ms         |    0.62 | polys.TimeSUBRESULTANTS_LinearDenseQuadraticGCD.time_op(2, 'sparse') |
| -        | 27.7±0.08ms                        | 12.3±0.02ms         |    0.44 | polys.TimeSUBRESULTANTS_LinearDenseQuadraticGCD.time_op(3, 'sparse') |
| -        | 7.24±0.1ms                         | 1.21±0.04ms         |    0.17 | polys.TimeSUBRESULTANTS_QuadraticNonMonicGCD.time_op(1, 'sparse')    |
| -        | 16.9±0.5ms                         | 9.79±0.4ms          |    0.58 | polys.TimeSUBRESULTANTS_QuadraticNonMonicGCD.time_op(2, 'sparse')    |
| -        | 213±0.3ms                          | 71.8±0.2ms          |    0.34 | polys.TimeSUBRESULTANTS_QuadraticNonMonicGCD.time_op(3, 'sparse')    |
| -        | 6.64±0.2ms                         | 547±2μs             |    0.08 | polys.TimeSUBRESULTANTS_SparseGCDHighDegree.time_op(3, 'sparse')     |
| -        | 29.0±1ms                           | 873±3μs             |    0.03 | polys.TimeSUBRESULTANTS_SparseGCDHighDegree.time_op(5, 'sparse')     |
| -        | 626±10μs                           | 201±0.8μs           |    0.32 | polys.TimeSUBRESULTANTS_SparseNonMonicQuadratic.time_op(1, 'sparse') |
| -        | 6.73±0.2ms                         | 204±1μs             |    0.03 | polys.TimeSUBRESULTANTS_SparseNonMonicQuadratic.time_op(3, 'sparse') |
| -        | 17.8±0.7ms                         | 209±2μs             |    0.01 | polys.TimeSUBRESULTANTS_SparseNonMonicQuadratic.time_op(5, 'sparse') |
| -        | 168±10μs                           | 97.4±3μs            |    0.58 | solve.TimeMatrixOperations.time_rref(3, 0)                           |
| -        | 328±10μs                           | 117±7μs             |    0.36 | solve.TimeMatrixOperations.time_rref(4, 0)                           |
| -        | 33.3±1ms                           | 13.8±0.04ms         |    0.42 | solve.TimeSolveLinSys189x49.time_solve_lin_sys                       |

Full benchmark results can be found as artifacts in GitHub Actions
(click on checks at the top of the PR).

@moorepants
Copy link
Member

This looks fine to me.

@moorepants moorepants merged commit b3bc12f into sympy:master Sep 30, 2023
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CZI: Codegen/Biomech Sam Brockie's CZI-funded postdoc work on codegen and biomechanics physics.biomechanics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants