Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__call__ to .opts(..) changes #1758

Closed
ea42gh opened this issue Jul 26, 2017 · 6 comments
Closed

__call__ to .opts(..) changes #1758

ea42gh opened this issue Jul 26, 2017 · 6 comments

Comments

@ea42gh
Copy link
Contributor

ea42gh commented Jul 26, 2017

grep for )( on *.py files yields the following which may be relevant?
the output format of the grep is File:line_number: line
I fixed instances in
tests/testplotinstantiation.py
holoviews/operation/element.py
examples/gallery/apps/bokeh/crossfilter.py

./tests/teststoreoptions.py:90:        layout = (im + im)({'Layout':dict(plot={'hspace':5})})
./tests/teststoreoptions.py:99:        layout = (im + im)({'Layout':dict(plot={'hspace':10})})
./examples/gallery/apps/bokeh/game_of_life.py:79:doc = renderer.server_doc(dmap.redim.range(z=(0, 1))(**opts))

Edit (jlstevens): The three lines above look like they might also need changing.

@ea42gh
Copy link
Contributor Author

ea42gh commented Jul 26, 2017

The same grep for .ipynb yields

./examples/user_guide/14-Large_Data.ipynb:228:    "color_points = hv.NdOverlay({k: hv.Points([0,0], label=str(k))(style=dict(color=v)) for k, v in color_key})\n",
./examples/user_guide/09-Indexing_and_Selecting_Data.ipynb:366:    "labeled_img = img * img_coords * hv.Points([img.closest([(5.1,4.9)])])(style=dict(color='r'))\n",
./examples/user_guide/09-Indexing_and_Selecting_Data.ipynb:454:    "all_samples = obs_hmap.table().to.scatter3d()(style=dict(alpha=0.15))\n",
./examples/user_guide/09-Indexing_and_Selecting_Data.ipynb:456:    "subsamples = sampled.to.scatter3d()(style=sample_style)\n",
./examples/user_guide/09-Indexing_and_Selecting_Data.ipynb:475:    "subsamples = sampled.to.scatter3d()(style=sample_style)\n",
./examples/user_guide/09-Indexing_and_Selecting_Data.ipynb:503:    "sampling = all_samples * sampled.to.points(extents=extents)(style=dict(color='r'))\n",
./examples/user_guide/09-Indexing_and_Selecting_Data.ipynb:521:    "sampling = all_samples * sampled.to.points(extents=extents)(style=dict(color='r'))\n",
./examples/user_guide/12-Custom_Interactivity.ipynb:242:    "hv.DynamicMap(integral, streams=[streams.Stream.define('Time', time=1.0)(), \n",
./examples/user_guide/Plotting_with_Bokeh.ipynb:107:    "(hv.Curve(data)(style=curve_opts) +\n",
./examples/user_guide/Plotting_with_Bokeh.ipynb:108:    " hv.Points(data)(style=point_opts) +\n",
./examples/user_guide/Plotting_with_Bokeh.ipynb:109:    " hv.Text(6, 0, 'Here is some text')(style=text_opts))"
./examples/user_guide/Plotting_with_Bokeh.ipynb:171:    "hv.Layout([points.relabel(group=group)(plot=opts)\n",
./examples/user_guide/11-Responding_to_Events.ipynb:565:    "dmap = hv.DynamicMap(sample_generator, streams=[Stream.define('Next')()])\n",
./examples/user_guide/Deploying_Bokeh_Apps.ipynb:76:    "    return points.clone(arr, label=label)(style=dict(color='red'))\n",
./examples/user_guide/Deploying_Bokeh_Apps.ipynb:288:    "points = hv.Points(np.random.randn(1000,2 ))(plot=dict(tools=['box_select', 'lasso_select']))\n",
./examples/user_guide/Deploying_Bokeh_Apps.ipynb:297:    "    return points.clone(arr, label=label)(style=dict(color='red'))\n",
./examples/user_guide/Deploying_Bokeh_Apps.ipynb:339:    "    return hv.Curve((xs, np.sin(frequency*xs+phase)*amplitude))(plot=dict(width=800))\n",
./examples/user_guide/Deploying_Bokeh_Apps.ipynb:501:    "    return hv.Curve((xs, np.sin(xs+phase)))(plot=dict(width=800))\n",
./examples/user_guide/Deploying_Bokeh_Apps.ipynb:567:    "    return hv.Curve((xs, np.sin(xs+phase)))(plot=dict(width=800))\n",
./examples/user_guide/Deploying_Bokeh_Apps.ipynb:569:    "stream = hv.streams.Stream.define('Phase', phase=0.)()\n",
./examples/topics/simulation/sri_model.ipynb:636:    "                                   q, [], group=q)(style=dict(cmap=c)).hist()\n",
./examples/topics/simulation/boids.ipynb:225:    "dmap = hv.DynamicMap(flock, streams=[Stream.define('Next')()])\n",
./examples/gallery/demos/bokeh/measles_example.ipynb:74:    "(heatmap + agg * vline * marker)(opts).cols(1)"
./examples/gallery/demos/bokeh/histogram_example.ipynb:127:    "(norm + lognorm + gamma + beta + weibull)(opts).cols(2)"
./examples/gallery/demos/bokeh/stocks_example.ipynb:81:    "((aapl * goog * ibm * msft)(plot=plot_opts) +\n",
./examples/gallery/demos/bokeh/stocks_example.ipynb:82:    "(avg_scatter(style=scatter_style) * avg_curve(style=curve_style))(plot=plot_opts))"
./examples/gallery/demos/bokeh/area_chart.ipynb:64:    "overlay = (python * pypy * jython)(style={'Area': style})\n",
./examples/gallery/demos/bokeh/legend_example.ipynb:62:    "    hv.Curve(scatter2)(style=dict(line_dash=(4, 4), color='orange')) *\n",
./examples/gallery/demos/bokeh/bachelors_degrees_by_gender.ipynb:85:    "                                        deg, halign='left', fontsize=10)(style=dict(color=col))\n",
./examples/gallery/demos/matplotlib/measles_example.ipynb:77:    "(heatmap + agg * vline * marker)(opts).cols(1)"
./examples/gallery/demos/matplotlib/histogram_example.ipynb:127:    "(norm + lognorm + gamma + beta + weibull)(opts).cols(2)"
./examples/gallery/demos/matplotlib/stocks_example.ipynb:82:    "(aapl * goog * ibm * msft)(plot=plot_opts) +\\\n",
./examples/gallery/demos/matplotlib/stocks_example.ipynb:83:    "(avg_scatter(style=scatter_style) * avg_curve(style=curve_style))(plot=plot_opts)"
./examples/gallery/demos/matplotlib/area_chart.ipynb:65:    "overlay = (python * pypy * jython)(style={'Area': style})\n",
./examples/gallery/demos/matplotlib/legend_example.ipynb:62:    "    hv.Curve(scatter2)(style=dict(linestyle='--', color='orange')) *\n",
./examples/gallery/demos/matplotlib/bachelors_degrees_by_gender.ipynb:86:    "                                        deg, halign='left', fontsize=10)(style=dict(color=col))\n",
./examples/reference/elements/bokeh/Polygons.ipynb:66:    "(hv.Polygons([rectangle(width=2), rectangle(x=6, width=2)])(style={'fill_color': '#a50d0d'})\n",
./examples/reference/elements/bokeh/Polygons.ipynb:67:    "* hv.Polygons([rectangle(x=2, height=2), rectangle(x=5, height=2)])(style={'fill_color': '#ffcc00'})\n",
./examples/reference/elements/bokeh/Polygons.ipynb:68:    "* hv.Polygons([rectangle(x=3, height=2, width=2)])(style={'fill_color': 'cyan'}))"
./examples/reference/elements/bokeh/Spikes.ipynb:96:    "hv.NdOverlay({i: hv.Spikes(np.random.randint(0, 100, 10), kdims=['Time'])(plot=dict(position=0.1*i))\n",
./examples/reference/elements/bokeh/Spikes.ipynb:97:    "              for i in range(10)})(plot=dict(yticks=[((i+1)*0.1-0.05, i) for i in range(10)]))"
./examples/reference/elements/bokeh/Curve.ipynb:74:    "hv.NdOverlay({interp: hv.Curve(points[::8])(plot=dict(interpolation=interp))\n",
./examples/reference/elements/plotly/Curve.ipynb:73:    "hv.NdOverlay({interp: hv.Curve(points[::8])(plot=dict(interpolation=interp))\n",
./examples/reference/elements/matplotlib/Polygons.ipynb:66:    "(hv.Polygons([rectangle(width=2), rectangle(x=6, width=2)])(style={'facecolor': '#a50d0d'})\n",
./examples/reference/elements/matplotlib/Polygons.ipynb:67:    "* hv.Polygons([rectangle(x=2, height=2), rectangle(x=5, height=2)])(style={'facecolor': '#ffcc00'})\n",
./examples/reference/elements/matplotlib/Polygons.ipynb:68:    "* hv.Polygons([rectangle(x=3, height=2, width=2)])(style={'facecolor': 'cyan'}))"
./examples/reference/elements/matplotlib/Spikes.ipynb:96:    "hv.NdOverlay({i: hv.Spikes(np.random.randint(0, 100, 10), kdims=['Time'])(plot=dict(position=0.1*i))\n",
./examples/reference/elements/matplotlib/Spikes.ipynb:97:    "              for i in range(10)})(plot=dict(yticks=[((i+1)*0.1-0.05, i) for i in range(10)]))"
./examples/reference/elements/matplotlib/Curve.ipynb:74:    "hv.NdOverlay({interp: hv.Curve(points[::8])(plot=dict(interpolation=interp))\n",
./examples/reference/streams/bokeh/Selection1D_points.ipynb:50:    "    return selected.relabel(label)(style=dict(color='red'))\n",

@jlstevens
Copy link
Contributor

This info is relevant to #1759 (merged) and #1760.

@ea42gh Do you mind if I edit your comments above to delete the lines that I don't think are involving styles/opts?

@ea42gh
Copy link
Contributor Author

ea42gh commented Jul 29, 2017

of course not!!!

@jlstevens
Copy link
Contributor

I have checked all the lines grepped above in the PR above, and fixed them as necessary. I think I can close this issue once that PR is merged.

@ea42gh
Copy link
Contributor Author

ea42gh commented Aug 3, 2017

did I miss some, or did I forget to submit files in a PR? Darn!

@jlstevens
Copy link
Contributor

@ea42gh There were only a few instances that needed to be fixed in the end.

The PR has been merged so I will close this issue. If you do find any remaining uses of __call__, please do report them in this issue so I can fix them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants