Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f7c1369

Browse files
committed
...
1 parent 1daf31e commit f7c1369

File tree

1 file changed

+45
-227
lines changed

1 file changed

+45
-227
lines changed

plotly/tests/test_optional/test_figure_factory.py

Lines changed: 45 additions & 227 deletions
Original file line numberDiff line numberDiff line change
@@ -646,210 +646,30 @@ def test_trisurf_all_args(self):
646646
height=500, width=500,
647647
aspectratio=dict(x=0.7, y=0.6, z=1.2)
648648
)
649-
exp_trisurf_plot = {'data': [{'facecolor': ['rgb(127.5, 127.5, 127.5)',
650-
'rgb(255.0, 255.0, 255.0)',
651-
'rgb(127.5, 127.5, 127.5)',
652-
'rgb(0.0, 0.0, 0.0)',
653-
'rgb(127.5, 127.5, 127.5)',
654-
'rgb(0.0, 0.0, 0.0)',
655-
'rgb(127.5, 127.5, 127.5)',
656-
'rgb(255.0, 255.0, 255.0)'],
657-
'i': [3, 1, 1, 5, 7, 3, 5, 7],
658-
'j': [1, 3, 5, 1, 3, 7, 7, 5],
659-
'k': [4, 0, 4, 2, 4, 6, 4, 8],
660-
'name': '',
661-
'type': 'mesh3d',
662-
'x': np.array([-1., 0., 1., -1., 0., 1., -1., 0., 1.]),
663-
'y': np.array([-0.54030231, 0. , 0.54030231, -1. , 0. ,
664-
1. , -0.54030231, 0. , 0.54030231]),
665-
'z': np.array([ 0.84147098, -0. , -0.84147098, -0. , 0. ,
666-
0. , -0.84147098, 0. , 0.84147098])},
667-
{'line': {'color': 'rgb(50, 50, 50)', 'width': 1.5},
668-
'mode': 'lines',
669-
'type': 'scatter3d',
670-
'x': [-1.0,
671-
0.0,
672-
0.0,
673-
-1.0,
674-
None,
675-
0.0,
676-
-1.0,
677-
-1.0,
678-
0.0,
679-
None,
680-
0.0,
681-
1.0,
682-
0.0,
683-
0.0,
684-
None,
685-
1.0,
686-
0.0,
687-
1.0,
688-
1.0,
689-
None,
690-
0.0,
691-
-1.0,
692-
0.0,
693-
0.0,
694-
None,
695-
-1.0,
696-
0.0,
697-
-1.0,
698-
-1.0,
699-
None,
700-
1.0,
701-
0.0,
702-
0.0,
703-
1.0,
704-
None,
705-
0.0,
706-
1.0,
707-
1.0,
708-
0.0,
709-
None],
710-
'y': [-1.0,
711-
0.0,
712-
0.0,
713-
-1.0,
714-
None,
715-
0.0,
716-
-1.0,
717-
-0.54030230586813977,
718-
0.0,
719-
None,
720-
0.0,
721-
1.0,
722-
0.0,
723-
0.0,
724-
None,
725-
1.0,
726-
0.0,
727-
0.54030230586813977,
728-
1.0,
729-
None,
730-
0.0,
731-
-1.0,
732-
0.0,
733-
0.0,
734-
None,
735-
-1.0,
736-
0.0,
737-
-0.54030230586813977,
738-
-1.0,
739-
None,
740-
1.0,
741-
0.0,
742-
0.0,
743-
1.0,
744-
None,
745-
0.0,
746-
1.0,
747-
0.54030230586813977,
748-
0.0,
749-
None],
750-
'z': [-0.0,
751-
-0.0,
752-
0.0,
753-
-0.0,
754-
None,
755-
-0.0,
756-
-0.0,
757-
0.8414709848078965,
758-
-0.0,
759-
None,
760-
-0.0,
761-
0.0,
762-
0.0,
763-
-0.0,
764-
None,
765-
0.0,
766-
-0.0,
767-
-0.8414709848078965,
768-
0.0,
769-
None,
770-
0.0,
771-
-0.0,
772-
0.0,
773-
0.0,
774-
None,
775-
-0.0,
776-
0.0,
777-
-0.8414709848078965,
778-
-0.0,
779-
None,
780-
0.0,
781-
0.0,
782-
0.0,
783-
0.0,
784-
None,
785-
0.0,
786-
0.0,
787-
0.8414709848078965,
788-
0.0,
789-
None]}],
790-
'layout': {'height': 500,
791-
'scene': {'aspectratio': {'x': 0.7, 'y': 0.6, 'z': 1.2},
792-
'xaxis': {'backgroundcolor': 'rgb(1, 1, 1)',
793-
'gridcolor': 'rgb(2, 2, 2)',
794-
'showbackground': False,
795-
'zerolinecolor': 'rgb(3, 3, 3)'},
796-
'yaxis': {'backgroundcolor': 'rgb(1, 1, 1)',
797-
'gridcolor': 'rgb(2, 2, 2)',
798-
'showbackground': False,
799-
'zerolinecolor': 'rgb(3, 3, 3)'},
800-
'zaxis': {'backgroundcolor': 'rgb(1, 1, 1)',
801-
'gridcolor': 'rgb(2, 2, 2)',
802-
'showbackground': False,
803-
'zerolinecolor': 'rgb(3, 3, 3)'}},
804-
'title': 'Fun',
805-
'width': 500}}
806-
807-
"""
808-
exp_trisurf_plot = {
809-
'data': [{'facecolor': ['rgb(112.5, 115.00000000000001, 196.0)',
810-
'rgb(220.0, 220.0, 220.0)',
811-
'rgb(112.5, 115.00000000000001, 196.0)',
812-
'rgb(5.0, 10.0, 172.0)',
813-
'rgb(112.5, 115.00000000000001, 196.0)',
814-
'rgb(5.0, 10.0, 172.0)',
815-
'rgb(112.5, 115.00000000000001, 196.0)',
816-
'rgb(220.0, 220.0, 220.0)'],
817-
'i': [3, 1, 1, 5, 7, 3, 5, 7],
818-
'j': [1, 3, 5, 1, 3, 7, 7, 5],
819-
'k': [4, 0, 4, 2, 4, 6, 4, 8],
820-
'name': '',
821-
'type': 'mesh3d',
822-
'x': np.array([-3.14159265,
823-
0.,
824-
3.14159265,
825-
-3.14159265,
826-
0.,
827-
3.14159265,
828-
-3.14159265,
829-
0.,
830-
3.14159265]),
831-
'y': np.array([3.14159265,
832-
-0.,
833-
-3.14159265,
834-
-3.14159265,
835-
0.,
836-
3.14159265,
837-
3.14159265,
838-
-0.,
839-
-3.14159265]),
840-
'z': np.array([3.84734139e-16,
841-
-0.00000000e+00,
842-
-3.84734139e-16,
843-
-0.00000000e+00,
844-
0.00000000e+00,
845-
0.00000000e+00,
846-
-3.84734139e-16,
847-
0.00000000e+00,
848-
3.84734139e-16])},
849-
{'line': {'color': 'rgb(50, 50, 50)', 'width': 1.5},
850-
'mode': 'lines',
851-
'type': 'scatter3d',
852-
'x': [-3.1415926535897931,
649+
exp_trisurf_plot = {'data': [{'facecolor': ['rgb(112.5, 115.00000000000001, 196.0)',
650+
'rgb(220.0, 220.0, 220.0)',
651+
'rgb(112.5, 115.00000000000001, 196.0)',
652+
'rgb(5.0, 10.0, 172.0)',
653+
'rgb(112.5, 115.00000000000001, 196.0)',
654+
'rgb(5.0, 10.0, 172.0)',
655+
'rgb(112.5, 115.00000000000001, 196.0)',
656+
'rgb(220.0, 220.0, 220.0)'],
657+
'i': [3, 1, 1, 5, 7, 3, 5, 7],
658+
'j': [1, 3, 5, 1, 3, 7, 7, 5],
659+
'k': [4, 0, 4, 2, 4, 6, 4, 8],
660+
'name': '',
661+
'type': 'mesh3d',
662+
'x': np.array([-3.14159265, 0. , 3.14159265, -3.14159265, 0. ,
663+
3.14159265, -3.14159265, 0. , 3.14159265]),
664+
'y': np.array([ 3.14159265, -0. , -3.14159265, -3.14159265, 0. ,
665+
3.14159265, 3.14159265, -0. , -3.14159265]),
666+
'z': np.array([ 3.84734139e-16, -0.00000000e+00, -3.84734139e-16,
667+
-0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
668+
-3.84734139e-16, 0.00000000e+00, 3.84734139e-16])},
669+
{'line': {'color': 'rgb(50, 50, 50)', 'width': 1.5},
670+
'mode': 'lines',
671+
'type': 'scatter3d',
672+
'x': [-3.1415926535897931,
853673
0.0,
854674
0.0,
855675
-3.1415926535897931,
@@ -889,7 +709,7 @@ def test_trisurf_all_args(self):
889709
3.1415926535897931,
890710
0.0,
891711
None],
892-
'y': [-3.1415926535897931,
712+
'y': [-3.1415926535897931,
893713
-0.0,
894714
0.0,
895715
-3.1415926535897931,
@@ -929,7 +749,7 @@ def test_trisurf_all_args(self):
929749
-3.1415926535897931,
930750
-0.0,
931751
None],
932-
'z': [-0.0,
752+
'z': [-0.0,
933753
-0.0,
934754
0.0,
935755
-0.0,
@@ -969,32 +789,30 @@ def test_trisurf_all_args(self):
969789
3.8473413874435795e-16,
970790
0.0,
971791
None]}],
972-
'layout': {'height': 500,
973-
'scene': {'aspectratio': {'x': 0.7, 'y': 0.6, 'z': 1.2},
974-
'xaxis': {'backgroundcolor': 'rgb(1, 20, 10)',
975-
'gridcolor': 'rgb(0, 20, 50)',
976-
'showbackground': False,
977-
'zerolinecolor': 'rgb(25, 255, 15)'},
978-
'yaxis': {'backgroundcolor': 'rgb(1, 20, 10)',
979-
'gridcolor': 'rgb(0, 20, 50)',
980-
'showbackground': False,
981-
'zerolinecolor': 'rgb(25, 255, 15)'},
982-
'zaxis': {'backgroundcolor': 'rgb(1, 20, 10)',
983-
'gridcolor': 'rgb(0, 20, 50)',
984-
'showbackground': False,
985-
'zerolinecolor': 'rgb(25, 255, 15)'}},
986-
'title': 'Fun',
987-
'width': 500}}
988-
989-
"""
792+
'layout': {'height': 500,
793+
'scene': {'aspectratio': {'x': 0.7, 'y': 0.6, 'z': 1.2},
794+
'xaxis': {'backgroundcolor': 'rgb(1, 20, 10)',
795+
'gridcolor': 'rgb(0, 20, 50)',
796+
'showbackground': False,
797+
'zerolinecolor': 'rgb(25, 255, 15)'},
798+
'yaxis': {'backgroundcolor': 'rgb(1, 20, 10)',
799+
'gridcolor': 'rgb(0, 20, 50)',
800+
'showbackground': False,
801+
'zerolinecolor': 'rgb(25, 255, 15)'},
802+
'zaxis': {'backgroundcolor': 'rgb(1, 20, 10)',
803+
'gridcolor': 'rgb(0, 20, 50)',
804+
'showbackground': False,
805+
'zerolinecolor': 'rgb(25, 255, 15)'}},
806+
'title': 'Fun',
807+
'width': 500}}
990808

991809
#self.assertEqual(test_trisurf_plot['data'], exp_trisurf_plot['data'])
992810

993-
#self.assert_dict_equal(test_trisurf_plot['data'][0],
994-
# exp_trisurf_plot['data'][0])
995-
996811
self.assert_dict_equal(test_trisurf_plot['data'][0],
997812
exp_trisurf_plot['data'][0])
998813

814+
self.assert_dict_equal(test_trisurf_plot['data'][1],
815+
exp_trisurf_plot['data'][1])
816+
999817
self.assert_dict_equal(test_trisurf_plot['layout'],
1000818
exp_trisurf_plot['layout'])

0 commit comments

Comments
 (0)