Update dynamically computed signature
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 124
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 1
Description
The signature of each plotting method is dynamically constructed on import. They include:
1. Original method signature (e.g. of `.line()`) without variadic keywords
2. Valid backend *style* options for the element (obtained `_kind_mapping`) and backend (defaults to `bokeh`)
3. From the mapping `HoloViewsConverter._kind_options` (plotting method name to a short list of options)
4. From the mapping `HoloViewsConverter._axis_options` (list of axis options)
5. From the mapping `HoloViewsConverter._op_options` (list of operation options)
6. **kwargs
2), 3), 4) and 5) are only built as `inspect.Parameter(k, inspect.Parameter.KEYWORD_ONLY)` so they don't include the default values of these options, that could, for example, be defined in `HoloViewsConverter.__init__`.
Many options are in fact missing, here's the list obtained by comparing the signature of `HoloViewsConverter.__init__` with `hvplot.plotting.hvTabular.line`:
```
attr_labels
autorange
backlog
by
check_symmetric_max
clim
cnorm
coastline
col
crs
cticks
debug
dynamic
dynspread
features
fields
flip_xaxis
flip_yaxis
framewise
geo
global_extent
group_label
groupby
hover
hover_cols
hover_formatters
hover_tooltips
kind
kwds
label
persist
precompute
project
projection
rescale_discrete_levels
robust
row
sort_date
stacked
stream
subplots
symmetric
tiles
tiles_opts
tools
transforms
use_dask
use_index
value_label
```
Most of these options should be added to the signature with their default value (not all, e.g. `kind`).
- [ ] Add missing options to the method signature
Despite these missing options, the signature of `.line()` includes **95** members. 47 of them are style options (e.g. `hover_line_dash_offset`), this group of options being shown in the second position in the signature. 95 is a really high number of keywords, and is nothing compared to e.g. `.heatmap()` with its **217** style options for a total of **268** keyword arguments !
- [x] Style options should be put last
- [ ] See if there's an easy way to reduce the number of these style options for some. It is likely no one ever used `hover_line_dash_offset` with hvPlot (it's undocumented in hvPlot and in HoloViews), should we keep it?
- [ ] Even reduced, there will still be a pretty large number of keywords (for comparison, `pd.read_csv` has 49). Sorting them by name isn't an option, it would be really messy. Some grouping is already in place, let's see if we can improve that.
- [x] Geographic options should be added when relevant.
Contributor guide
Assessment
This issue has not been assessed yet.