Skip to content

Documentation Gaps Found in Panel Components #7984

Open
@ritu456286

Description

@ritu456286

For an application that programmatically retrieves parameter docstrings from Panel components (Layouts, Widgets, Panes), it's been observed that:

  1. 40 parameters of various panel components are not documented within the component's __doc__ attribute.
  2. 35 Panel components are not present in the Component Gallery, though they are present in the API docs.
  3. 6 Panel components are not documented within the component's __doc__ attribute.

panel version == 1.6.1

Expected Behavior:

  1. The __doc__ attribute for Panel components should include docstrings for all their parameters, allowing for introspection and use by documentation generation tools.
  2. The component gallery should include pages for all available Panel components.
  3. The __doc__ attribute for all Panel components should not be null.

Observed Behavior:

  1. Many of the parameters did not have any docstrings mentioned. For example, for DatePicker component, the docstrings for disabled_dates and enabled_dates parameters were missing:
  2. After analysis, 35 Panel components are missing their documentation from the component gallery.
  3. After analysis, 6 Panel components have empty descriptions in their __doc__ attribute.

Complete, minimal, self-contained example code that reproduces the issue

1. Analysis of missing parameter docs from __doc__ attribute

print(pn.widgets.DatePicker.__doc__) # this should give docstrings for all the parameters of DatePicker

Console Output

disabled_dates: < No docstring available >
enabled_dates:  < No docstring available >

2. Analysis of missing components in the Component Gallery

# Check if ArrayInput notebook exists in GitHub - Component Gallery
notebook_path = Path("panel/examples/reference/widgets/ArrayInput.ipynb")
print(f"ArrayInput notebook exists: {notebook_path.exists()}")

# But the component exists in Panel with documentation
print(f"ArrayInput has __doc__: {bool(pn.widgets.ArrayInput.__doc__)}")

Console Output

ArrayInput notebook exists: False
ArrayInput has __doc__: True

3. Analysis of Missing Documentation for 6 Components

print(pn.layout.ListLike.__doc__)

Console Output

Parameters of 'ListLike'
========================

Parameters changed from their default values are marked in red.
Soft bound values are marked in cyan.
C/V= Constant/Variable, RO/RW = ReadOnly/ReadWrite, AN=Allow None

Name     Value   Type      Bounds   Mode 

objects   []  Children  (0, None)  V RW 

Parameter docstrings:
=====================

objects: The list of child objects that make up the layout.

Conclusion

  1. After analysis, I have found the following parameters are missing their docstrings in the __doc__ attribute for the specified components:
Component Parameter Name
panel.pane.alert.Alert alert_type
panel.pane.plot.RGGPlot dpi
panel.pane.vega.Vega theme
panel.pane.vtk.vtk.VTKVolume interactive_orientation_widget
panel.pane.vtk.vtk.VTKVolume origin
panel.widgets.input.ArrayInput type
panel.widgets.input.LiteralInput type
panel.widgets.select.AutocompleteInput options
panel.widgets.select.CheckBoxGroup options
panel.widgets.select.CheckButtonGroup options
panel.widgets.select.CrossSelector options
panel.widgets.player.DiscretePlayer options
panel.widgets.select.MultiChoice options
panel.widgets.select.MultiSelect options
panel.widgets.select.RadioBoxGroup options
panel.widgets.select.RadioButtonGroup options
panel.widgets.select.Select options
panel.widgets.select.ToggleGroup options
panel.widgets.slider.DateRangeSlider bar_color
panel.widgets.slider.DatetimeRangeSlider bar_color
panel.widgets.slider.DateSlider bar_color
panel.widgets.slider.DatetimeSlider bar_color
panel.widgets.slider.EditableFloatSlider bar_color
panel.widgets.slider.EditableIntSlider bar_color
panel.widgets.slider.EditableRangeSlider bar_color
panel.widgets.slider.FloatSlider bar_color
panel.widgets.slider.IntRangeSlider bar_color
panel.widgets.slider.IntSlider bar_color
panel.widgets.indicators.Progress bar_color
panel.widgets.slider.RangeSlider bar_color
panel.widgets.input.DatePicker disabled_dates
panel.widgets.input.DateRangePicker disabled_dates
panel.widgets.input.DatePicker enabled_dates
panel.widgets.input.DateRangePicker enabled_dates
panel.widgets.input.DatetimePicker mode
panel.widgets.input.DatetimeRangePicker mode
panel.widgets.indicators.LoadingSpinner bgcolor
panel.widgets.indicators.LoadingSpinner color
panel.widgets.tables.Tabulator layout
panel.widgets.indicators.Trend layout
panel.widgets.tables.Tabulator pagination
  1. The following 35 panel components are missing from the Component Gallery:
1. pn.pane.ICO
2. pn.pane.Interactive
3. pn.pane.IPyLeaflet
4. pn.pane.Pane
5. pn.pane.PaneBase
6. pn.pane.ParamFunction
7. pn.pane.ParamMethod
8. pn.pane.ParamRef
9. pn.pane.panel
10. pn.pane.RGGPlot
11. [pn.pane.YT](http://pn.pane.yt/)
12. pn.widgets.BooleanStatus
13. pn.widgets.CompositeWidget
14. pn.widgets.Dial
15. pn.widgets.Gauge
16. pn.widgets.Grammar
17. pn.widgets.GrammarList
18. pn.widgets.LinearGauge
19. pn.widgets.LoadingSpinner
20. pn.widgets.Number
21. pn.widgets.NumberInput
22. pn.widgets.Progress
23. pn.widgets.Spinner
24. pn.widgets.TooltipIcon
25. pn.widgets.Tqdm
26. pn.widgets.Trend
27. pn.widgets.Utterance
28. pn.widgets.Voice
29. pn.widgets.Widget
30. pn.layout.HSpacer
31. pn.layout.ListLike
32. pn.layout.ListPanel
33. pn.layout.Panel
34. pn.layout.Spacer
35. pn.layout.VSpacer
  1. The following 6 Panel components do not have documentation available via the __doc__ attribute:
1. pn.pane.Interactive
2. pn.layout.ListLike
3. pn.widgets.Spinner
4. pn.widgets.NumberInput
5. pn.pane.Reacton
6. pn.pane.IPyLeaflet

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions