-
Notifications
You must be signed in to change notification settings - Fork 38
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
BUG: m_min and m_max astropy quantity error #503
Comments
@katie-davidson I cannot reproduce the error you are seeing without a minimum working example; please provide a simple config file or python script. However, I note that as currently implemented the function |
Sorry @rrjbca I have added a config file now. As far as I can work out I pass them in as floats but by the time they get to the |
TLDR: replace the relevant lines in your config with:
In YAML 1.1
Tagging @Lucia-Fonseca and @ntessore for input. |
Thanks, I added the dots in the config file and removed the .value from the code and it all works now. Does this count as closed or should I leave it open for the further actions mentioned above? |
Describe the bug
When working in the skypy\halos module, the maximum and minimum mass (variable names m_min and m_max) to draw from the halo mass function are converted to astropy quantities before any further functions are called.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
m_min and m_max should be floats not <class 'astropy.units.quantity.Quantity'> and hence not produce the error. This can therefore be temporarily fixed by using "m_min.value" instead.
Desktop (please complete the following information):
Additional context
Adding debug print statements in "colossus_mf" but before "colossus_mf_redshift" is called (first line of function) shows that it is already an Astropy quantity but nothing could be found in the pipeline files that would do this. The only decorator is for the sky area (@units.quantity_input(sky_area=units.sr)) and m_min/m_max are passed as floats in the config file.
halo_test.yml.txt
The text was updated successfully, but these errors were encountered: