Skip to content

Commit

Permalink
Refactor semantic mapping operations (#2090)
Browse files Browse the repository at this point in the history
* Prototype of rugplot that passes original tests

* Update test style

* Implement idea for less-verbose interaction with Plotter classes

* Explore an idea about how to abstract hue mapping

* Shush Flake8

* Define semantics with tuples, not lists, to make immutable

* Define semantic mappings with some complex higher-order magic

* Move some of the hue mapping logic

* Continued refactoring of variable assignment and hue mapping

* Refactor lineplot and get tests to pass

* Get most RelationalPlotter tests passing

* Fix error introduced during refactoring

* Move hue mapping tests from test_relational to test_core

* Avoid treating string palette arg as signaling categorical

* Set map_type to include datetime, add note about missing implementation

* Change semantic inheritance to be restrictive rather than expansive

* Consider boolean data categorical at Plotter level

* Sort out where utils/core funcs should go

* Strip nose out of the utils tests

* Move new decorator to where it belongs and add a test

* Clean up a few leftovers from utils reorg

* Add more HueMapping tests

* Make core module private

* Make objects in core non-private

* Add initial version of SizeMapping object

* Messy first pass at replacing parse_size with SizeMapping

* Fix size mapping to match current behavior, defer decoupling from plotter

* Add test to capture relplot bug

* Fix relplot numeric hues

* Move all hue/size lookup logic into corresponding Mapping objects

* Finalize refactoring of size mapping

* Add prototype of StyleMapping

* Integrate StyleMapping into relational plots

* Get relational tests to pass

* Move StyleMapping tests to core and excise parse_style from relational

* Point rugplot at old code for now

* Add some more basic tests

* Treat units as a normal semantic

* Rename assign_variables method

* Address some TODOs about style/organization/defaults

* Address more small TODOs and flesh out docs

* LogNorm now fails with non-positive data (as it arguably should)

* Handle units in relplot (fixes #2080)

* Ignore false-alarm warning from numpy on string/number comparison

* Catch a few pieces of residual cruft

* Ignore a separate dubious numpy warning

* Improve test coverage

* Avoid error in relational user guide page
  • Loading branch information
mwaskom authored May 23, 2020
1 parent 2d3502b commit 0c5c0cc
Show file tree
Hide file tree
Showing 16 changed files with 2,601 additions and 1,806 deletions.
3 changes: 2 additions & 1 deletion doc/tutorial/relational.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,8 @@
"sns.relplot(x=\"time\", y=\"firing_rate\",\n",
" hue=\"coherence\", style=\"choice\",\n",
" hue_norm=LogNorm(),\n",
" kind=\"line\", data=dots);"
" kind=\"line\",\n",
" data=dots.query(\"coherence > 0\"));"
]
},
{
Expand Down
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ filterwarnings =
; Warnings raised from within pytest itself
ignore:Using or importing the ABCs:DeprecationWarning
ignore:the imp module is deprecated in favour of importlib
junit_family=xunit1
Loading

0 comments on commit 0c5c0cc

Please sign in to comment.