8000 Edited doc strings in geomstats/integrator.py by dralston78 · Pull Request #1917 · geomstats/geomstats · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Edited doc strings in geomstats/integrator.py #1917

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

Merged
merged 6 commits into from
Jan 17, 2024

Conversation

dralston78
Copy link
Contributor

Checklist

  • My pull request has a clear and explanatory title.
  • If necessary, my code is vectorized.
  • I added appropriate unit tests.
  • I made sure the code passes all unit tests. (refer to comment below)
  • My PR follows PEP8 guidelines. (refer to comment below)
  • My PR follows geomstats coding style and API.
  • My code is properly documented and I made sure the documentation renders properly. (Link)
  • I linked to issues and PRs that are relevant to this PR.

Description

I clarify some of the doc strings in the integrator.py file. I also fixed a few typos I noticed.

Issue

As I understand, the implemented functions perform numerical integration on first order autonomous systems of ODEs, i.e. integrating an n-dimensional vector field. The functions that are not implemented (leapfrog, symplectic Euler) perform numerical integration on second order autonomous systems of ODEs, i.e. integrating an n-dimensional acceleration field (by creating a system of first order ODEs). I wanted to update the doc strings to clarify these distinctions.

Additional context

This is my first time making a pull request on Github, as well as my first time contributing to geomstats, so my apologies in advance if I misunderstood or missed something!

@luisfpereira luisfpereira self-requested a review December 22, 2023 10:42
Copy link
codecov bot commented Dec 22, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (806764b) 90.29% compared to head (64f5d37) 90.41%.
Report is 14 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1917      +/-   ##
==========================================
+ Coverage   90.29%   90.41%   +0.12%     
==========================================
  Files         143      143              
  Lines       13407    13407              
==========================================
+ Hits        12105    12120      +15     
+ Misses       1302     1287      -15     
Flag Coverage Δ
numpy 89.22% <ø> (+0.12%) ⬆️
pytorch 84.56% <ø> (+0.03%) ⬆️

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.

Copy link
Collaborator
@luisfpereira luisfpereira left a comment

Choose a reason for hiding this comment

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

Thank you for this first contribution @dralston78, and welcome to the community!

In fact, the design of @nguigs is very generic and works to solve systems of first order ODEs (or a first-order ODE) resulting from n-th order ODEs (both autonomous and non-autonomous).
Everything is controlled by the force function.
The first dimension of the state array tells about the order of the original ODE. Right now the docstrings are in fact misleading, as they suggests only two variables can be solved for (position and velocity).

Though this design is generic, we use this code to solve an (autonomous) second-order ODE (see geodesic_equation in geomstats.geometry.connection.Connection). This explains why some docstrings have shape=[2, dim] instead of shape=[n, dim], where n is the order of the original ODE. Returns are also inconsistent (it returns a new_state). This definitely needs to be updated and made consistent. Would you be willing to do so?

I've also seen you've done the leapfrog_step implementation. I would be very glad if you open a PR with it (I can help you out with the tests).

Looking forward to see your future contributions!

@dralston78
Copy link
Contributor Author

Thanks for your feedback @luisfpereira!

I see what you mean, thanks for clarifying that with me. So I think the correct phrasing is that this method solves an $n$-order ODE represented as a first order system.

  • Would you like me to further edit the doc strings to clarify based on this discussion?
  • I see now that the methods that are currently implemented should input/output arrays of shape [..., n, dim], would you like me to update the doc strings to reflect this?
  • I'd be happy to open up a PR for the leapfrog integrator! The leapfrog integrator (without the Yoshida modifications) is specifically for second order ODEs, so in this case I should stipulate that the input shape should be [...,2,dim]? Also, thank you for offering to help on the tests for the leapfrog integrator.
  • Would you like me to close this pull request, and make a new one where I include an implementation of the leapfrog integrator as well as my updates to the doc strings? Or, I could update the doc strings on this PR and then submit a separate PR for my leapfrog integrator?

@luisfpereira
Copy link
Collaborator

I fully agree with your suggestions for the docstrings. So, feel free to do them in this PR.

As you suggest, I think it is better to do the leapfrog in another PR.

Thanks again! I'll be waiting for your contributions.

@dralston78 dralston78 mentioned this pull request Jan 2, 2024
8 tasks
@ninamiolane ninamiolane merged commit 64f5d37 into geomstats:main Jan 17, 2024
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.

3 participants
0