-
Notifications
You must be signed in to change notification settings - Fork 8
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
ellipticity_ryden04
has a shape mismatch bug
#328
Labels
bug
Something isn't working
Comments
I see the problem. We probably need to |
Saransh-cpp
added a commit
that referenced
this issue
Oct 7, 2024
Saransh-cpp
added a commit
that referenced
this issue
Oct 7, 2024
Saransh-cpp
added a commit
that referenced
this issue
Oct 7, 2024
Saransh-cpp
added a commit
that referenced
this issue
Oct 9, 2024
Saransh-cpp
added a commit
that referenced
this issue
Oct 9, 2024
Saransh-cpp
added a commit
that referenced
this issue
Oct 9, 2024
gh-328: efficient resampling in ellipticity_ryden04 Co-authored-by: Nicolas Tessore <[email protected]>
Saransh-cpp
added a commit
that referenced
this issue
Oct 9, 2024
gh-328: efficient resampling in ellipticity_ryden04 Co-authored-by: Nicolas Tessore <[email protected]>
Saransh-cpp
added a commit
that referenced
this issue
Oct 14, 2024
gh-328: efficient resampling in ellipticity_ryden04 Co-authored-by: Nicolas Tessore <[email protected]>
Saransh-cpp
added a commit
that referenced
this issue
Oct 14, 2024
The code now generates only the required values while resampling making it more efficient. Refs: #328 Changed: resampling in `ellipticity_ryden04` is more efficient now Co-authored-by: Nicolas Tessore <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the Bug
The implementation right now keeps sampling values until it gets all positive values -
glass/glass/shapes.py
Lines 142 to 151 in 2eb3e8b
Let's say if
mu = [-1.85, -2.85]
,gamma = 0.89
,gamma = 0.222
,sigma_gamma = 0.056
-size
=(2,)
eps.shape
=(2,)
rng.normal(mu, sigma)
will have the shape(2,)
because numpy broadcasts the parameters internallyIf one value in
eps
isbad
(<0
) -bad
=[True, False]
eps[bad].shape
=(1,)
then this will not work -
as a
(2,)
array cannot be resized to(1,)
.This bug was hidden by the
float value is not indexable
error when the broadcasting rule was not present.I am not sure what should be done here. Should we consider using something like truncated normal here?
To Reproduce
Expected Behaviour
No shape mismatch error.
Actual Behaviour
Version In Use
main
Additional Context
The text was updated successfully, but these errors were encountered: