Repository navigation
minor test fixes for ipyplotly_integration - #975
Conversation
Now handles the case where the dashes are scaled, have floating-point values, or were customized with `dashes=(N,M)`.
rewrite changelog for broken choropleth
Fixing choropleth
changelog for fixed 2.4.1
(matplotlylib) Make convert_dash more robust to changes in matplotlib.
|
I don't think @chriddyp and I discussed |
… consistent with favoring validation failure to user\nrelated to TODO #283 Issue\n new valid charts created from old PlotlyImageTest examples
|
|
||
| if raw: | ||
| return figure | ||
| return tools.get_valid_graph_obj(figure, obj_type='Figure') |
There was a problem hiding this comment.
@chriddyp @jmmease
The purpose of this commit is to refactor get_valid_graph_obj function to not remove invalid properties of a figure when .get_figure() is called. I think this is important because:
- it is consistent with Jon's preference to validation over coercing to default attributes as a default (which I agree with)
- if a user does want to bypass validation errors, setting
raw=Trueis still an option in the get_figure function - one step on the road to finishing Remove
graph_objsdependency fromtools.py#283 fwiw
What do y'all think?
There was a problem hiding this comment.
I like this. The user will either get a dict with whatever was on the server (raw=True) or a fully valid Figure.
Do you think the stripping of invalid properties is something that regular users are going to need? I'm not clear on why we end up with figures with invalid properties on the server in the first place.
There was a problem hiding this comment.
I wondered the same thing. In refactoring these tests I noticed that a few of the example figures I pulled from were 4 years old and contained params that are no longer part of the valid params.
There was a problem hiding this comment.
I'd be inclined to update the test data, but I'll leave it to you and @chriddyp to decide whether we need to support some kind of legacy property removal.
| data=Data(), | ||
| layout=Layout( | ||
| xaxis1=XAxis( | ||
| xaxis=XAxis( |
it is |
|
@jmmease |
|
@Kully No, |
ok, I will remove their associated test |
Yup, that sounds right to me 👍 |
Does the same go for |
|
No, |
* Update CHANGELOG.md * (matplotlylib) Make convert_dash more robust to changes in matplotlib. Now handles the case where the dashes are scaled, have floating-point values, or were customized with `dashes=(N,M)`. * commit * remove unnecessary data files in tests and robust data-path searching * pep-8: l -> L variable name * bump version number up * remove shapefiles from folders and delete folders * removed data/ folder and modified choropleth code to match file names * changelog for fixed 2.4.1 * chelsea's comments * added fill_percent to params for insert, swap and remove * html preview not working * HTML preview now reflects the fill_percent param settings * tests are working * make update_default_schema * udpated changelog, removed TODOs, PEP-8 79 char line limit * turn off hover for the lines * 0-padding * changelog * update changelog and version number for 2.5.0 * change fill_percent example in doc to fill_percent=20 * sort all node generators to make HTML output consistent for py2 + py3 * dashboards now autosize based on GUI * update dash workshop announcement cc @chriddyp * version num to 2.5.0 * 4 equal height vertical stacked example in doc string * rename box_1 to box_a, etc * remove shapefiles in tests dir * change version back for testing purposes * version to 2.5.0 * try bumping npm v in circle.yml to 6.0.0 * Don't crash if figure_factory is imported but pandas isn't installed. Fixes plotly/plotly.py#941 * pr for plotly/plotly.py#958 PR * add PR reference * remove a comment * update plotlyjs for offline * moved py2.7 test env to last in core environments * remove ipyplotly folder * fixed assert Scatter() == dict(type='scatter') * fixed test_access_top_level in test_figure * more in test_figures fixes * remove junk in test_figure.py from before base merge * BaseFigure and BasePlotlyType inherit from PlotlyBase class * remove commented validation function * comment out validate error in test_scatter * add histogram2dcontour back to graph_reference TRACES * FigureWidget to OLD_CLASS_NAMES * add update to Data def in graph_objs//remove to_string in test_update * fixed test_offline in optional * test_plotl_mpl fixed * add py36 to core and optional test envs * break up datetime tests into multiple ones for better test control * fixed JSONEncoding errors * last assert test in test_utils * print statements for testing xaxis1 * construct paths to choropleth files intelligently * update the changelog * bump version * changelog comments * revert to current basedatatypes from plotly/plotly.py#942 * write in helper function for assert_dict_equal * fix trisurf: hoverinfo needs 'none', not 'None' * finished a few more classes in figure_factory tests * remove comment * change error msg for pip installs in choropleth * changelog update * fixed facet grid - annotations now tuples - FacetGrid tests in test_optional * remove DeprecationWarning from _dendrogram.py * remove unneeded comments in facet_grid * change height, width default to np.inf in _Dendogram * fixed all tests in optional figure_factory * PEP8 to greyscale list * fix Quiver tests; remove commented TestDisplot for duplicate * minor test fixes in test_tools resolved * playing around with matplotlylib - no success * chelsea's comment * fixed test_validate tests in test_core * fixed offline tests * change assert error in decorator * flawed annotations dont return error, so not checking for one * fix minor tests in test_data * fix test_error_bars * null changes * added white space * rework mock import for Py3.3+ compat * deepcopy in assert_fig_equal * fixed all but one test in make_subplots * fixed test_api - mock compatib issue * change errortype to ValueError to fix test * fix merge for rebase continue * reverted back to old test in test_figure * validators update * fix test_graph_objs.py in test_core * fix scatter.py * fix self.assert_fig_equal(ohlc.to_plotly_json()['data'][0], * assert_dict_equal typo * fix PotlyError -> ValueError for TestTable class * middle of putting .to_plotly_json in assert_fig_equal * updated test_tools - numpy arrays to lists * test_datetimes fixes * Fix typo (agruments) * test_offline changes * do not strip fig of invalid elements wen running .get_figure\nthis is consistent with favoring validation failure to user\nrelated to TODO plotly/plotly.py#283 Issue\n new valid charts created from old PlotlyImageTest examples * xaxis -> xaxis1 in make_subplots * xaxis -> xaxis1 * test_plot * fixed test_figure * fixed test_append_trace - added assert_fig_equal func clone in test_core * fixed TestDistplot tests * removed test_plotly_base_classes test as PlotlyDict/PlotlyList are removed * fixed tests in test_ff in optional
cc. @chriddyp @jmmease
Minor Test Fixes - Status
NB Tests that are not minor and require changing something in a fundamental way are still checked if all other minor tests in the module are fixed. A description/error message is provided just underneath the bullet point to specify the error message for the unsolved problem
Core
1 F w/ test_two_row_bottom_leftsame issue as test_make_subplots__init__() got an unexpected keyword argument '_raise''Annotations' object has no attribute 'validate'same issue as 'test_make_subplots''Data' object has no attribute 'validate'__init__() missing 1 required positional argument: 'class_strs_map'AttributeError: 'Frames' object has no attribute 'to_string'AttributeError: 'Figure' object has no attribute 'get_data'ImportError: cannot import name 'graph_objs_tools'from plotly.graph_objs.graph_objs import PlotlyDict, PlotlyListAttributeError: 'Figure' object has no attribute 'strip_style'AttributeError: 'Figure' object has no attribute 'to_string'AttributeError: 'Data' object has no attribute 'update'The 'xsrc' property is a string and must be specified as: - A stringTypeError: __init__() got an unexpected keyword argument '_raise'Optional
('ncontours', 'colorscale', 'reversescale', 'showscale') not valid in ScatterAssertionError: ['line']['width'] = 1.5 should be 1.0(I think the issue is just locally due to matplotlib ver ==2.2.2; our tests use matplotlib1.3.1)from plotly.tests.test_optional.test_matplotlylib.data.axis_scales import *causes the errorX = np.array([[1, 2, 3, 4], [1, 1, 3, 4], [1, 2, 1, 4], [1, 2, 3, 1]]) dendro = ff.create_dendrogram(X)failsCurrent Issues/Test failures from April 12, 2018:
.to_dataframe(test_optional/test_graph_objs)-removing the to_dataframe to_string, strip_styles, get_data, and validate methods?