-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Deprecate functional cosmology interface #2343
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
Conversation
|
Oh, and one point I forgot to mention above: The idea is that we'd deprecate in 0.4, and then wait and see if we get any complaints (might require some actively legwork on our part to actually ask people instead of just seeing if they raise an issue). |
|
Sounds like a good plan to me. |
|
Sounds good to me too. |
|
Alright, @aconley @nhmc, this is now a PR that deprecates the functional interface. I also tried to update the docs appropriately, but some cases may have slipped through. If we do go ahead with removing them in a future version, some of the tests will have to be re-written, but I figured I'd leave them in so that we're testing until they actually go away. |
|
Thanks for the PR! The code changes look fine, but I think the documentation will need a bigger overhaul. The 'Getting Started' section should show examples using the built-in cosmologies, and the description of get_current()/set_current() can be moved right to the end of the docs. The nice list of functions at the bottom will also go away once the functional interface is removed, so we should work out a way to list the most commonly used methods in a similar way. I'm happy to open a separate PR for the documentation changes if you like. |
|
Yeah, I see your point on the docs, @nhmc . If you could take care of it, that would be great (particularly since you have a good idea). Do you want to open it against my branch here, or would you rather wait for the merge and get it from master? (Also, there was a typo in the "whatsnew" section that I just fixed) |
|
I'll wait for the merge. |
|
👍 |
|
@astrofrog - done. I also realized that the |
|
Looks like there was another conflict just merged... Rebasing again. |
|
👍 |
|
Alright, merging! @nhmc, you can do the doc changes against master at will. |
Deprecate functional cosmology interface
|
Great, thanks! On 8 May 2014 03:32, Erik Tollerud [email protected] wrote:
|
|
Now that it's too late... Should we warn users somewhere to update their astropy.config information? If you have an old one, every time you import astropy.cosmology you will get a warning about the default_cosmology parameter being deprecated. Easy to fix -- if you happen to know about the astropy config system, which I bet many users don't. |
|
@aconley - I think the warning should only appear if you modified the configuration file, so users that are not familiar with the config file will probably not see the warning. Did you edit your config file? |
|
I have no idea, but it's certainly possible. |
|
As @astrofrog says, by design that warning should only appear for people who edited their config file. |
This is triggered by discussion in #2304. There seems to be building consensus to do away with the functional interface in favor of e.g.
WMAP9.luminosity_distance(...)and similar OO-approaches.The rest is my response to the comment in #2304 by @nhmc that begins with "I started a pull request to mirror the methods as functions, and my inner developer protested too much":
I would also be fine (perhaps happy?) with seeing the functional interface go away, but I also see @nhmc's point that this may well annoy users who we never hear from.
A "third-road" option: Deprecate in 0.4, and in the next verson (1.0, an LTS), leave the functions in, but no longer publicly expose them (e.g., just remove
from .funcs import *fromastropy/cosmology/__init__.py). In the deprecation message, be sure to end with "in future releases, the functional interface will not be supported, but will remain inastropy.cosmology.func" or similar. Then people can keep using their old code with just a trivial change fromfrom astropy.cosmologyimport whatevertofrom astropy.cosmology.func import whatever, but they've been warned that they really shouldn't be doing that.