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

getting ppsd out of a pickle #2457

Merged
merged 6 commits into from Sep 17, 2019

Conversation

@d-chambers
Copy link
Member

commented Sep 15, 2019

What does this PR do?

This PR changes how the PPSD class handles saved npz files that require pickle. From the changes made in #2424 allow_pickle was used by default, which is not safe. This PR makes the user opt-in to the use of pickle by adding allow_pickle keywords to PPSD.load_npz and PPSD.add_npz. It also catches the ValueError issued by numpy when pickle is required and re-issues a (hopefully) helpful message telling the user they must set allow_pickle to True.

Why was it initiated? Any relevant Issues?

#2424 and #2409

PR Checklist

  • Correct base branch selected? master for new features, maintenance_... for bug fixes
  • This PR is not directly related to an existing issue (which has no PR yet).
  • If the PR is making changes to documentation, docs pages can be built automatically.
    Just remove the space in the following string after the + sign: "+ DOCS"
  • If any network modules should be tested for the PR, add them as a comma separated list
    (e.g. clients.fdsn,clients.arclink) after the colon in the following magic string: "+TESTS:"
    (you can also add "ALL" to just simply run all tests across all modules)
  • All tests still pass.
  • Any new features or fixed regressions are be covered via new tests.
  • Any new or changed features have are fully documented.
  • Significant changes have been added to CHANGELOG.txt .
  • First time contributors have added your name to CONTRIBUTORS.txt .
@d-chambers d-chambers added the .signal label Sep 15, 2019
@d-chambers d-chambers added this to the 1.2.0 milestone Sep 15, 2019
Copy link
Member

left a comment

Some typos.

obspy/signal/spectral_estimation.py Outdated Show resolved Hide resolved
obspy/signal/spectral_estimation.py Outdated Show resolved Hide resolved
obspy/signal/spectral_estimation.py Outdated Show resolved Hide resolved
obspy/signal/spectral_estimation.py Outdated Show resolved Hide resolved
obspy/signal/tests/test_spectral_estimation.py Outdated Show resolved Hide resolved
@megies

This comment has been minimized.

Copy link
Member

commented Sep 16, 2019

Thanks @d-chambers, should we bump the PPSD internal version number due to the pickle workaround? Might not be 100% needed, since the pickle kwarg is kinda controlling this behavior but might not hurt either..? Dunno.. your call

@megies
megies approved these changes Sep 16, 2019
Copy link
Member

left a comment

Looking good mostly, your call whether bumping internal version makes sense and whether to use that when showing warnings etc during loading. Feel free to merge after final touches @d-chambers

Copy link
Member

left a comment

Actually, there's some CI fails that need checking: http://tests.obspy.org/105018/#2

http://tests.obspy.org/?pr=2457

@megies megies added this to In Progress in Release 1.2.0 Sep 16, 2019
@d-chambers

This comment has been minimized.

Copy link
Member Author

commented Sep 17, 2019

@megies I bumped the version and fixed the plotting test issue. Let's see what the CI does...

@megies
megies approved these changes Sep 17, 2019
Copy link
Member

left a comment

Looks good, fails unrelated. Thanks!

@megies megies merged commit d91592b into master Sep 17, 2019
1 of 3 checks passed
1 of 3 checks passed
continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/appveyor/pr AppVeyor build failed
Details
ci/circleci Your tests passed on CircleCI!
Details
@megies

This comment has been minimized.

Copy link
Member

commented Sep 17, 2019

I only now got the pun in the PR title by the way.. slow! 🐌

@megies megies deleted the ppsd_allow_pickle branch Sep 17, 2019
@megies megies moved this from In Progress to Done in Release 1.2.0 Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
3 participants
You can’t perform that action at this time.