Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Test toolkits rebase#2135

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
500 commits
Select commitHold shift + click to select a range
ea03180
Add ipython_inline_figure.html
mdboomMay 23, 2013
8e90fee
Fix the onload callback as found by @andreabedini in #2310
mdboomAug 26, 2013
d8f6ec9
Use IPython.display.display_html as suggested by @andreabedini
mdboomAug 26, 2013
177b197
Don't use tornado template class directly, as suggested by @andreabedini
mdboomAug 26, 2013
bdb85ec
PEP8 fixes
mdboomAug 26, 2013
88f8b8f
Merge pull request #2306 from lpsinger/mollweide_latitude_grid
WeatherGodAug 27, 2013
48f594c
changed colorbar outline from a Line2D object to a Polygon object
tacaswellAug 27, 2013
dd1f6b0
tweaked zorder to match line2D's default zorder
tacaswellAug 27, 2013
7ebee32
Add a comment explaning __import__ syntax.
Aug 27, 2013
161c02b
Merge pull request #2319 from tacaswell/draw_idle_fix
mdboomAug 28, 2013
75e8e5f
added entry to api_changes for type of `colorbar.ColorbarBase.outline`
tacaswellAug 28, 2013
b44bdfe
Merge pull request #2301 from mdboom/travis-artifacts
mdboomAug 28, 2013
bdfdbdf
Merge pull request #2054 from mdboom/ipython-webagg-integration
mdboomAug 28, 2013
89e53aa
Merge pull request #2352 from tacaswell/colorbar_outline_fix
dmcdougallAug 29, 2013
8b7382d
Make pylab inline figures work again
mdboomAug 30, 2013
84f0460
Merge pull request #2358 from mdboom/fix-inline-figures
mdboomAug 30, 2013
c556204
Merge remote-tracking branch 'upstream/v1.3.x'
mdboomAug 30, 2013
26ed35b
Better axis limits when using shared axes and empty subplots
Aug 30, 2013
a091f6d
Merge pull request #2357 from ChrisBeaumont/empty-shared
dmcdougallAug 31, 2013
300b393
[bug correction] triinterpolate is independant of triangulation numbe…
GBilloteySep 1, 2013
271db8c
Merge pull request #2363 from GBillotey/new_test_triinterpolate
ianthomas23Sep 3, 2013
d0a0100
Merge pull request #2335 from andreabedini/patch-5
mdboomSep 3, 2013
f4adec7
Use six instead of 2to3
mdboomAug 14, 2013
791c4d5
Add document with tips for writing portable 2-3 code
mdboomSep 3, 2013
dddc262
Fix compatibility with older version of PIL
mdboomSep 3, 2013
705fae3
Merge pull request #2226 from mdboom/six
mdboomSep 3, 2013
9fbd29f
Only turn on interactive mode if in a console.
mdboomAug 8, 2013
519645c
Typos
felipeacsiSep 4, 2013
b9d1b54
Merge pull request #2374 from felipeacsi/master
mdboomSep 4, 2013
ff227d3
Merge remote-tracking branch 'upstream/v1.3.x'
mdboomSep 4, 2013
5013dc8
replaced `col2hex` which seems to have gotten lost in a bad merge
tacaswellSep 5, 2013
c5abc50
pep8 fixes
tacaswellSep 5, 2013
b5add85
pep8 fixes
tacaswellSep 5, 2013
7ddc5ee
converted import-critical PyQt calls to new style so that it will
tacaswellSep 5, 2013
bf3b1b4
pep8 fixes
tacaswellSep 5, 2013
bcdf5f5
second pass at catching the rest of the old-style signal/slot
tacaswellSep 5, 2013
1c649f5
change from mdboom
tacaswellSep 5, 2013
1a3e9f1
Remove spurious print statement
mdboomSep 5, 2013
b7f7ddd
Merge remote-tracking branch 'upstream/v1.3.x'
mdboomSep 6, 2013
df3d882
use new-style for PyQt as well as PySide
tacaswellSep 7, 2013
10f2b0e
added 'savefig.transparent' rcParams
tacaswellSep 7, 2013
99c8278
minor tweak to `pyplot.savefig` to ensure that if `transparent=True`
tacaswellSep 7, 2013
146892e
comment tweak
tacaswellSep 7, 2013
6c3cd20
Added entry to whats_new.rst
tacaswellSep 7, 2013
8a3a4df
Merge pull request #2390 from tacaswell/transparent_rcparams
dmcdougallSep 8, 2013
0b3b410
use six.move for cStringIO
davidovitchSep 8, 2013
04b8314
Merge pull request #2393 from davidovitch/use_stringIO_from_six
mdboomSep 9, 2013
6c1f14f
TypeError occurs when self.button=None in MouseEvents
Sep 9, 2013
1023886
support tight_bbox for pgf output, fixes #2342
pwuertzSep 7, 2013
f37df88
Merge pull request #2391 from pwuertz/fix_2342
pwuertzSep 10, 2013
9310a2b
Merge pull request #2399 from dimkal/master
pelsonSep 10, 2013
d7f3190
Fix ps backend from 2to3->six changes
mdboomSep 10, 2013
d604681
backend_pgf: fix str/unicode comparison errors
pwuertzSep 10, 2013
71691d3
Merge pull request #2404 from mdboom/ps-backend-encoding
mdboomSep 10, 2013
7bc19c5
Fix syntax error on Python 3.2.
mdboomSep 10, 2013
842fbf8
BUG: Fixed github stats retrieval
Sep 10, 2013
d583f3b
Merge pull request #2407 from pwuertz/fix_unicode_comp
pwuertzSep 10, 2013
a65151b
removed un-needed legacy code (_AnnotationBase._get_xy_legacy)
tacaswellAug 27, 2013
3363b12
re factored `_AnnoationBase` to push keeping track of there the
tacaswellAug 27, 2013
38b9385
pep8 fixes
tacaswellSep 6, 2013
f6e3edc
added test for Annotation.set_position
tacaswellSep 7, 2013
da6c6b5
Merge pull request #2351 from tacaswell/annotation_refactor
mdboomSep 10, 2013
b4c9ced
Merge pull request #2382 from tacaswell/new_stlye_qt
mdboomSep 10, 2013
ddb4b45
Merge remote-tracking branch 'upstream/v1.3.x'
mdboomSep 11, 2013
132a463
Adding possibility to remove invisible lines and patches from relim
farizaSep 12, 2013
71ff2fb
Fix merge
mdboomSep 12, 2013
a17c5bb
Merge remote-tracking branch 'upstream/v1.3.x'
mdboomSep 13, 2013
7a9f234
Fix some six.moves
mdboomSep 13, 2013
28eec9e
DOC: Add axes_api to documentation after the refactoring
Sep 16, 2013
94bdfd6
Adding test test_relim_visible_only
farizaSep 16, 2013
e665789
DOC: changed axes_api from automodule to autoclass
Sep 16, 2013
78ae9d7
Bug: alpha parameter was ignored when fill color is #000000
Sep 12, 2013
d3dba08
BUG: Fixed object type missmatch in SymLogNorm
Sep 17, 2013
5c6f2a1
Merge pull request #2242 from endolith/patch-3
mdboomSep 17, 2013
750e2f4
Merge pull request #2417 from fariza/remlim-with-invisible-option
pelsonSep 18, 2013
803e538
Merge pull request #2427 from jarondl/add-Axes-api-doc
pelsonSep 18, 2013
62cad79
Alternative to #2431: Decode the filenames returned from fontconfig in
mdboomSep 18, 2013
cdf87de
Just skip a file if its filename can not be decoded
mdboomSep 18, 2013
f1ae145
Merge remote-tracking branch 'upstream/v1.3.x'
mdboomSep 18, 2013
8d88c7d
Be more explicit when catching the exception when doing the pyparsing
mdboomSep 18, 2013
895ed32
Fix MacOSX backend post-six transition
mdboomSep 18, 2013
8e52475
Use the --format argument to fontconfig so we don't have to parse
mdboomSep 18, 2013
71e41e9
Fix failing mathtext tests.
mdboomSep 18, 2013
d042e90
Use six.string_types instead of basestring.
alefnulaSep 19, 2013
7af7678
Merge pull request #2439 from alefnula/remove-basestring
mdboomSep 19, 2013
88c49a9
Merge remote-tracking branch 'upstream/v1.3.x'
mdboomSep 19, 2013
2f6b117
Merge pull request #2435 from mdboom/pyparsing-monkeypatch-check-for-…
pelsonSep 20, 2013
912579a
Temporarily disable coding standards test
mdboomSep 20, 2013
7c486f4
Merge branch 'v1.3.x'
pelsonSep 20, 2013
01ce972
Better error handling with font can not be loaded by macosx backend
mdboomSep 23, 2013
46b5123
Merge remote-tracking branch 'upstream/v1.3.x'
mdboomSep 23, 2013
5f60446
add option to delete empty PdfPages when closed
megiesSep 23, 2013
dffaf4e
clearer comments in test
megiesSep 24, 2013
cb805ad
refactor docstrings of PdfPages
megiesSep 24, 2013
e2a49e0
Skip CGContextSelectFont if font lookup fails
mdboomSep 24, 2013
b060f7c
Merge pull request #2433 from mdboom/unicode-font-filenames
mdboomSep 24, 2013
eb0ec8a
pep8 clean up (file seems to have been created with indentation of 3
tacaswellSep 24, 2013
fad3bc1
a bit more pep8 work
tacaswellSep 24, 2013
5fca7e3
The `from __future__ ...` line added in #2226 is three charachters
tacaswellSep 25, 2013
799cbe6
Merge pull request #2460 from tacaswell/fix_future_import
pelsonSep 26, 2013
febea19
Fix ConnectionPatch to correctly account coordsB argument. Closes #2377.
leejjoonSep 26, 2013
518afd8
Merge remote-tracking branch 'upstream/v1.3.x'
mdboomSep 27, 2013
653ecf7
Updated the position of a few of the text examples because they were …
mattklein999Sep 29, 2013
a1559eb
Updated examples to be easier to read when drawn to a small picture.
mattklein999Sep 29, 2013
c34a3aa
Merge pull request #2476 from mattklein999/text3dDemoPositionUpdate
WeatherGodSep 30, 2013
d75d39f
Use dstack instead of zip to combine offset arrays in scatter.
mdboomJul 22, 2013
b8726d0
Store transformations on collections as an Nx3x3 array, rather than a…
mdboomJul 22, 2013
d7c08fb
Refactor WebAgg so it's easier to embed in other applications and run
mdboomSep 13, 2013
68ca1a5
Make figure larger. Print address to console.
mdboomSep 13, 2013
6389d14
Let the Javascript side control when to fetch new frames. draw_idle
mdboomSep 13, 2013
379b14c
Merge pull request #2156 from mdboom/scatter-speed
mdboomSep 30, 2013
9f72865
Merge pull request #2458 from tacaswell/mpl_inset_locater_pep8
mdboomSep 30, 2013
2b614cf
Merge pull request #2453 from megies/pdfpages_keep_empty
mdboomSep 30, 2013
9804c5d
Merge pull request #2420 from mdboom/webagg-factor
mdboomSep 30, 2013
6a5aa01
Merge pull request #2415 from kshramt/kshramt/fix_fill_opacity
mdboomSep 30, 2013
0b604b3
Catch stderr as well as stdout
Oct 1, 2013
0b84819
Merge pull request #2441 from torcolvin/master
mdboomOct 1, 2013
926bddc
Merge pull request #2406 from cpelley/fixed_stats-retrieve
pelsonOct 1, 2013
1129d9c
ENH better error message when wrong cmap name.
NelleVOct 2, 2013
de8a919
make pep8 test routine reusable for other projects
megiesOct 2, 2013
af6c607
correct current skipping of pep8 tests for nose test discovery
megiesOct 2, 2013
d1cb803
Merge pull request #2486 from megies/reusable_pep8_testroutine
pelsonOct 3, 2013
1dc0404
Re-enabled PEP8 test, closing #2443.
pelsonOct 3, 2013
c35781e
Update scatter_demo.py
Oct 4, 2013
fc6a048
Merge pull request #2494 from ugurthemaster/master
dmcdougallOct 4, 2013
0672a2d
fixed an enconding bug when checking for gs version
vlsdOct 4, 2013
b2830aa
Merge remote-tracking branch 'upstream/v1.3.x'
mdboomOct 4, 2013
170de26
Fix build
mdboomOct 4, 2013
29d5bb8
Adding a missing 'b' back into two 'bbox_' kwargs
the-real-droopOct 5, 2013
6fc76e3
Merge pull request #2496 from androomerrill/inset_locator_fix
mdboomOct 5, 2013
e42803c
add failing test: savefig(StringIO(), format="ps")
megiesOct 6, 2013
92766bb
Merge pull request #2428 from cpelley/symlognorm_fix
pelsonOct 8, 2013
ba49375
Merge remote-tracking branch 'upstream/v1.3.x'
pelsonOct 8, 2013
26498aa
Merge pull request #2491 from pelson/pep8_re-enable
NelleVOct 9, 2013
65ce30e
Merge pull request #2485 from NelleV/error_message
pelsonOct 10, 2013
1fd7a33
add new ps backend test file in `__init__.py`
megiesOct 11, 2013
63f13c8
Fix writing to all manner of StringIO-like objects in PS backend.
mdboomOct 11, 2013
ee3de9e
pep8
tacaswellOct 12, 2013
f7bf34e
- pep8
tacaswellOct 12, 2013
a3d2992
Merge pull request #2512 from mdboom/ps_StringIO
mdboomOct 14, 2013
0788c28
Fix encoding issues when font name contains non-ascii characters
mdboomOct 16, 2013
76bd505
Minor doc fixes
branliu0Oct 16, 2013
f9c62d2
Merge pull request #2523 from mdboom/ps-unicode-error
mdboomOct 18, 2013
8162371
Merge pull request #2526 from thenovices/fix-typo
pelsonOct 18, 2013
0d288b3
Move external libraries to 'extern' directory
ianthomas23Oct 19, 2013
dab724a
Merge pull request #2531 from ianthomas23/extern_directory
mdboomOct 21, 2013
bd71341
cast argv to unicode before testing
minrkOct 22, 2013
a39639f
Merge pull request #2534 from minrk/unicode-argv
mdboomOct 22, 2013
a234f93
Fix for compiling ttconv in extern directory
ianthomas23Oct 22, 2013
0161fe2
Merge pull request #2535 from ianthomas23/extern_directory_fix
ianthomas23Oct 22, 2013
109187e
add more spectrum functions and add new spectrum types to specgram in…
toddrjenOct 6, 2013
de1c8ae
add mlab tests for new spectrum types, window and detrend functions, …
toddrjenOct 6, 2013
6cf4d84
add CleanupTestCase, a unittest.TestCase with cleanup
toddrjenOct 10, 2013
809411c
refactor mlab spectrum, window, and detrend functions to improve modu…
toddrjenOct 6, 2013
212e24b
implement tests for refactored mlab spectrum, windowing, and detrend …
toddrjenOct 9, 2013
7fc90de
add more spectral plots and add new spectrum types to specgram in _axes
toddrjenOct 6, 2013
c89ce08
add tests for new spectrum types in _axes
toddrjenOct 6, 2013
9499793
add demo for new spectral plot types
toddrjenOct 6, 2013
4d9cc28
added information regarding new spectrum functions to CHANGELOG, what…
toddrjenOct 6, 2013
d5f9876
Merge pull request #2522 from toddrjen/spectrum
mdboomOct 24, 2013
f9fddaf
fix removed api change regarding spectral functions
toddrjenOct 25, 2013
3333ba0
Fixed typo in TimerWx
joferkingtonOct 28, 2013
f5d995b
Merge branch 'master' of github.com:matplotlib/matplotlib
pelsonOct 28, 2013
3d31865
Various path effects related updates.
pelsonSep 24, 2013
ecbbd81
Merge pull request #2514 from tacaswell/mpl_toolkit_pep8
pelsonOct 28, 2013
aefa98c
Merge pull request #2547 from toddrjen/apideltafix
WeatherGodOct 28, 2013
cbfca1e
removing items from the call to six.iteritems
farizaOct 28, 2013
4cd888e
Merge pull request #2553 from fariza/gtk_save_iteritems
pelsonOct 29, 2013
cd71bbc
Merge branch 'master' of github.com:matplotlib/matplotlib
pelsonOct 29, 2013
06d0144
Merge remote branch 'upstream/v1.3.x'
pelsonOct 29, 2013
09d5f5f
Major refactor of path effects hook. Makes life much simpler!
pelsonSep 24, 2013
48f2648
fixed an enconding bug when checking for gs version
vlsdOct 4, 2013
9b00f1c
Merge remote-tracking branch 'upstream/v1.3.x'
mdboomOct 30, 2013
e7d6cc8
Merge pull request #2550 from joferkington/fix-wx-singleshot-timer
mdboomOct 30, 2013
310a889
fix typo
escOct 30, 2013
11075eb
simplify creation of transparent legend
escOct 30, 2013
71cc71a
Merge pull request #2562 from esc/minor_recipe_tweaks
WeatherGodOct 31, 2013
fb2e612
add titleweight rc param
adrnNov 4, 2013
d794b09
actually read the new rcParam
adrnNov 4, 2013
573046c
reference rcparam in docstring for pyplot interface
adrnNov 4, 2013
1e55a3c
fix pep8 errors.
adrnNov 4, 2013
84e0063
Merge pull request #2462 from pelson/path_effects_update
mdboomNov 4, 2013
06a2696
adds rcParam `axes.formatter.useoffset`
tacaswellSep 10, 2013
0f09038
MultiCursor: make events connected during __init__ accessible (for la…
megiesNov 5, 2013
0425fbf
fix operation order error in _spectral_helper and implement more test…
toddrjenNov 2, 2013
234781a
fix initialization of AnnotationBbox where None values of xybox and b…
leejjoonNov 7, 2013
3b5364d
Merge pull request #2495 from vlsd/py3gscheck
tacaswellNov 8, 2013
7897abd
Merge pull request #2401 from tacaswell/useoffset_rcparam
efiringNov 8, 2013
5a7a00b
make event connector ids private
megiesNov 8, 2013
e539016
Fix typo in legend documentation
magnunorNov 8, 2013
fc9820d
Merge pull request #2584 from magnunor/fix_legend_typo
mdboomNov 8, 2013
072f702
Add capstyle and joinstyle properties to Patch.
pwuertzOct 24, 2013
3b9ef36
Use projecting caps for axes spines (fixes #2542).
pwuertzOct 24, 2013
ed67aa3
Add test for new spine capstyle, workaround PDF rendering errors in l…
pwuertzNov 8, 2013
c91589c
Merge pull request #2544 from pwuertz/fix_2542
mdboomNov 8, 2013
2e66361
Make backend_pgf more flexible when saving to file-handles or streams.
pwuertzNov 8, 2013
ff304e4
Merge pull request #2571 from toddrjen/specfix
tacaswellNov 11, 2013
55782cd
user guide restructure
Oct 21, 2013
01f3168
Merge pull request #2554 from marqh/userGuideShape
mdboomNov 11, 2013
a247d93
Merge pull request #2587 from pwuertz/fix_1625
pwuertzNov 12, 2013
cee4ba9
Fix infinite recursion in units with ndarray subclasses.
dopplershiftNov 13, 2013
21fd7c0
Merge pull request #2591 from dopplershift/fix-infinite-recursion
mdboomNov 14, 2013
40c263b
Merge pull request #2579 from megies/mutlicursor_store_connectors
tacaswellNov 14, 2013
c424d17
Merge pull request #2574 from adrn/titleweight
dmcdougallNov 14, 2013
9290f57
Merge pull request #2582 from leejjoon/fix_annotation_bbox_default
tacaswellNov 14, 2013
643c74b
Add easy style sheet selection.
tonysyuJul 21, 2013
3270aa4
Add rc_params_in_file to return partially-filled RcParams
tonysyuJul 21, 2013
d83a03c
Rename style files to `*.style`
tonysyuJul 21, 2013
c8cc486
Allow style.use to open URLs
tonysyuJul 21, 2013
455b54c
Remove pyplot import
tonysyuJul 21, 2013
7769b29
Add style context manager and tests
tonysyuJul 23, 2013
3914089
Change style extension to *.mplstyle
tonysyuJul 23, 2013
c3fae2e
Got a little crazy with the whitespace
tonysyuJul 23, 2013
a3de231
Add style package and data to setupext.py
tonysyuJul 25, 2013
d56f73e
Move test so that it actually runs.
tonysyuSep 19, 2013
ec6ce6b
Use explicit string check
tonysyuSep 19, 2013
5fdc037
Hide rc_params_in_file from parent namespace
tonysyuSep 19, 2013
0c7437c
Remove usage of import *
tonysyuSep 19, 2013
200d2e0
Clarify docstring
tonysyuSep 19, 2013
7392ce6
added `matplotlib.style` to pyplot import list
tacaswellSep 27, 2013
ea63c99
fix url rc specification
adrnSep 17, 2013
eaa23ee
fixed divergent naming scheme
tacaswellSep 27, 2013
5f80ca1
pep8 clean up
tacaswellSep 27, 2013
f5ecf5e
Add docs for style package
tonysyuSep 29, 2013
a8ef5bf
Import style package for easy use.
tonysyuSep 29, 2013
dc291e0
Use style package from pyplot
tonysyuSep 29, 2013
c5b5bb4
Fix test
tonysyuSep 29, 2013
7ac26ee
pep8
tacaswellOct 18, 2013
46a725b
Clear style settings between tests
mdboomSep 30, 2013
d372a35
Add note that style sheets are experimental.
tonysyuOct 19, 2013
e714c77
added python3 emulation code + six + fixed up print calls
tacaswellOct 27, 2013
512b77c
removed unneeded print statements
tacaswellOct 31, 2013
17282c8
Attempt to fix python 3 test errors on Travis CI
tonysyuNov 13, 2013
a6142fc
Remove test from list to test Travis CI failure.
tonysyuNov 14, 2013
19e7bed
Remove test file to test Travis CI failure
tonysyuNov 14, 2013
c604498
Revert commits used to test Travis CI test failures.
tonysyuNov 14, 2013
0b098e2
Fix import for python 3
tonysyuNov 17, 2013
7e2bffb
Use iteritems from `six` module
tonysyuNov 17, 2013
1d87f34
Add compatibility layer for Python 3's urlopen
tonysyuNov 17, 2013
79f83c9
Fix _fix_url on Python 2.6
mdboomNov 18, 2013
509da9b
Fix for when pyparsing isn't present
mdboomNov 18, 2013
a2dc36f
Minor fix
mdboomNov 18, 2013
eb12e9a
Merge remote-tracking branch 'upstream/v1.3.x'
mdboomNov 18, 2013
246c348
Merge pull request #6 from mdboom/style/py26-fixes
tonysyuNov 18, 2013
0e7daad
Merge pull request #2236 from tonysyu/stylesheets
mdboomNov 18, 2013
1429035
Add infrastructure for testing of mpl toolkits and a single test to d…
jenshnielsenOct 18, 2012
5f3ea92
add more tests to axesgrid1
jenshnielsenNov 10, 2012
94ecece
Refresh test images.
jenshnielsenJun 18, 2013
65da4eb
Add toolkit tests to setup and install them.
jenshnielsenJun 18, 2013
373a5e3
Change comment
jenshnielsenJun 18, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
fix operation order error in _spectral_helper and implement more test…
…s to catch these sorts of problems in the future
  • Loading branch information
@toddrjen
toddrjen committedNov 5, 2013
commit0425fbf74c2040f808546b87d1d0ccbb4882226c
4 changes: 2 additions & 2 deletionslib/matplotlib/mlab.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -730,10 +730,10 @@ def _spectral_helper(x, y=None, NFFT=None, Fs=None, detrend_func=None,
numFreqs = pad_to//2 + 1
scaling_factor = 2.

result = stride_windows(x, NFFT, noverlap)
result = stride_windows(x, NFFT, noverlap, axis=0)
result = detrend(result, detrend_func, axis=0)
result, windowVals = apply_window(result, window, axis=0,
return_window=True)
result = detrend(result, detrend_func, axis=0)
result = np.fft.fft(result, n=pad_to, axis=0)[:numFreqs, :]
freqs = np.fft.fftfreq(pad_to, 1/Fs)[:numFreqs]

Expand Down
328 changes: 328 additions & 0 deletionslib/matplotlib/tests/test_mlab.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -259,6 +259,24 @@ def test_stride_windows_n13_noverlapn3_axis1(self):
assert_equal((6, 13), y.shape)
assert_true(self.get_base(y) is x)

def test_stride_windows_n32_noverlap0_axis0_unflatten(self):
n = 32
x = np.arange(n)[np.newaxis]
x1 = np.tile(x, (21, 1))
x2 = x1.flatten()
y = mlab.stride_windows(x2, n)
assert_equal(y.shape, x1.T.shape)
assert_array_equal(y, x1.T)

def test_stride_windows_n32_noverlap0_axis1_unflatten(self):
n = 32
x = np.arange(n)[np.newaxis]
x1 = np.tile(x, (21, 1))
x2 = x1.flatten()
y = mlab.stride_windows(x2, n, axis=1)
assert_equal(y.shape, x1.shape)
assert_array_equal(y, x1)


class csv_testcase(CleanupTestCase):
def setUp(self):
Expand DownExpand Up@@ -503,6 +521,51 @@ def test_apply_window_stride_windows_hanning_2D_n13_noverlapn3_axis0(self):
assert_not_equal(x.shape, y.shape)
assert_allclose(yt, y, atol=1e-06)

def test_apply_window_hanning_2D_stack_axis1(self):
ydata = np.arange(32)
ydata1 = ydata+5
ydata2 = ydata+3.3
ycontrol1 = mlab.apply_window(ydata1, mlab.window_hanning)
ycontrol2 = mlab.window_hanning(ydata2)
ydata = np.vstack([ydata1, ydata2])
ycontrol = np.vstack([ycontrol1, ycontrol2])
ydata = np.tile(ydata, (20, 1))
ycontrol = np.tile(ycontrol, (20, 1))
result = mlab.apply_window(ydata, mlab.window_hanning, axis=1,
return_window=False)
assert_allclose(ycontrol, result, atol=1e-08)

def test_apply_window_hanning_2D_stack_windows_axis1(self):
ydata = np.arange(32)
ydata1 = ydata+5
ydata2 = ydata+3.3
ycontrol1 = mlab.apply_window(ydata1, mlab.window_hanning)
ycontrol2 = mlab.window_hanning(ydata2)
ydata = np.vstack([ydata1, ydata2])
ycontrol = np.vstack([ycontrol1, ycontrol2])
ydata = np.tile(ydata, (20, 1))
ycontrol = np.tile(ycontrol, (20, 1))
result = mlab.apply_window(ydata, mlab.window_hanning, axis=1,
return_window=False)
assert_allclose(ycontrol, result, atol=1e-08)

def test_apply_window_hanning_2D_stack_windows_axis1_unflatten(self):
n = 32
ydata = np.arange(n)
ydata1 = ydata+5
ydata2 = ydata+3.3
ycontrol1 = mlab.apply_window(ydata1, mlab.window_hanning)
ycontrol2 = mlab.window_hanning(ydata2)
ydata = np.vstack([ydata1, ydata2])
ycontrol = np.vstack([ycontrol1, ycontrol2])
ydata = np.tile(ydata, (20, 1))
ycontrol = np.tile(ycontrol, (20, 1))
ydata = ydata.flatten()
ydata1 = mlab.stride_windows(ydata, 32, noverlap=0, axis=0)
result = mlab.apply_window(ydata1, mlab.window_hanning, axis=0,
return_window=False)
assert_allclose(ycontrol.T, result, atol=1e-08)


class detrend_testcase(CleanupTestCase):
def setUp(self):
Expand DownExpand Up@@ -1460,6 +1523,243 @@ def test_psd(self):
assert_equal(spec.shape, freqs.shape)
self.check_freqs(spec, freqs, fsp, self.fstims)

def test_psd_detrend_mean_func_offset(self):
if self.NFFT_density is None:
return
freqs = self.freqs_density
ydata = np.zeros(self.NFFT_density)
ydata1 = ydata+5
ydata2 = ydata+3.3
ydata = np.vstack([ydata1, ydata2])
ydata = np.tile(ydata, (20, 1))
ydatab = ydata.T.flatten()
ydata = ydata.flatten()
ycontrol = np.zeros_like(ydata)
spec_g, fsp_g = mlab.psd(x=ydata,
NFFT=self.NFFT_density,
Fs=self.Fs,
noverlap=0,
sides=self.sides,
detrend=mlab.detrend_mean)
spec_b, fsp_b = mlab.psd(x=ydatab,
NFFT=self.NFFT_density,
Fs=self.Fs,
noverlap=0,
sides=self.sides,
detrend=mlab.detrend_mean)
spec_c, fsp_c = mlab.psd(x=ycontrol,
NFFT=self.NFFT_density,
Fs=self.Fs,
noverlap=0,
sides=self.sides)
assert_array_equal(fsp_g, fsp_c)
assert_array_equal(fsp_b, fsp_c)
assert_allclose(spec_g, spec_c, atol=1e-08)
# these should not be almost equal
assert_raises(AssertionError,
assert_allclose, spec_b, spec_c, atol=1e-08)

def test_psd_detrend_mean_str_offset(self):
if self.NFFT_density is None:
return
freqs = self.freqs_density
ydata = np.zeros(self.NFFT_density)
ydata1 = ydata+5
ydata2 = ydata+3.3
ydata = np.vstack([ydata1, ydata2])
ydata = np.tile(ydata, (20, 1))
ydatab = ydata.T.flatten()
ydata = ydata.flatten()
ycontrol = np.zeros_like(ydata)
spec_g, fsp_g = mlab.psd(x=ydata,
NFFT=self.NFFT_density,
Fs=self.Fs,
noverlap=0,
sides=self.sides,
detrend='mean')
spec_b, fsp_b = mlab.psd(x=ydatab,
NFFT=self.NFFT_density,
Fs=self.Fs,
noverlap=0,
sides=self.sides,
detrend='mean')
spec_c, fsp_c = mlab.psd(x=ycontrol,
NFFT=self.NFFT_density,
Fs=self.Fs,
noverlap=0,
sides=self.sides)
assert_array_equal(fsp_g, fsp_c)
assert_array_equal(fsp_b, fsp_c)
assert_allclose(spec_g, spec_c, atol=1e-08)
# these should not be almost equal
assert_raises(AssertionError,
assert_allclose, spec_b, spec_c, atol=1e-08)

def test_psd_detrend_linear_func_trend(self):
if self.NFFT_density is None:
return
freqs = self.freqs_density
ydata = np.arange(self.NFFT_density)
ydata1 = ydata+5
ydata2 = ydata+3.3
ydata = np.vstack([ydata1, ydata2])
ydata = np.tile(ydata, (20, 1))
ydatab = ydata.T.flatten()
ydata = ydata.flatten()
ycontrol = np.zeros_like(ydata)
spec_g, fsp_g = mlab.psd(x=ydata,
NFFT=self.NFFT_density,
Fs=self.Fs,
noverlap=0,
sides=self.sides,
detrend=mlab.detrend_linear)
spec_b, fsp_b = mlab.psd(x=ydatab,
NFFT=self.NFFT_density,
Fs=self.Fs,
noverlap=0,
sides=self.sides,
detrend=mlab.detrend_linear)
spec_c, fsp_c = mlab.psd(x=ycontrol,
NFFT=self.NFFT_density,
Fs=self.Fs,
noverlap=0,
sides=self.sides)
assert_array_equal(fsp_g, fsp_c)
assert_array_equal(fsp_b, fsp_c)
assert_allclose(spec_g, spec_c, atol=1e-08)
# these should not be almost equal
assert_raises(AssertionError,
assert_allclose, spec_b, spec_c, atol=1e-08)

def test_psd_detrend_linear_str_trend(self):
if self.NFFT_density is None:
return
freqs = self.freqs_density
ydata = np.arange(self.NFFT_density)
ydata1 = ydata+5
ydata2 = ydata+3.3
ydata = np.vstack([ydata1, ydata2])
ydata = np.tile(ydata, (20, 1))
ydatab = ydata.T.flatten()
ydata = ydata.flatten()
ycontrol = np.zeros_like(ydata)
spec_g, fsp_g = mlab.psd(x=ydata,
NFFT=self.NFFT_density,
Fs=self.Fs,
noverlap=0,
sides=self.sides,
detrend='linear')
spec_b, fsp_b = mlab.psd(x=ydatab,
NFFT=self.NFFT_density,
Fs=self.Fs,
noverlap=0,
sides=self.sides,
detrend='linear')
spec_c, fsp_c = mlab.psd(x=ycontrol,
NFFT=self.NFFT_density,
Fs=self.Fs,
noverlap=0,
sides=self.sides)
assert_array_equal(fsp_g, fsp_c)
assert_array_equal(fsp_b, fsp_c)
assert_allclose(spec_g, spec_c, atol=1e-08)
# these should not be almost equal
assert_raises(AssertionError,
assert_allclose, spec_b, spec_c, atol=1e-08)

def test_psd_window_hanning(self):
if self.NFFT_density is None:
return
freqs = self.freqs_density
ydata = np.arange(self.NFFT_density)
ydata1 = ydata+5
ydata2 = ydata+3.3
ycontrol1, windowVals = mlab.apply_window(ydata1,
mlab.window_hanning,
return_window=True)
ycontrol2 = mlab.window_hanning(ydata2)
ydata = np.vstack([ydata1, ydata2])
ycontrol = np.vstack([ycontrol1, ycontrol2])
ydata = np.tile(ydata, (20, 1))
ycontrol = np.tile(ycontrol, (20, 1))
ydatab = ydata.T.flatten()
ydataf = ydata.flatten()
ycontrol = ycontrol.flatten()
spec_g, fsp_g = mlab.psd(x=ydataf,
NFFT=self.NFFT_density,
Fs=self.Fs,
noverlap=0,
sides=self.sides,
window=mlab.window_hanning)
spec_b, fsp_b = mlab.psd(x=ydatab,
NFFT=self.NFFT_density,
Fs=self.Fs,
noverlap=0,
sides=self.sides,
window=mlab.window_hanning)
spec_c, fsp_c = mlab.psd(x=ycontrol,
NFFT=self.NFFT_density,
Fs=self.Fs,
noverlap=0,
sides=self.sides,
window=mlab.window_none)
spec_c *= len(ycontrol1)/(np.abs(windowVals)**2).sum()
assert_array_equal(fsp_g, fsp_c)
assert_array_equal(fsp_b, fsp_c)
assert_allclose(spec_g, spec_c, atol=1e-08)
# these should not be almost equal
assert_raises(AssertionError,
assert_allclose, spec_b, spec_c, atol=1e-08)

def test_psd_window_hanning_detrend_linear(self):
if self.NFFT_density is None:
return
freqs = self.freqs_density
ydata = np.arange(self.NFFT_density)
ycontrol = np.zeros(self.NFFT_density)
ydata1 = ydata+5
ydata2 = ydata+3.3
ycontrol1 = ycontrol
ycontrol2 = ycontrol
ycontrol1, windowVals = mlab.apply_window(ycontrol1,
mlab.window_hanning,
return_window=True)
ycontrol2 = mlab.window_hanning(ycontrol2)
ydata = np.vstack([ydata1, ydata2])
ycontrol = np.vstack([ycontrol1, ycontrol2])
ydata = np.tile(ydata, (20, 1))
ycontrol = np.tile(ycontrol, (20, 1))
ydatab = ydata.T.flatten()
ydataf = ydata.flatten()
ycontrol = ycontrol.flatten()
spec_g, fsp_g = mlab.psd(x=ydataf,
NFFT=self.NFFT_density,
Fs=self.Fs,
noverlap=0,
sides=self.sides,
detrend=mlab.detrend_linear,
window=mlab.window_hanning)
spec_b, fsp_b = mlab.psd(x=ydatab,
NFFT=self.NFFT_density,
Fs=self.Fs,
noverlap=0,
sides=self.sides,
detrend=mlab.detrend_linear,
window=mlab.window_hanning)
spec_c, fsp_c = mlab.psd(x=ycontrol,
NFFT=self.NFFT_density,
Fs=self.Fs,
noverlap=0,
sides=self.sides,
window=mlab.window_none)
spec_c *= len(ycontrol1)/(np.abs(windowVals)**2).sum()
assert_array_equal(fsp_g, fsp_c)
assert_array_equal(fsp_b, fsp_c)
assert_allclose(spec_g, spec_c, atol=1e-08)
# these should not be almost equal
assert_raises(AssertionError,
assert_allclose, spec_b, spec_c, atol=1e-08)

def test_psd_windowarray(self):
freqs = self.freqs_density
spec, fsp = mlab.psd(x=self.y,
Expand All@@ -1472,6 +1772,34 @@ def test_psd_windowarray(self):
assert_allclose(fsp, freqs, atol=1e-06)
assert_equal(spec.shape, freqs.shape)

def test_psd_windowarray_scale_by_freq(self):
freqs = self.freqs_density
spec, fsp = mlab.psd(x=self.y,
NFFT=self.NFFT_density,
Fs=self.Fs,
noverlap=self.nover_density,
pad_to=self.pad_to_density,
sides=self.sides)
spec_s, fsp_s = mlab.psd(x=self.y,
NFFT=self.NFFT_density,
Fs=self.Fs,
noverlap=self.nover_density,
pad_to=self.pad_to_density,
sides=self.sides,
scale_by_freq=True)
spec_n, fsp_n = mlab.psd(x=self.y,
NFFT=self.NFFT_density,
Fs=self.Fs,
noverlap=self.nover_density,
pad_to=self.pad_to_density,
sides=self.sides,
scale_by_freq=False)

assert_array_equal(fsp, fsp_s)
assert_array_equal(fsp, fsp_n)
assert_array_equal(spec, spec_s)
assert_allclose(spec_s, spec_n/self.Fs, atol=1e-08)

def test_complex_spectrum(self):
freqs = self.freqs_spectrum
spec, fsp = mlab.complex_spectrum(x=self.y,
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp