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

a couple of tiny optimizations #19

Merged
merged 2 commits into from
Sep 27, 2024
Merged

Conversation

ExpandingMan
Copy link
Contributor

Hi. I was taking a look at this package as part of #7273 in so doing made these (very tiny) tweaks.

  • Kerr metric parameters that depend on each other can now take them as keyword arguments. When I had done this, I expected these were used many times in the integrals, and would therefore be performance critical and in need of even this extremely tiny performance optimization. As it is they are not used much so the real world performance benefit here is miniscule.
  • In CoordinatePoint(), there was a fallback that was not being hit in any of my tests where it could return a Vector{Float64} instead of a NTuple{4,Float64}. This would cost an allocation unless the compiler elides it, and could cause type instability if used improperly since the inferred return type here was a union.
  • AbstractMaterial was declared twice (causing warnings from the docs tools). The one I did not remove had to stay where it was because of declaration ordering.
  • Fixed a deprecation warning (from using ADAM SGD, now called Adam) in one of the examples.

Pretty trivial stuff, but figured all that would be uncontroversial so I might as well offer to merge my tweaks.

Copy link

codecov bot commented Sep 27, 2024

Codecov Report

Attention: Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.

Project coverage is 82.86%. Comparing base (c81da7c) to head (7ca8bf4).

Files with missing lines Patch % Lines
src/materials/CoordinatePoint.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #19   +/-   ##
=======================================
  Coverage   82.86%   82.86%           
=======================================
  Files          19       19           
  Lines        1640     1640           
=======================================
  Hits         1359     1359           
  Misses        281      281           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dominic-chang dominic-chang merged commit e11caaa into dominic-chang:main Sep 27, 2024
5 checks passed
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.

2 participants