ENH: Add a mass sampler for the colossus halo mass function#423
ENH: Add a mass sampler for the colossus halo mass function#423rrjbca merged 31 commits intoskypyproject:module/halosfrom
Conversation
rrjbca
left a comment
There was a problem hiding this comment.
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_magnitudeas that is quite a similar function
If you need help with any of this just ask
Co-authored-by: Richard R <58728519+rrjbca@users.noreply.github.com>
Lucia-Fonseca
left a comment
There was a problem hiding this comment.
- Agreed with @rrjbca 's comments.
- Please, check the flake8 style error messages.
- Can you add the equation number in Dispali+16 as a reference?
rrjbca
left a comment
There was a problem hiding this comment.
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 <55983939+Lucia-Fonseca@users.noreply.github.com>
Co-authored-by: Lucia F. de la Bella <55983939+Lucia-Fonseca@users.noreply.github.com>
|
|
rrjbca
left a comment
There was a problem hiding this comment.
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 <58728519+rrjbca@users.noreply.github.com>
Co-authored-by: Richard R <58728519+rrjbca@users.noreply.github.com>
rrjbca
left a comment
There was a problem hiding this comment.
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 <58728519+rrjbca@users.noreply.github.com>
Co-authored-by: Richard R <58728519+rrjbca@users.noreply.github.com>
Co-authored-by: Richard R <58728519+rrjbca@users.noreply.github.com>
Co-authored-by: Richard R <58728519+rrjbca@users.noreply.github.com>
e45563f to
c79ada9
Compare
Lucia-Fonseca
left a comment
There was a problem hiding this comment.
This works perfectly.
Great job @sutieng!
Description
We add a new feature to sample halos from colossus halo mass function.
Checklist