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

Skip to content

Commit 7d2d60c

Browse files
committed
Remove future flag disabled logic
1 parent dcbfa6b commit 7d2d60c

File tree

11 files changed

+67
-839
lines changed

11 files changed

+67
-839
lines changed

_plotly_utils/utils.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import sys
55
import re
66
import pytz
7-
from _plotly_future_ import _future_flags
87

98
from _plotly_utils.optional_imports import get_module
109

@@ -104,9 +103,7 @@ def default(self, obj):
104103
self.encode_as_sage,
105104
self.encode_as_numpy,
106105
self.encode_as_pandas,
107-
(self.encode_as_datetime_v4
108-
if 'timezones' in _future_flags
109-
else self.encode_as_datetime),
106+
self.encode_as_datetime_v4,
110107
self.encode_as_date,
111108
self.encode_as_list, # because some values have `tolist` do last.
112109
self.encode_as_decimal

codegen/figure.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ def build_figure_py(trace_node, base_package, base_classname, fig_classname,
5757
# ### Import trace graph_obj classes ###
5858
trace_types_csv = ', '.join([n.name_datatype_class for n in trace_nodes])
5959
buffer.write(f'from plotly.graph_objs import ({trace_types_csv})\n')
60-
buffer.write("from plotly.subplots import _validate_v4_subplots\n")
6160

6261
# Write class definition
6362
# ----------------------
@@ -253,8 +252,6 @@ def select_{plural_name}(
253252
Generator that iterates through all of the {singular_name}
254253
objects that satisfy all of the specified selection criteria
255254
\"\"\"
256-
if row is not None or col is not None:
257-
_validate_v4_subplots('select_{plural_name}')
258255
259256
return self._select_layout_subplots_by_prefix(
260257
'{singular_name}', selector, row, col{secondary_y_2})

plotly/__init__.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
"""
2828

2929
from __future__ import absolute_import
30-
from _plotly_future_ import _future_flags
3130

3231
from plotly import (
3332
graph_objs,
@@ -41,16 +40,5 @@
4140

4241
from plotly.version import __version__
4342

44-
if ('extract_chart_studio' not in _future_flags
45-
and 'remove_deprecations' not in _future_flags):
46-
from plotly import (
47-
plotly,
48-
dashboard_objs,
49-
grid_objs,
50-
session)
51-
52-
5343
# Set default template here to make sure import process is complete
54-
if 'template_defaults' in _future_flags:
55-
# Set _default to skip validation
56-
io.templates._default = 'plotly'
44+
io.templates._default = 'plotly'

plotly/basedatatypes.py

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
from plotly.subplots import (
1414
_set_trace_grid_reference,
1515
_get_grid_subplot,
16-
_get_subplot_ref_for_trace,
17-
_validate_v4_subplots)
16+
_get_subplot_ref_for_trace)
1817
from .optional_imports import get_module
1918

2019
from _plotly_utils.basevalidators import (
@@ -26,8 +25,6 @@
2625
from plotly.utils import ElidedPrettyPrinter
2726
from .validators import (DataValidator, LayoutValidator, FramesValidator)
2827

29-
from _plotly_future_ import _future_flags
30-
3128
# Create Undefined sentinel value
3229
# - Setting a property to None removes any existing value
3330
# - Setting a property to Undefined leaves existing value unmodified
@@ -51,7 +48,7 @@ class BaseFigure(object):
5148
'plot_bgcolor': 'plot-bgcolor'
5249
}
5350

54-
_set_trace_uid = 'trace_uids' not in _future_flags
51+
_set_trace_uid = False
5552

5653
# Constructor
5754
# -----------
@@ -683,7 +680,6 @@ def select_traces(
683680
selector = {}
684681

685682
if row is not None or col is not None or secondary_y is not None:
686-
_validate_v4_subplots('select_traces')
687683
grid_ref = self._validate_get_grid_ref()
688684
filter_by_subplot = True
689685

@@ -1610,41 +1606,8 @@ def append_trace(self, trace, row, col):
16101606
def _set_trace_grid_position(
16111607
self, trace, row, col, secondary_y=False):
16121608
grid_ref = self._validate_get_grid_ref()
1613-
1614-
from _plotly_future_ import _future_flags
1615-
if 'v4_subplots' in _future_flags:
1616-
return _set_trace_grid_reference(
1617-
trace, self.layout, grid_ref, row, col, secondary_y)
1618-
1619-
if row <= 0:
1620-
raise Exception("Row value is out of range. "
1621-
"Note: the starting cell is (1, 1)")
1622-
if col <= 0:
1623-
raise Exception("Col value is out of range. "
1624-
"Note: the starting cell is (1, 1)")
1625-
try:
1626-
ref = grid_ref[row - 1][col - 1]
1627-
except IndexError:
1628-
raise Exception("The (row, col) pair sent is out of "
1629-
"range. Use Figure.print_grid to view the "
1630-
"subplot grid. ")
1631-
if 'scene' in ref[0]:
1632-
trace['scene'] = ref[0]
1633-
if ref[0] not in self['layout']:
1634-
raise Exception("Something went wrong. "
1635-
"The scene object for ({r},{c}) "
1636-
"subplot cell "
1637-
"got deleted.".format(r=row, c=col))
1638-
else:
1639-
xaxis_key = "xaxis{ref}".format(ref=ref[0][1:])
1640-
yaxis_key = "yaxis{ref}".format(ref=ref[1][1:])
1641-
if (xaxis_key not in self['layout']
1642-
or yaxis_key not in self['layout']):
1643-
raise Exception("Something went wrong. "
1644-
"An axis object for ({r},{c}) subplot "
1645-
"cell got deleted.".format(r=row, c=col))
1646-
trace['xaxis'] = ref[0]
1647-
trace['yaxis'] = ref[1]
1609+
return _set_trace_grid_reference(
1610+
trace, self.layout, grid_ref, row, col, secondary_y)
16481611

16491612
def _validate_get_grid_ref(self):
16501613
try:

plotly/graph_objs/_figure.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
Scatterternary, Splom, Streamtube, Sunburst, Surface, Table, Violin,
99
Volume, Waterfall
1010
)
11-
from plotly.subplots import _validate_v4_subplots
1211

1312

1413
class Figure(BaseFigure):
@@ -14241,8 +14240,6 @@ def select_coloraxes(self, selector=None, row=None, col=None):
1424114240
Generator that iterates through all of the coloraxis
1424214241
objects that satisfy all of the specified selection criteria
1424314242
"""
14244-
if row is not None or col is not None:
14245-
_validate_v4_subplots('select_coloraxes')
1424614243

1424714244
return self._select_layout_subplots_by_prefix(
1424814245
'coloraxis', selector, row, col
@@ -14341,8 +14338,6 @@ def select_geos(self, selector=None, row=None, col=None):
1434114338
Generator that iterates through all of the geo
1434214339
objects that satisfy all of the specified selection criteria
1434314340
"""
14344-
if row is not None or col is not None:
14345-
_validate_v4_subplots('select_geos')
1434614341

1434714342
return self._select_layout_subplots_by_prefix(
1434814343
'geo', selector, row, col
@@ -14441,8 +14436,6 @@ def select_mapboxes(self, selector=None, row=None, col=None):
1444114436
Generator that iterates through all of the mapbox
1444214437
objects that satisfy all of the specified selection criteria
1444314438
"""
14444-
if row is not None or col is not None:
14445-
_validate_v4_subplots('select_mapboxes')
1444614439

1444714440
return self._select_layout_subplots_by_prefix(
1444814441
'mapbox', selector, row, col
@@ -14541,8 +14534,6 @@ def select_polars(self, selector=None, row=None, col=None):
1454114534
Generator that iterates through all of the polar
1454214535
objects that satisfy all of the specified selection criteria
1454314536
"""
14544-
if row is not None or col is not None:
14545-
_validate_v4_subplots('select_polars')
1454614537

1454714538
return self._select_layout_subplots_by_prefix(
1454814539
'polar', selector, row, col
@@ -14641,8 +14632,6 @@ def select_scenes(self, selector=None, row=None, col=None):
1464114632
Generator that iterates through all of the scene
1464214633
objects that satisfy all of the specified selection criteria
1464314634
"""
14644-
if row is not None or col is not None:
14645-
_validate_v4_subplots('select_scenes')
1464614635

1464714636
return self._select_layout_subplots_by_prefix(
1464814637
'scene', selector, row, col
@@ -14741,8 +14730,6 @@ def select_ternaries(self, selector=None, row=None, col=None):
1474114730
Generator that iterates through all of the ternary
1474214731
objects that satisfy all of the specified selection criteria
1474314732
"""
14744-
if row is not None or col is not None:
14745-
_validate_v4_subplots('select_ternaries')
1474614733

1474714734
return self._select_layout_subplots_by_prefix(
1474814735
'ternary', selector, row, col
@@ -14841,8 +14828,6 @@ def select_xaxes(self, selector=None, row=None, col=None):
1484114828
Generator that iterates through all of the xaxis
1484214829
objects that satisfy all of the specified selection criteria
1484314830
"""
14844-
if row is not None or col is not None:
14845-
_validate_v4_subplots('select_xaxes')
1484614831

1484714832
return self._select_layout_subplots_by_prefix(
1484814833
'xaxis', selector, row, col
@@ -14955,8 +14940,6 @@ def select_yaxes(
1495514940
Generator that iterates through all of the yaxis
1495614941
objects that satisfy all of the specified selection criteria
1495714942
"""
14958-
if row is not None or col is not None:
14959-
_validate_v4_subplots('select_yaxes')
1496014943

1496114944
return self._select_layout_subplots_by_prefix(
1496214945
'yaxis', selector, row, col, secondary_y=secondary_y

plotly/graph_objs/_figurewidget.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
Scatterternary, Splom, Streamtube, Sunburst, Surface, Table, Violin,
99
Volume, Waterfall
1010
)
11-
from plotly.subplots import _validate_v4_subplots
1211

1312

1413
class FigureWidget(BaseFigureWidget):
@@ -14241,8 +14240,6 @@ def select_coloraxes(self, selector=None, row=None, col=None):
1424114240
Generator that iterates through all of the coloraxis
1424214241
objects that satisfy all of the specified selection criteria
1424314242
"""
14244-
if row is not None or col is not None:
14245-
_validate_v4_subplots('select_coloraxes')
1424614243

1424714244
return self._select_layout_subplots_by_prefix(
1424814245
'coloraxis', selector, row, col
@@ -14341,8 +14338,6 @@ def select_geos(self, selector=None, row=None, col=None):
1434114338
Generator that iterates through all of the geo
1434214339
objects that satisfy all of the specified selection criteria
1434314340
"""
14344-
if row is not None or col is not None:
14345-
_validate_v4_subplots('select_geos')
1434614341

1434714342
return self._select_layout_subplots_by_prefix(
1434814343
'geo', selector, row, col
@@ -14441,8 +14436,6 @@ def select_mapboxes(self, selector=None, row=None, col=None):
1444114436
Generator that iterates through all of the mapbox
1444214437
objects that satisfy all of the specified selection criteria
1444314438
"""
14444-
if row is not None or col is not None:
14445-
_validate_v4_subplots('select_mapboxes')
1444614439

1444714440
return self._select_layout_subplots_by_prefix(
1444814441
'mapbox', selector, row, col
@@ -14541,8 +14534,6 @@ def select_polars(self, selector=None, row=None, col=None):
1454114534
Generator that iterates through all of the polar
1454214535
objects that satisfy all of the specified selection criteria
1454314536
"""
14544-
if row is not None or col is not None:
14545-
_validate_v4_subplots('select_polars')
1454614537

1454714538
return self._select_layout_subplots_by_prefix(
1454814539
'polar', selector, row, col
@@ -14641,8 +14632,6 @@ def select_scenes(self, selector=None, row=None, col=None):
1464114632
Generator that iterates through all of the scene
1464214633
objects that satisfy all of the specified selection criteria
1464314634
"""
14644-
if row is not None or col is not None:
14645-
_validate_v4_subplots('select_scenes')
1464614635

1464714636
return self._select_layout_subplots_by_prefix(
1464814637
'scene', selector, row, col
@@ -14741,8 +14730,6 @@ def select_ternaries(self, selector=None, row=None, col=None):
1474114730
Generator that iterates through all of the ternary
1474214731
objects that satisfy all of the specified selection criteria
1474314732
"""
14744-
if row is not None or col is not None:
14745-
_validate_v4_subplots('select_ternaries')
1474614733

1474714734
return self._select_layout_subplots_by_prefix(
1474814735
'ternary', selector, row, col
@@ -14841,8 +14828,6 @@ def select_xaxes(self, selector=None, row=None, col=None):
1484114828
Generator that iterates through all of the xaxis
1484214829
objects that satisfy all of the specified selection criteria
1484314830
"""
14844-
if row is not None or col is not None:
14845-
_validate_v4_subplots('select_xaxes')
1484614831

1484714832
return self._select_layout_subplots_by_prefix(
1484814833
'xaxis', selector, row, col
@@ -14955,8 +14940,6 @@ def select_yaxes(
1495514940
Generator that iterates through all of the yaxis
1495614941
objects that satisfy all of the specified selection criteria
1495714942
"""
14958-
if row is not None or col is not None:
14959-
_validate_v4_subplots('select_yaxes')
1496014943

1496114944
return self._select_layout_subplots_by_prefix(
1496214945
'yaxis', selector, row, col, secondary_y=secondary_y

plotly/io/_orca.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222

2323
psutil = get_module('psutil')
2424

25-
from _plotly_future_ import _future_flags
26-
2725
# Valid image format constants
2826
# ----------------------------
2927
valid_formats = ('png', 'jpeg', 'webp', 'svg', 'pdf', 'eps')
@@ -671,7 +669,7 @@ def mapbox_access_token(self, val):
671669

672670
@property
673671
def use_xvfb(self):
674-
dflt = 'auto' if 'orca_defaults' in _future_flags else False
672+
dflt = 'auto'
675673
return self._props.get('use_xvfb', dflt)
676674

677675
@use_xvfb.setter

0 commit comments

Comments
 (0)