Skip to content

Conversation

praneethratna
Copy link
Contributor

@praneethratna praneethratna commented Dec 19, 2021

References to other Issues or PRs

Brief description of what is fixed or changed

This is a partial fix for #20769 and also part of this PR is taken from unmerged PR #20853 and made changes in code and tests as requested by @danilobellini

Other comments

Release Notes

  • algebras
    • Added hamilton's operators in Quaternion class in quaternion.py.

@sympy-bot
Copy link

sympy-bot commented Dec 19, 2021

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

Your release notes are in good order.

Here is what the release notes will look like:

This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.11.

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. -->


#### Brief description of what is fixed or changed
This is a partial fix for #20769 and also part of this PR is taken from unmerged PR #20853 and made changes in code and tests as requested by @danilobellini

#### Other comments


#### 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.

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 -->
* algebras
   * Added hamilton's operators in Quaternion class in quaternion.py.
<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

@praneethratna
Copy link
Contributor Author

ping @oscarbenjamin

@github-actions
Copy link

github-actions bot commented Dec 19, 2021

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)

       before           after         ratio
     [907895ac]       [d7bddf4f]
-         248±3ms          155±9ms     0.62  large_exprs.TimeLargeExpressionOperations.time_subs
-         264±5μs          133±8μs     0.50  matrices.TimeMatrixExpression.time_MatMul
-      17.2±0.7ms       9.66±0.7ms     0.56  matrices.TimeMatrixExpression.time_MatMul_doit
-      4.89±0.01s         394±30ms     0.08  polygon.PolygonArbitraryPoint.time_bench01
+      4.29±0.1ms       6.85±0.6ms     1.60  solve.TimeMatrixOperations.time_det(4, 2)
+      4.02±0.1ms       6.67±0.1ms     1.66  solve.TimeMatrixOperations.time_det_bareiss(4, 2)
+        45.6±2ms         81.0±4ms     1.78  solve.TimeMatrixSolvePyDySlow.time_linsolve(1)
+        46.4±3ms         82.5±6ms     1.78  solve.TimeMatrixSolvePyDySlow.time_solve(1)

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

@oscarbenjamin
Copy link
Collaborator

CC @danilobellini

Copy link

@danilobellini danilobellini left a comment

Choose a reason for hiding this comment

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

The new tests are great! The explicit equations like "norm*axis", and some changes in docstrings made everything more clear!

There are some small documentation writing issues, as detailed, this time I can see no problem in the Python code. I'm not being systematic with checking stuff like "ending dots" in the text, or capitalizing True/False/None (perhaps these should be always inside double backticks for proper rendering, where a ``True`` would be rendered like this: True).

This will solve 11 tasks (out of 14) from the original issue. The missing tasks are:

  • Add Quaternion.versor() as a new name to Quaternion.normalize()
  • Add Hamilton operators to the Quaternion documentation
  • Add the deprecated terminology "norm" and "tensor" to the documentation

@praneethratna
Copy link
Contributor Author

praneethratna commented Dec 25, 2021

  • Add Quaternion.versor() as a new name to Quaternion.normalize()

Sorry but I'm ain't understanding this , should a new method named versor be added in quaternion class or a line like versor = normalize should be added in the code ? but where can i include the documentation of versor method?

  • Add Hamilton operators to the Quaternion documentation
  • Add the deprecated terminology "norm" and "tensor" to the documentation

I feel these documentation changes be made in a separate PR after this is merged or maybe done with PR itself?

@praneethratna
Copy link
Contributor Author

ping @danilobellini

@danilobellini
Copy link

I feel these documentation changes be made in a separate PR after this is merged or maybe done with PR itself?

Don't worry with those 3 other tasks, I was just stating the scope of these changes in order to avoid closing all the tasks from the original issue once this gets merged.

Copy link

@danilobellini danilobellini left a comment

Choose a reason for hiding this comment

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

It's great! Sorry for being late to review! There's a single missed mod(q) notation that should be \mathbf{T}(q) instead, and some other minor details.

@praneethratna
Copy link
Contributor Author

praneethratna commented Jan 31, 2022

ping @danilobellini , I've made the changes as you have mentioned above, is this PR now good to be merged once all the tests are passing?

Copy link

@danilobellini danilobellini left a comment

Choose a reason for hiding this comment

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

It's great! I don't know why you rebased it, but I'm assuming that it was to "move" onto a more recent commit, so I didn't review all the steps in history (I'm assuming they're all there with the proper authoring metadata). Looks good to me, and this implements 11 out of the 14 tasks from the original issue!

@oscarbenjamin
Copy link
Collaborator

I edited the OP to say that this is a partial fix so that the issue is not closed when this is merged.

Thanks @praneethratna and @mayankray2020 and also @danilobellini for this work. I'll merge this now.

It would be good to update the original issue to say what is left to be done.

@oscarbenjamin oscarbenjamin merged commit 2439bd6 into sympy:master Feb 2, 2022
@praneethratna praneethratna deleted the quaternion branch February 2, 2022 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants