-
Notifications
You must be signed in to change notification settings - Fork 40
ENH: Add a mass sampler for the colossus halo mass function #423
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
ENH: Add a mass sampler for the colossus halo mass function #423
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.
Looks good so far. A few suggestions to generalise the function and make it more useful. I would also suggest:
- This file should be in the halos directory and renamed. I suggest
git mv skypy/clusters/sampler.py skypy/halos/_colossus.py
. - Update the docstring and docs/halos/index.rst to ensure the new function appears in the documentation
- Write some unit tests. Perhaps look at the tests for
schechter_lf_magnitude
as that is quite a similar function
If you need help with any of this just ask
Co-authored-by: Richard R <[email protected]>
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.
- Agreed with @rrjbca 's comments.
- Please, check the flake8 style error messages.
- Can you add the equation number in Dispali+16 as a reference?
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.
Would it be reasonable to refer to the objects sampled by this function as "halos" rather than "clusters" throughout the docstrings here? i.e. are "clusters" simply "high-mass halos" in this context?
@sutieng could you please add a "Description" for this pull request? We also need to write some unit tests and integrate the function docstring into the documentation, are you able to do these or would you like one of us to help? |
Co-authored-by: Lucia F. de la Bella <[email protected]>
Co-authored-by: Lucia F. de la Bella <[email protected]>
|
|
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.
Thanks for writing the tests and documentation they look great. Just a few suggestions:
- Move imports and skip unit test to avoid an ImportError if colossus is not installed
- Make sure to install colossus on ReadTheDocs
- Also test the maximum value and the shape of the samples
Co-authored-by: Richard R <[email protected]>
Co-authored-by: Richard R <[email protected]>
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.
Excellent, the tests are running and the documentation is building now. Just a couple of small final changes:
- If you look at the documentation here you can see some parts have not rendered correctly, mostly due to whitespace and units. See suggestions for how to improve this.
- Since this is your first contribution could you add your details to .zenodo.json as a creator
Co-authored-by: Richard R <[email protected]>
Co-authored-by: Richard R <[email protected]>
Co-authored-by: Richard R <[email protected]>
Co-authored-by: Richard R <[email protected]>
e45563f
to
c79ada9
Compare
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.
Looks good to me, thank you for working on this @sutieng
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.
This works perfectly.
Great job @sutieng!
Description
We add a new feature to sample halos from colossus halo mass function.
Checklist