-
Notifications
You must be signed in to change notification settings - Fork 10
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
update: inertia benefit from caching + move from pkg_resources to importlib.metada #714
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6870dab
to
5036edf
Compare
5036edf
to
bcce554
Compare
46507cc
to
e72d420
Compare
|
||
import numpy as np | ||
from scipy.stats import cauchy, norm | ||
|
||
import overreact as rx | ||
from overreact import _constants as constants | ||
|
||
def make_hashable(obj): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forget to add the python function annotations here and in the copy_unhashable()
function. I will add this piece and send a new PR asap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just need to add the annotations for the new functions
As stated in the setuptools page, using
pkg_resources
is deprecated in favor ofimportlib
. Therefore, I took the initiative to change it.I noticed that inertia moment can benefit from cache strategy and decided to implement it. Cache requires hashable objects and arrays/numpy arrays aren't. So, I decided to create a prototype of those arrays, make them hashable and introduce cache, while passing the same array to the function and not generating errors.
I also changed the jax callout, as it's already resolved in #713.