diff --git a/flatland/utils/graphics_pil.py b/flatland/utils/graphics_pil.py index 23f8b8790a44be3d4835a1a9594effaa1ee33164..f3a27c59c9701d23084c232cc842f79534e4401c 100644 --- a/flatland/utils/graphics_pil.py +++ b/flatland/utils/graphics_pil.py @@ -358,17 +358,17 @@ class PILSVG(PILGL): "NN SS": "Bahnhof_#d50000_Gleis_vertikal.svg"} # Dict of rail cell images indexed by binary transitions - self.dPilRail = self.loadSVGs(dRailFiles, rotate=True, backgroundImage="Background_rail.svg", + dPilRailFiles = self.loadSVGs(dRailFiles, rotate=True, backgroundImage="Background_rail.svg", whitefilter="Background_white_filter.svg") # Load the target files (which have rails and transitions of their own) # They are indexed by (binTrans, iAgent), ie a tuple of the binary transition and the agent index - dPilRail2 = self.loadSVGs(dTargetFiles, rotate=False, agent_colors=self.ltAgentColors, - backgroundImage="Background_rail.svg", - whitefilter="Background_white_filter.svg") + dPilTargetFiles = self.loadSVGs(dTargetFiles, rotate=False, agent_colors=self.ltAgentColors, + backgroundImage="Background_rail.svg", + whitefilter="Background_white_filter.svg") # Merge them with the regular rails. # https://stackoverflow.com/questions/38987/how-to-merge-two-dictionaries-in-a-single-expression - self.dPilRail = {**self.dPilRail, **dPilRail2} + self.dPilRail = {**dPilRailFiles, **dPilTargetFiles} def loadSVGs(self, dDirFile, rotate=False, agent_colors=False, backgroundImage=None, whitefilter=None): dPil = {} @@ -445,13 +445,13 @@ class PILSVG(PILGL): self.drawImageRC(pilTrack, (row, col)) else: - print("Illegal rail:", row, col, format(binTrans, "#018b")[2:]) + print("Illegal rail:", row, col, format(binTrans, "#018b")[2:], binTrans) else: if (binTrans, iTarget) in self.dPilRail: pilTrack = self.dPilRail[(binTrans, iTarget)] self.drawImageRC(pilTrack, (row, col)) else: - print("Illegal target rail:", row, col, format(binTrans, "#018b")[2:]) + print("Illegal target rail:", row, col, format(binTrans, "#018b")[2:], (binTrans, iTarget)) if isSelected: svgBG = self.pilFromSvgFile("svg", "Selected_Target.svg") diff --git a/tox.ini b/tox.ini index 43a02f37343c8a09ea7825e525992842944d420f..61f8b0a9427b8d09e51540c7e047026c56466693 100644 --- a/tox.ini +++ b/tox.ini @@ -98,7 +98,9 @@ deps = commands = ; run tests from subfolder to ensure that resources are accessed via resources and not via relative paths sh -c 'mkdir -p {envtmpdir}/6f59bc68108c3895b1828abdd04b9a06' + sh -c 'jupyter nbextension install --py --sys-prefix widgetsnbextension' sh -c 'jupyter nbextension enable --py --sys-prefix widgetsnbextension' + sh -c 'jupyter nbextension install --py --sys-prefix jpy_canvas' sh -c 'jupyter nbextension enable --py --sys-prefix jpy_canvas' ; https://stackoverflow.com/questions/35545402/how-to-run-an-ipynb-jupyter-notebook-from-terminal/35545463 sh -c 'ls notebooks/*.ipynb | xargs -n 1 jupyter nbconvert --to python'