Skip to content
This repository has been archived by the owner on Nov 5, 2020. It is now read-only.

Commit

Permalink
tests: fix KeyError, docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Apr 11, 2019
1 parent 7de3bc0 commit 688ca12
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ of Shape-Out can be found at https://github.com/ZELLMECHANIK-DRESDEN/ShapeOut/tr
.. |PyPI Version| image:: https://img.shields.io/pypi/v/ShapeOut.svg
:target: https://pypi.python.org/pypi/shapeout
.. |Build Status Linux| image:: https://img.shields.io/travis/ZELLMECHANIK-DRESDEN/ShapeOut.svg?label=tests_linux
:target: https://travis-ci.org/ZELLMECHANIK-DRESDEN/shapeout
:target: https://travis-ci.org/ZELLMECHANIK-DRESDEN/ShapeOut
.. |Build Status Win| image:: https://img.shields.io/appveyor/ci/paulmueller/ShapeOut/master.svg?label=build_win
:target: https://ci.appveyor.com/project/paulmueller/ShapeOut
.. |Coverage Status| image:: https://img.shields.io/codecov/c/github/ZELLMECHANIK-DRESDEN/ShapeOut/master.svg
Expand Down
31 changes: 16 additions & 15 deletions shapeout/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,16 +599,14 @@ def SetContourColors(self, colors=None):

def SetParameters(self, newcfg):
"""Update the RT-DC dataset configuration"""
scalex, scaley = self.GetPlotScales()
xax, yax = self.GetPlotAxes()

upcfg = {}
if "filtering" in newcfg:
upcfg["filtering"] = newcfg["filtering"].copy()
if "plotting" in newcfg:
upcfg["plotting"] = newcfg["plotting"].copy()
pl = upcfg["plotting"]
# prevent applying indivual things to all measurements

# prevent applying individual things to all measurements
ignorelist = ["contour color"]
pops = []
for skey in pl:
Expand All @@ -617,17 +615,20 @@ def SetParameters(self, newcfg):
for skey in pops:
pl.pop(skey)

# If the scale changed, recompute kde and contour accuracies.
if "scale x" in pl and pl["scale x"] != scalex:
self.set_config_value("plotting", "scale x", pl["scale x"])
self.reset_plot_accuracies(feature_names=[xax])
pl.pop("kde accuracy {}".format(xax))
pl.pop("contour accuracy {}".format(xax))
if "scale y" in pl and pl["scale y"] != scaley:
self.set_config_value("plotting", "scale y", pl["scale y"])
self.reset_plot_accuracies(feature_names=[yax])
pl.pop("kde accuracy {}".format(yax))
pl.pop("contour accuracy {}".format(yax))
if "plotting" in self[0].config:
scalex, scaley = self.GetPlotScales()
xax, yax = self.GetPlotAxes()
# If the scale changed, recompute kde and contour accuracies.
if "scale x" in pl and pl["scale x"] != scalex:
self.set_config_value("plotting", "scale x", pl["scale x"])
self.reset_plot_accuracies(feature_names=[xax])
pl.pop("kde accuracy {}".format(xax))
pl.pop("contour accuracy {}".format(xax))
if "scale y" in pl and pl["scale y"] != scaley:
self.set_config_value("plotting", "scale y", pl["scale y"])
self.reset_plot_accuracies(feature_names=[yax])
pl.pop("kde accuracy {}".format(yax))
pl.pop("contour accuracy {}".format(yax))
# check for inverted plotting ranges
for feat in dfn.scalar_feature_names:
fmin = feat + " min"
Expand Down

0 comments on commit 688ca12

Please sign in to comment.