Skip to content

Commit c72da6a

Browse files
committed
erasing/dealing with some TODOs
1 parent 9a38172 commit c72da6a

File tree

5 files changed

+6
-20
lines changed

5 files changed

+6
-20
lines changed

makefile

+2-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ update_default_schema :
2828
@echo "Auto-generating graph objects based on updated default-schema."
2929
@echo "Warning: Make sure you are running 'make update_default_schema' with Python 3.6.
3030
The code generating scripts requires 3.6 to run."
31-
python codegen/__init__.py
32-
# TODO: fix code breaking with update_default_schema
33-
# python setup.py codegen
31+
python setup.py codegen
32+
3433

3534
install : sync_subs
3635
@echo ""

plotly/basedatatypes.py

-10
Original file line numberDiff line numberDiff line change
@@ -3570,16 +3570,6 @@ def __setattr__(self, prop, value):
35703570
# Set as subplotid property
35713571
self._set_subplotid_prop(prop, value)
35723572

3573-
# TODO - remove old __dir__ magic method below?
3574-
# def __dir__(self):
3575-
# """
3576-
# Custom __dir__ that handles dynamic subplot properties
3577-
# """
3578-
# # Include any active subplot values
3579-
# return list(super(BaseLayoutHierarchyType, self).__dir__()) + sorted(self._subplotid_props)
3580-
# #return list(dir(super(BaseLayoutHierarchyType, self))) + sorted(self._subplotid_props)
3581-
3582-
35833573
def __dir__(self):
35843574
"""
35853575
Custom __dir__ that handles dynamic subplot properties

plotly/plotly/plotly.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -654,16 +654,14 @@ def write(self, trace, layout=None,
654654
validate = False
655655

656656
# Convert trace objects to dictionaries
657-
658657
if isinstance(trace, BaseTraceType):
659-
trace = trace.to_plotly_json()
658+
trace = trace.to_plotly_json()
660659

661660
stream_object = dict()
662661
stream_object.update(trace)
663662
if 'type' not in stream_object:
664663
# tests if Scatter contains invalid kwargs
665-
# TODO: replace Scatter with something else
666-
#dummy_obj = copy.deepcopy(Scatter(**stream_object))
664+
dummy_obj = copy.deepcopy(Scatter(**stream_object))
667665
stream_object = Scatter(**stream_object)
668666
stream_object['type'] = 'scatter'
669667

plotly/tests/test_optional/test_matplotlylib/data/lines.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
symbol='circle',
8686
line=Line(
8787
color='#FF0000',
88-
width=1.0 # TODO: change later?
88+
width=1.0
8989
),
9090
size=10,
9191
color='#FF0000',

plotly/tests/test_optional/test_utils/test_utils.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ def test_encode_as_date(self):
148148
self.assertEqual(res, '2013-10-01')
149149

150150
# should also work with a date time without a utc offset!
151-
# TODO: is this OK? We could raise errors after checking isinstance...
152151
res = utils.PlotlyJSONEncoder.encode_as_date(
153152
datetime.datetime(2013, 10, 1, microsecond=10)
154153
)
@@ -159,7 +158,7 @@ def test_encode_as_decimal(self):
159158
# should work with decimal values
160159
res = utils.PlotlyJSONEncoder.encode_as_decimal(decimal.Decimal(1.023452))
161160

162-
self.assertAlmostEqual(res, 1.023452) # Checks upto 7 decimal places
161+
self.assertAlmostEqual(res, 1.023452) # Checks upto 7 decimal places
163162
self.assertIsInstance(res, float)
164163

165164
## JSON encoding

0 commit comments

Comments
 (0)