Skip to content
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

Make sure old imports still work #997

Merged
merged 8 commits into from Mar 24, 2015
Merged

Conversation

krischer
Copy link
Member

This is essentially a continuation of #842 as it makes sure that packages relying on imports in ObsPy 0.10 still work with the latest master where we reorganized the structure.

With this PR, none of my codes relying on ObsPy require any changes and warnings are raised appropriately.

All of this can be removed as soon as 0.11 has been released.

It just appears to be necessary...
Appears to work on Python 3.4.
Otherwise it somehow messes with builtins on Python 2.7.
ascii() is a built-in function on Python 2.7. Thus one would need
to use __getattribute__ in attribute remapping helper class
requiring a bunch more logic. This is really not worth it here as
very few people would have directly imported obspy.core.ascii
in the first place.
@krischer
Copy link
Member Author

This fixes some issues with #842 and also makes "attribute access imports" like

import obspy
obspy.xseed.Parser(filename)

work. These worked before and I fear they are fairly common so we have to provide a deprecation path.

@krischer
Copy link
Member Author

Only Python 2.6 CI fails which is expected and fixed in #996

krischer added a commit that referenced this pull request Mar 24, 2015
@krischer krischer merged commit c90465c into obspy:master Mar 24, 2015
@QuLogic QuLogic added this to the 0.11.0 milestone Mar 25, 2015
@megies
Copy link
Member

megies commented Mar 25, 2015

@krischer obspy.core.util used to serve routines from (former submodule) geodetics, these imports are not redirected, so the following doesn't work in master:
from obspy.core.util import gps2DistAzimuth

@krischer
Copy link
Member Author

Good point. I'll add a deprecation path.

@krischer
Copy link
Member Author

Done in #999.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants