fix: hv.help() to work outside IPython/Jupyter - #6793
Conversation
a5622c3 to
dd22828
Compare
|
Hi @MarcSkovMadsen, I'm unable to edit the PR title from my end. Could you please change "Fix:" to "fix:" (lowercase) to pass the semantic PR title check? Thanks! |
|
Thanks@hoxbro :) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6793 +/- ##
=======================================
Coverage 89.21% 89.21%
=======================================
Files 334 334
Lines 72362 72364 +2
=======================================
+ Hits 64559 64561 +2
Misses 7803 7803 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| from ..core.pprint import InfoPrinter | ||
| InfoPrinter.store = Store |
There was a problem hiding this comment.
I'm not sure why you have chosen to put it here
Placing it here will only make it work, after you have called hv.extension.
We also need to check whether this store will work on Windows cmd.exe (if you haven't already checked it).
There was a problem hiding this comment.
There was a problem hiding this comment.
The placement is intentional.
I assumed this was the case 😄
... there's nothing to show.
I don't agree with that, there is not much to show but there is still something to show:
Can you take a look at how hard it would be to disable ANSI coloring if we are not in a TTY? In reality I don't think it would matter, but we
E.g. python -c 'import holoviews as hv; hv.core.pprint.InfoPrinter.store = hv.Store; hv.help(hv.Curve)' > example.txt will write the following:
�[1;32mParameters of 'Curve'
=====================
�[0m
�[1;31mParameters changed from their default values are marked in red.�[0m
�[1;36mSoft bound values are marked in cyan.�[0m
C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None
�[1;34mName Value Type Bounds Mode �[0m
group 'Curve' String C RW
label '' String C RW
cdims {} Dict V RW
kdims [Dimension('x')] List (1, 2) C RW
vdims [Dimension('y')] List (1, None) C RW
extents (None, None, None, None) Tuple V RW
datatype ['dataframe', 'dictionary', 'grid', '... List (0, None) V RW
�[1;32mParameter docstrings:
=====================�[0m
�[1;34mgroup: A string describing the data wrapped by the object.�[0m
�[1;31mlabel: Optional label describing the data, typically reflecting where�[0m
�[1;31m or how it was measured. The label should allow a specific�[0m
�[1;31m measurement or dataset to be referenced for a given group.�[0m
�[1;34mcdims: The constant dimensions defined as a dictionary of Dimension:value�[0m
�[1;34m pairs providing additional dimension information about the object.�[0m
�[1;34m �[0m
�[1;34m Aliased with constant_dimensions.�[0m
�[1;31mkdims: The key dimension(s) of a Chart represent the independent�[0m
�[1;31m variable(s).�[0m
�[1;34mvdims: The value dimensions of the Chart, usually corresponding to a�[0m
�[1;34m number of dependent variables.�[0m
�[1;31mextents: Allows overriding the extents of the Element in 2D space defined�[0m
�[1;31m as four-tuple defining the (left, bottom, right and top) edges.�[0m
�[1;34mdatatype: A priority list of the data types to be used for storage�[0m
�[1;34m on the .data attribute. If the input supplied to the element�[0m
�[1;34m constructor cannot be put into the requested format, the next�[0m
�[1;34m format listed will be used until a suitable format is found (or�[0m
�[1;34m the data fails to be understood).�[0m

Description
Fixes #6775 -
hv.help()now provides visualization options (Style Options, Plot Options) when running in plain Python scripts, not just in Jupyter notebooks.Before
After
Checklist