From 1e9ee2f836eaab44887b0e4be7f21a25c106e526 Mon Sep 17 00:00:00 2001 From: mahdis-z Date: Mon, 17 Feb 2020 14:48:20 -0500 Subject: [PATCH 1/7] fixing the bug of update_ methods --- packages/python/plotly/plotly/graph_objs/_figure.py | 6 +++--- packages/python/plotly/plotly/graph_objs/_figurewidget.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/python/plotly/plotly/graph_objs/_figure.py b/packages/python/plotly/plotly/graph_objs/_figure.py index e0077b12507..d907b8634c9 100644 --- a/packages/python/plotly/plotly/graph_objs/_figure.py +++ b/packages/python/plotly/plotly/graph_objs/_figure.py @@ -17450,7 +17450,7 @@ def for_each_annotation( return self def update_annotations( - self, patch, selector=None, row=None, col=None, secondary_y=None, **kwargs + self, patch=None, selector=None, row=None, col=None, secondary_y=None, **kwargs ): """ Perform a property update operation on all annotations that satisfy the @@ -17949,7 +17949,7 @@ def for_each_layout_image( return self def update_layout_images( - self, patch, selector=None, row=None, col=None, secondary_y=None, **kwargs + self, patch=None, selector=None, row=None, col=None, secondary_y=None, **kwargs ): """ Perform a property update operation on all images that satisfy the @@ -18221,7 +18221,7 @@ def for_each_shape(self, fn, selector=None, row=None, col=None, secondary_y=None return self def update_shapes( - self, patch, selector=None, row=None, col=None, secondary_y=None, **kwargs + self, patch=None, selector=None, row=None, col=None, secondary_y=None, **kwargs ): """ Perform a property update operation on all shapes that satisfy the diff --git a/packages/python/plotly/plotly/graph_objs/_figurewidget.py b/packages/python/plotly/plotly/graph_objs/_figurewidget.py index 89042ba6645..bb8d57a1d68 100644 --- a/packages/python/plotly/plotly/graph_objs/_figurewidget.py +++ b/packages/python/plotly/plotly/graph_objs/_figurewidget.py @@ -17450,7 +17450,7 @@ def for_each_annotation( return self def update_annotations( - self, patch, selector=None, row=None, col=None, secondary_y=None, **kwargs + self, patch=None, selector=None, row=None, col=None, secondary_y=None, **kwargs ): """ Perform a property update operation on all annotations that satisfy the @@ -17949,7 +17949,7 @@ def for_each_layout_image( return self def update_layout_images( - self, patch, selector=None, row=None, col=None, secondary_y=None, **kwargs + self, patch=None, selector=None, row=None, col=None, secondary_y=None, **kwargs ): """ Perform a property update operation on all images that satisfy the @@ -18221,7 +18221,7 @@ def for_each_shape(self, fn, selector=None, row=None, col=None, secondary_y=None return self def update_shapes( - self, patch, selector=None, row=None, col=None, secondary_y=None, **kwargs + self, patch=None, selector=None, row=None, col=None, secondary_y=None, **kwargs ): """ Perform a property update operation on all shapes that satisfy the From 89b8169555a5a839c2315b5e741b750162899852 Mon Sep 17 00:00:00 2001 From: mahdis-z Date: Tue, 18 Feb 2020 15:49:46 -0500 Subject: [PATCH 2/7] tests added --- .../test_update_objects/test_update_annotations.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py b/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py index 26e589603db..4085d983a17 100644 --- a/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py +++ b/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py @@ -219,6 +219,9 @@ def test_update_annotations(self): "annotations", [4], patch=dict(showarrow=False), secondary_y=True ) + def test_annotation_attributes(self): + self.fig.update_annotations(text='hi') + def test_update_shapes(self): ( self.fig.add_shape(opacity=0.1, fillcolor="red") @@ -236,6 +239,9 @@ def test_update_shapes(self): self.assert_update("shapes", [2, 3, 4], patch=dict(opacity=0), row=1) self.assert_update("shapes", [2, 5], patch=dict(opacity=0), col=1) self.assert_update("shapes", [4], patch=dict(opacity=0), secondary_y=True) + + def test_shape_attributes(self): + self.fig.update_shapes(text='hi') def test_update_images(self): ( @@ -254,3 +260,6 @@ def test_update_images(self): self.assert_update("images", [2, 3, 4], patch=dict(opacity=0), row=1) self.assert_update("images", [2, 5], patch=dict(opacity=0), col=1) self.assert_update("images", [4], patch=dict(opacity=0), secondary_y=True) + + def test_image_attributes(self): + self.fig.update_layout_images(text='hi') \ No newline at end of file From b17ec0d0575361dfa30afaa73b25c10930dcf66d Mon Sep 17 00:00:00 2001 From: mahdis-z Date: Tue, 18 Feb 2020 19:44:48 -0500 Subject: [PATCH 3/7] amend added properties and install black to fix ci --- .../test_core/test_update_objects/test_update_annotations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py b/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py index 4085d983a17..c33b2e60a00 100644 --- a/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py +++ b/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py @@ -241,7 +241,7 @@ def test_update_shapes(self): self.assert_update("shapes", [4], patch=dict(opacity=0), secondary_y=True) def test_shape_attributes(self): - self.fig.update_shapes(text='hi') + self.fig.update_shapes(fillcolor="red") def test_update_images(self): ( @@ -262,4 +262,4 @@ def test_update_images(self): self.assert_update("images", [4], patch=dict(opacity=0), secondary_y=True) def test_image_attributes(self): - self.fig.update_layout_images(text='hi') \ No newline at end of file + self.fig.update_layout_images(opacity=0.1) \ No newline at end of file From e2c296da009c2695653f4190201fca27a2702459 Mon Sep 17 00:00:00 2001 From: mahdis-z Date: Tue, 18 Feb 2020 21:06:02 -0500 Subject: [PATCH 4/7] fix ci --- .../test_update_objects/test_update_annotations.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py b/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py index c33b2e60a00..3bcf96a60a0 100644 --- a/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py +++ b/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py @@ -220,7 +220,7 @@ def test_update_annotations(self): ) def test_annotation_attributes(self): - self.fig.update_annotations(text='hi') + self.fig.update_annotations(text="hi") def test_update_shapes(self): ( @@ -239,7 +239,7 @@ def test_update_shapes(self): self.assert_update("shapes", [2, 3, 4], patch=dict(opacity=0), row=1) self.assert_update("shapes", [2, 5], patch=dict(opacity=0), col=1) self.assert_update("shapes", [4], patch=dict(opacity=0), secondary_y=True) - + def test_shape_attributes(self): self.fig.update_shapes(fillcolor="red") @@ -262,4 +262,4 @@ def test_update_images(self): self.assert_update("images", [4], patch=dict(opacity=0), secondary_y=True) def test_image_attributes(self): - self.fig.update_layout_images(opacity=0.1) \ No newline at end of file + self.fig.update_layout_images(opacity=0.1) From 5763f89282cfa87e6c54e797d55cca7127cb4065 Mon Sep 17 00:00:00 2001 From: Emmanuelle Gouillart Date: Wed, 19 Feb 2020 11:10:21 -0500 Subject: [PATCH 5/7] trying to debug --- .circleci/config.yml | 2 +- .../test_core/test_update_objects/test_update_annotations.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5e58717cc4a..ce9de3c6d97 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -339,7 +339,7 @@ jobs: command: | cd packages/python/plotly locale - tox -e py37-core -- -a '!nodev' + tox -e py37-core -- -a '!nodev' -s no_output_timeout: 20m - run: name: Commit diff --git a/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py b/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py index 3bcf96a60a0..151e82e5ede 100644 --- a/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py +++ b/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py @@ -220,6 +220,10 @@ def test_update_annotations(self): ) def test_annotation_attributes(self): + import plotly + print(plotly.__version__) + self.fig.add_annotation(dict(x=1, y=1)) + print(self.fig) self.fig.update_annotations(text="hi") def test_update_shapes(self): From d1abffbdac1f5c313b92126cbcff20ff864c5e02 Mon Sep 17 00:00:00 2001 From: Emmanuelle Gouillart Date: Wed, 19 Feb 2020 11:25:33 -0500 Subject: [PATCH 6/7] more debugging --- .../test_core/test_update_objects/test_update_annotations.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py b/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py index 151e82e5ede..ea0827d208f 100644 --- a/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py +++ b/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py @@ -220,10 +220,9 @@ def test_update_annotations(self): ) def test_annotation_attributes(self): - import plotly - print(plotly.__version__) + import inspect + print(inspect.signature(self.fig.update_annotations)) self.fig.add_annotation(dict(x=1, y=1)) - print(self.fig) self.fig.update_annotations(text="hi") def test_update_shapes(self): From 1f5fce089ed65affcbe221d4b6d596a216785ac4 Mon Sep 17 00:00:00 2001 From: Emmanuelle Gouillart Date: Wed, 19 Feb 2020 11:33:53 -0500 Subject: [PATCH 7/7] more debugging --- .../test_core/test_update_objects/test_update_annotations.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py b/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py index ea0827d208f..54a522d2f8e 100644 --- a/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py +++ b/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py @@ -222,6 +222,9 @@ def test_update_annotations(self): def test_annotation_attributes(self): import inspect print(inspect.signature(self.fig.update_annotations)) + import plotly + print(plotly.__version__) + print(plotly.__file__) self.fig.add_annotation(dict(x=1, y=1)) self.fig.update_annotations(text="hi")