From 1e9ee2f836eaab44887b0e4be7f21a25c106e526 Mon Sep 17 00:00:00 2001 From: mahdis-z Date: Mon, 17 Feb 2020 14:48:20 -0500 Subject: [PATCH 1/8] 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/8] 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/8] 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/8] 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 6fa8cf9ef192fa4ba262e98539d3fdbc6ddb13b1 Mon Sep 17 00:00:00 2001 From: mahdis-z Date: Wed, 19 Feb 2020 11:54:57 -0500 Subject: [PATCH 5/8] modified tests --- .../test_core/test_update_objects/test_update_annotations.py | 4 ++++ 1 file changed, 4 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 3bcf96a60a0..d8e2e87df39 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,7 @@ def test_update_annotations(self): ) def test_annotation_attributes(self): + self.fig.add_annotation(test="this text", yref="paper") self.fig.update_annotations(text="hi") def test_update_shapes(self): @@ -241,6 +242,8 @@ def test_update_shapes(self): self.assert_update("shapes", [4], patch=dict(opacity=0), secondary_y=True) def test_shape_attributes(self): + + self.fig.add_shape(fillcolor='blue', opacity=0.3) self.fig.update_shapes(fillcolor="red") def test_update_images(self): @@ -262,4 +265,5 @@ def test_update_images(self): self.assert_update("images", [4], patch=dict(opacity=0), secondary_y=True) def test_image_attributes(self): + self.fig.add_layout_image(name='my name', x=1, y=2) self.fig.update_layout_images(opacity=0.1) From 58207fa2d5cfd3ca0c326ed830b3cab5aee07893 Mon Sep 17 00:00:00 2001 From: mahdis-z Date: Wed, 19 Feb 2020 13:01:55 -0500 Subject: [PATCH 6/8] fix ci one more time --- .../test_core/test_update_objects/test_update_annotations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 d8e2e87df39..dd071e874e7 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.add_annotation(test="this text", yref="paper") + self.fig.add_annotation(text="this text", yref="paper") self.fig.update_annotations(text="hi") def test_update_shapes(self): From 3529d10d488484c4351f1e871864ff7f0d94556a Mon Sep 17 00:00:00 2001 From: mahdis-z Date: Wed, 19 Feb 2020 13:06:03 -0500 Subject: [PATCH 7/8] fix black issue --- .../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 dd071e874e7..0edd3cb644d 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 @@ -243,7 +243,7 @@ def test_update_shapes(self): def test_shape_attributes(self): - self.fig.add_shape(fillcolor='blue', opacity=0.3) + self.fig.add_shape(fillcolor="blue", opacity=0.3) self.fig.update_shapes(fillcolor="red") def test_update_images(self): @@ -265,5 +265,5 @@ def test_update_images(self): self.assert_update("images", [4], patch=dict(opacity=0), secondary_y=True) def test_image_attributes(self): - self.fig.add_layout_image(name='my name', x=1, y=2) + self.fig.add_layout_image(name="my name", x=1, y=2) self.fig.update_layout_images(opacity=0.1) From 0960f4c078921d3a1aa9b60b7830b37d4c67633e Mon Sep 17 00:00:00 2001 From: mahdis-z Date: Wed, 19 Feb 2020 13:38:35 -0500 Subject: [PATCH 8/8] patch=None in codegen/figure.py --- packages/python/plotly/codegen/figure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/python/plotly/codegen/figure.py b/packages/python/plotly/codegen/figure.py index 1a0f073af8c..6c5d98fdf98 100644 --- a/packages/python/plotly/codegen/figure.py +++ b/packages/python/plotly/codegen/figure.py @@ -473,7 +473,7 @@ def for_each_{method_prefix}{singular_name}( def update_{method_prefix}{plural_name}( self, - patch, + patch=None, selector=None, row=None, col=None,