-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Added dV_comoving function and tests. #2103
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
Added dV_comoving function and tests. #2103
Conversation
|
I'm not married to the function name and happy to change it, but, that function name already exists. The existing How about |
|
Yes, good addition -- I kept thinking somebody should add that. I like |
astropy/cosmology/core.py
Outdated
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.
Maybe we should be doing this, but currently we haven't been giving citations for all formulae inline. The Hogg paper is cited at the top (although not in a docstring...). It might not be crazy to remove the inline citation but convert the comment about the Hogg paper at the top of the file to a sub-package level comment.
|
I like |
Changed relevant doc_strings and tests as well. As discussed at astropy#2103.
|
After the discussion here I've:
I just want to say that the developer documentation for this project is excellent and helped make this process much simpler than it could otherwise have been. |
|
Hooray for the developer docs! 🎊 Actually I believe there are efforts underway to reorganize them to be even better, so it's good someone thinks they're useful even as is. |
|
Looks good to me. Should definitely be added to 0.4. |
|
@jbwhit -- sorry, forgot to check this: you should add a line to the CHANGES.rst file under 0.4.0 -- New Features -- astropy.cosmology |
astropy/cosmology/core.py
Outdated
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.
The return value should divided by the steradian unit here, so:
return dh * (zp1 ** 2 * da ** 2) / self.efunc(z) / u.sr
|
Looks good! I added some inline comments you might want to look at. You should also add the new function in funcs.py to the |
|
Changes:
|
|
If I'm reading the details of the Travis CI build correctly, it fails for only one setup: I suspect it was adding the u.sr to the return... but I think I'm out of my depth here as to why it's only failing for this one setup, or what to do about it. Any suggestions or comments? |
|
The only thing different between the passing and failing builds apparently is the: Flag. |
|
That is also (as far as I can tell), the only build that is both parallel and has OPTIONAL_DEPS=true. Not that that seems very useful, but there may be more going on than ASCII. But Travis really does just fail sometimes for no reason. |
|
It looks like a random failure, so I've restarted it. |
In response to comment here: astropy#2103 (comment)
|
I'm sorry, but I'm not sure what's breaking during the build or how to fix it. I can revert the code to where it doesn't use the "u.sr" at all, and I suspect it would build. Of course, then the units wouldn't be correct. Any suggestions on what I can be working on? |
|
It looks like it's crashing somewhere in time -- I can't see any way this could have anything to do with you. Maybe you branched from a broken version of master or something... I might try rebasing off of the current master, see if that magically fixes it. |
After random failures during build, and my failing to rebase properly, I have re-committed the code that was used in this previous pull request: astropy#2103
|
Can this be restarted to see if it passes the build? The discussion in #2233 said that this should be fixed here. If it still doesn't build, I'll try to rebase the code and resubmit here. |
The dV_comoving function allows for an easy method of integrating over a comoving volume. It is useful when, for example, integrating a function that depends on another function whose sensitivity changes with redshift.
Changed relevant doc_strings and tests as well. As discussed at astropy#2103.
Changed docstring and added the change to the CHANGES.rst file. Also added the function to the __all__ list at the top of funcs.
In response to comment here: astropy#2103 (comment)
The _get_current() is depreciated so changed to the new: _default_cosmology.get()
|
Hooray, after rebasing and recommitting I think everything works and is ready to merge! |
|
Thanks @jbwhit! Merging :) |
…ddition Added dV_comoving function and tests.
Changed relevant doc_strings and tests as well. As discussed at astropy#2103.
In response to comment here: astropy#2103 (comment)
Changed relevant doc_strings and tests as well. As discussed at astropy/astropy#2103.
In response to comment here: astropy/astropy#2103 (comment)
Following discussion here:
http://mail.scipy.org/pipermail/astropy/2013-December/002965.html
and @nhmc mentioned it might be useful to have this function included.
The dV_comoving function allows for an easy method of integrating
over a comoving volume. It is useful when, for example,
integrating a function that depends on another function whose
sensitivity changes with redshift.
I've also included tests and a method in the funcs library as well.