Skip to content

Add module doc string for chaco.api#649

Merged
aaronayres35 merged 5 commits into
masterfrom
api-module-docstrings
Apr 15, 2021
Merged

Add module doc string for chaco.api#649
aaronayres35 merged 5 commits into
masterfrom
api-module-docstrings

Conversation

@aaronayres35
Copy link
Copy Markdown
Contributor

This PR adds a doc string to the api module so that the objects show up in the autogenerated api docs for the api module.

Note, I followed the same grouping as already existed in the api (to keep the diff simple), but we way want to do some shuffling / reorg. For example, BandedMapper is not currently in the "Mappers" section. I can make these changes here if preferred, or leave them to a follow up PR.

Additionally, I am not sure what to do about the "Colormaps and Color Palettes" section (hence it being empty for now), as there are ~80 color maps. Suggestions are very welcome. In that sense this PR is not entirely complete, but I am flagging it as ready for review because I am no longer working on it. We will want to address this before it is merged though.

Comment thread chaco/api.py
- :class:`~.ContourPolyPlot`
- :class:`~.LinePlot`
- :class:`~.ColormappedScatterPlot`
- :class:`~.ColormappedSelectionOverlay`
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ColormappedSelectionOverlay seems more like a visual component

Comment thread chaco/api.py
- :class:`~.MultiLinePlot`
- :class:`~.JitterPlot`
- :class:`~.VariableSizeScatterPlot`
- :class:`~.BandedMapper`
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BandedMapper should be moved to mappers

Copy link
Copy Markdown
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I think this is a good start. We can merge this as-is for now and revisit this later.

Comment thread chaco/api.py
Comment on lines +58 to +61
Colormaps and Color Palettes
----------------------------

-
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was actually thinking of making the * imports from chaco.default_colormaps and chaco.default_colors explicit. It will crowd the api module (and the module docstring) but I think it's better than users having to dig through the source code to find what the available color maps are.

And we can move it to the end of the module (and the module docstring) to maintain readability.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. I will merge this PR and do that in a follow up PR shortly

@aaronayres35
Copy link
Copy Markdown
Contributor Author

CI is failing on windows/pyqt.

======================================================================
ERROR: test_dont_crash_on_click (chaco.tests.test_plot.TestEmptyPlot)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\chaco\chaco\.edm\envs\chaco-test-3.6-pyqt\lib\site-packages\chaco\tests\test_plot.py", line 134, in test_dont_crash_on_click
    [(1, 1), (25, 25), (50, 50), (100, 100)],
  File "D:\a\chaco\chaco\.edm\envs\chaco-test-3.6-pyqt\lib\contextlib.py", line 88, in __exit__
    next(self.gen)
  File "D:\a\chaco\chaco\.edm\envs\chaco-test-3.6-pyqt\lib\site-packages\traitsui\testing\tester\ui_tester.py", line 106, in create_ui
    process_cascade_events()
  File "D:\a\chaco\chaco\.edm\envs\chaco-test-3.6-pyqt\lib\contextlib.py", line 88, in __exit__
    next(self.gen)
  File "D:\a\chaco\chaco\.edm\envs\chaco-test-3.6-pyqt\lib\site-packages\traitsui\testing\_exception_handling.py", line 74, in reraise_exceptions
    raise RuntimeError(msg)
RuntimeError: Uncaught exceptions found.
=== Exception (type: <class 'AttributeError'>, value: '_QtWindow' object has no attribute 'handler') ===
Traceback (most recent call last):
  File "D:\a\chaco\chaco\.edm\envs\chaco-test-3.6-pyqt\lib\site-packages\enable\qt4\base_window.py", line 258, in leaveEvent
    self.handler.leaveEvent(event)
AttributeError: '_QtWindow' object has no attribute 'handler'

----------------------------------------------------------------------

This is the test that was just added in #636. I am not sure why this failure wasn't seen on that PR?

@aaronayres35 aaronayres35 merged commit 3a3231a into master Apr 15, 2021
@aaronayres35 aaronayres35 deleted the api-module-docstrings branch April 15, 2021 11:58
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

Successfully merging this pull request may close these issues.

2 participants