question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Optional parameters that are not documented as optional

See original GitHub issue

Describe what maintenance you would like added.

Optional parameters for a function should be documented in numpydoc style.

Links to source code.

See below

Pseudocode or Screenshots

Using the branch from https://github.com/numpy/numpydoc/pull/431 specifically https://github.com/numpy/numpydoc/pull/431/commits/83c4830009362a3be42f1255286bfd0bb364023a

yields a list of parameters that are missing documentation about being optional.

Errror codes
WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.DataSetMapper.set_scalars':
  PR11: Parameter "nan_color" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.Plotter.add_cursor':
  PR11: Parameter "bounds" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.Plotter.show':
  PR11: Parameter "return_img" is optional but not documented, or vice versa
  PR11: Parameter "cpos" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.Renderer.add_bounding_box':
  PR11: Parameter "outline" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.Renderer.enable_anti_aliasing':
  PR11: Parameter "aa_type" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.Renderer.enable_depth_peeling':
  PR11: Parameter "number_of_peels" is optional but not documented, or vice versa
  PR11: Parameter "occlusion_ratio" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.Renderer.get_default_cam_pos':
  PR11: Parameter "negative" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.Renderer.reset_camera':
  PR11: Parameter "render" is optional but not documented, or vice versa
  PR11: Parameter "bounds" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.Renderer.set_background':
  PR11: Parameter "color" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.Renderer.show_bounds':
  PR11: Parameter "mesh" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.Chart2D.show':
  PR11: Parameter "off_screen" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.ChartBox.show':
  PR11: Parameter "off_screen" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.ChartMPL':
  PR11: Parameter "figure" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.ChartMPL.show':
  PR11: Parameter "off_screen" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.ChartPie.show':
  PR11: Parameter "off_screen" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.ChartMPL':
  PR11: Parameter "figure" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.CylinderStructured':
  PR11: Parameter "center" is optional but not documented, or vice versa
  PR11: Parameter "direction" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.Disc':
  PR11: Parameter "center" is optional but not documented, or vice versa
  PR11: Parameter "normal" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.Plane':
  PR11: Parameter "center" is optional but not documented, or vice versa
  PR11: Parameter "direction" is optional but not documented, or vice versa
  PR11: Parameter "i_size" is optional but not documented, or vice versa
  PR11: Parameter "j_size" is optional but not documented, or vice versa
  PR11: Parameter "i_resolution" is optional but not documented, or vice versa
  PR11: Parameter "j_resolution" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.CompositeFilters.cell_centers':
  PR11: Parameter "vertex" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.CompositeFilters.clip':
  PR11: Parameter "normal" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.CompositeFilters.slice':
  PR11: Parameter "normal" is optional but not documented, or vice versa
  PR11: Parameter "origin" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.CompositeFilters.slice_along_axis':
  PR11: Parameter "axis" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.DataSetAttributes.set_scalars':
  PR11: Parameter "name" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.DataSetFilters.cell_centers':
  PR11: Parameter "vertex" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.DataSetFilters.clip':
  PR11: Parameter "normal" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.DataSetFilters.compute_cell_quality':
  PR11: Parameter "quality_measure" is optional but not documented, or vice versa
  PR11: Parameter "null_value" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.DataSetFilters.connectivity':
  PR11: Parameter "largest" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.DataSetFilters.decimate_boundary':
  PR11: Parameter "target_reduction" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.DataSetFilters.merge':
  PR11: Parameter "grid" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.DataSetFilters.slice':
  PR11: Parameter "normal" is optional but not documented, or vice versa
  PR11: Parameter "origin" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.DataSetFilters.slice_along_axis':
  PR11: Parameter "axis" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.DataSetFilters.texture_map_to_sphere':
  PR11: Parameter "center" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.DataSetFilters.threshold':
  PR11: Parameter "component" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.MultiBlock.clean':
  PR11: Parameter "empty" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.PolyDataFilters.tube':
  PR11: Parameter "radius" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.UnstructuredGrid.linear_copy':
  PR11: Parameter "deep" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.utilities.common.sample_function':
  PR11: Parameter "bounds" is optional but not documented, or vice versa
  PR11: Parameter "dim" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.utilities.common.sample_function':
  PR11: Parameter "bounds" is optional but not documented, or vice versa
  PR11: Parameter "dim" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.CylinderStructured':
  PR11: Parameter "center" is optional but not documented, or vice versa
  PR11: Parameter "direction" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.Disc':
  PR11: Parameter "center" is optional but not documented, or vice versa
  PR11: Parameter "normal" is optional but not documented, or vice versa

WARNING: [numpydoc] Validation warnings while processing docstring for 'pyvista.Plane':
  PR11: Parameter "center" is optional but not documented, or vice versa
  PR11: Parameter "direction" is optional but not documented, or vice versa
  PR11: Parameter "i_size" is optional but not documented, or vice versa
  PR11: Parameter "j_size" is optional but not documented, or vice versa
  PR11: Parameter "i_resolution" is optional but not documented, or vice versa
  PR11: Parameter "j_resolution" is optional but not documented, or vice versa

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
MatthewFlammcommented, Oct 11, 2022

#3444 was implemented with the following approach, this is my reading anyway. Use param : int, optional when the default is None, i.e. user can provide an integer, but the default is None. In this case, it would be typical to explain the default behavior in the full description. Use param : int, default=5 when there is an explicit default value. This would overlap more with the usage of Optional in the type signature as well. I like this even more than using either one specifically, but it would require more reviewer maintenance to keep correct.

0reactions
puripantcommented, Oct 13, 2022

Since we agree on how this should be done, I will create another pull request for all other listed optional parameters then.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why should Java 8's Optional not be used in arguments
So my question is: Why is it considered bad practice to use Optional s as method arguments (see solution 1)? It looks like...
Read more >
Optional Parameters - Visual Basic | Microsoft Learn
In this article ... You can specify that a procedure parameter is optional and no argument has to be supplied for it when...
Read more >
Using Python Optional Arguments When Defining Functions
In this tutorial, you'll learn about Python optional arguments and how to define functions with default values. You'll also learn how to create...
Read more >
Using Optional Parameters | FastSpring Classic Documentation
This parameter has many uses within SpringBoard. A tag is a variable that can hold any positive integer value. If no value is...
Read more >
Embed optional parameters not working as documented?
Embed optional parameters not working as documented? ... Constrains the view within the widget to just a file with no actions. User cannot ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found