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

Support for numpy 1.14 #2044

Merged
merged 23 commits into from Jan 16, 2018

Conversation

Projects
None yet
3 participants
@krischer
Member

krischer commented Jan 12, 2018

This PR makes the test pass with numpy 1.14 and also mostly gets rid of newly introduced deprecation warnings.

The main issue is that numpy 1.14 changed the way arrays are printed - but they do offer a legacy printing setting so the doctests don't have to be changed. This setup is performed in the main obspy-runtests routine as well as for pytest. Thus some doctests currently cannot be directly executed on numpy 1.14 but I'm not sure if anyone does this and we can fix it as we encounter it.

krischer added some commits Jan 10, 2018

@krischer

This comment has been minimized.

Show comment
Hide comment
@krischer

krischer Jan 12, 2018

Member

We should also really setup a test runner against the dev versions of at least Python and numpy so we have a bit more advance warning for these things. Maybe also for scipy. Does anyone know the best way to do this?

Member

krischer commented Jan 12, 2018

We should also really setup a test runner against the dev versions of at least Python and numpy so we have a bit more advance warning for these things. Maybe also for scipy. Does anyone know the best way to do this?

@Jollyfant

This comment has been minimized.

Show comment
Hide comment
@Jollyfant

Jollyfant Jan 12, 2018

Contributor

We should also really setup a test runner against the dev versions of at least Python and numpy so we have a bit more advance warning for these things. Maybe also for scipy. Does anyone know the best way to do this?

Sounds like something that the docker-testbot would be suitable for if it still works.

Contributor

Jollyfant commented Jan 12, 2018

We should also really setup a test runner against the dev versions of at least Python and numpy so we have a bit more advance warning for these things. Maybe also for scipy. Does anyone know the best way to do this?

Sounds like something that the docker-testbot would be suitable for if it still works.

@megies

This comment has been minimized.

Show comment
Hide comment
@megies

megies Jan 12, 2018

Member

Sounds like something that the docker-testbot would be suitable for if it still works.

;-) @krischer nudge nudge, wink wink

Does anyone know the best way to do this?

But should equally well be possible in Travis, no? I don't see why pip-installing master of numpy etc. shouldn't be possible in one bleeding-edge job in the matrix..?

Member

megies commented Jan 12, 2018

Sounds like something that the docker-testbot would be suitable for if it still works.

;-) @krischer nudge nudge, wink wink

Does anyone know the best way to do this?

But should equally well be possible in Travis, no? I don't see why pip-installing master of numpy etc. shouldn't be possible in one bleeding-edge job in the matrix..?

@@ -22,19 +22,24 @@
>>> cat = obspy.read_events("/path/to/CMTSOLUTION")
>>> print(cat)
1 Event(s) in Catalog:
2003-12-26T01:56:58.129999Z | +29.100, +58.240 | 6.54 mw
2003-12-26T01:56:58.130000Z | +29.100, +58.240 | 6.54 mw

This comment has been minimized.

@megies

megies Jan 12, 2018

Member

that's funny that new numpy makes this strange rounding-error-in-string-representation go away..

@megies

megies Jan 12, 2018

Member

that's funny that new numpy makes this strange rounding-error-in-string-representation go away..

This comment has been minimized.

@krischer

krischer Jan 15, 2018

Member

Yea I think the doctests were actually not executed at all for a while as there was a typo in the pragma of the next doctest. I've only seen a verbose error message when using pytest's doctest runner.

@krischer

krischer Jan 15, 2018

Member

Yea I think the doctests were actually not executed at all for a while as there was a typo in the pragma of the next doctest. I've only seen a verbose error message when using pytest's doctest runner.

@megies megies added this to the 1.1.1 milestone Jan 12, 2018

krischer added some commits Jan 15, 2018

@krischer

This comment has been minimized.

Show comment
Hide comment
@krischer

krischer Jan 15, 2018

Member

Ready for review from my point of view if CI passes.

Member

krischer commented Jan 15, 2018

Ready for review from my point of view if CI passes.

@Jollyfant

This comment has been minimized.

Show comment
Hide comment
@Jollyfant

Jollyfant Jan 16, 2018

Contributor

Not sure why CI is failing on that test. My python 2.7 version seems to be doing OK..

Python 2.7.14

>>> from obspy.core.util.base import create_empty_data_chunk
>>> out = create_empty_data_chunk(3, 'int', 10)
>>> out.dtype
dtype('int64')

Searched through files for np.fromstring but it seems like you got most (all) of them. Still some 1.14 deprecations left upstream..

Contributor

Jollyfant commented Jan 16, 2018

Not sure why CI is failing on that test. My python 2.7 version seems to be doing OK..

Python 2.7.14

>>> from obspy.core.util.base import create_empty_data_chunk
>>> out = create_empty_data_chunk(3, 'int', 10)
>>> out.dtype
dtype('int64')

Searched through files for np.fromstring but it seems like you got most (all) of them. Still some 1.14 deprecations left upstream..

@krischer

This comment has been minimized.

Show comment
Hide comment
@krischer

krischer Jan 16, 2018

Member

Seems to be due to C long being different on Windows: https://stackoverflow.com/a/36279549

I'll adjust the test case to allow both variants.

Member

krischer commented Jan 16, 2018

Seems to be due to C long being different on Windows: https://stackoverflow.com/a/36279549

I'll adjust the test case to allow both variants.

@krischer

This comment has been minimized.

Show comment
Hide comment
@krischer

krischer Jan 16, 2018

Member

CI looks good (OSX builds still have to pass but those take a long time). Someone please review!

Member

krischer commented Jan 16, 2018

CI looks good (OSX builds still have to pass but those take a long time). Someone please review!

@Jollyfant

Comprehensive changes to deal with numpy 1.14 deprecation warnings. Most diffs are a result of np.fromstring -> from_buffer.

@krischer krischer merged commit c9f283e into maintenance_1.1.x Jan 16, 2018

2 of 4 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
docker-testbot docker testbot results not available yet
ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@krischer krischer deleted the support_for_numpy_1.14 branch Jan 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment