Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address sphinx build issues #2332

Merged
merged 4 commits into from
Dec 16, 2024
Merged

Address sphinx build issues #2332

merged 4 commits into from
Dec 16, 2024

Conversation

kandersolar
Copy link
Member

@kandersolar kandersolar commented Dec 16, 2024

  • [ ] Closes #xxxx
  • I am familiar with the contributing guidelines
  • [ ] Tests added
  • [ ] Updates entries in docs/sphinx/source/reference for API changes.
  • [ ] Adds description and name entries in the appropriate "what's new" file in docs/sphinx/source/whatsnew for all changes. Includes link to the GitHub Issue with :issue:`num` or this Pull Request with :pull:`num`. Includes contributor name and/or GitHub username (link with :ghuser:`user`).
  • [ ] New code is fully documented. Includes numpydoc compliant docstrings, examples, and comments where necessary.
  • Pull request is nearly complete and ready for detailed review.
  • Maintainer: Appropriate GitHub Labels (including remote-data) and Milestone are assigned to the Pull Request and linked Issue.

This PR fixes two issues with the documentation build. The first is to prevent the build log from filling up with many instances of this message:

Using default style (tooltip) for unknown typ (obj). Define it in hoverxref_role_types.

The second is an issue with the latest matplotlib release that produces the following error:

https://app.readthedocs.org/projects/pvlib-python/builds/26591140/

WARNING: 
../../examples/shading/plot_martinez_shade_loss.py unexpectedly failed to execute correctly:

    Traceback (most recent call last):
      File "/home/docs/checkouts/readthedocs.org/user_builds/pvlib-python/checkouts/2306/docs/examples/shading/plot_martinez_shade_loss.py", line 256, in <module>
        fig.tight_layout()
      File "/home/docs/checkouts/readthedocs.org/user_builds/pvlib-python/envs/2306/lib/python3.11/site-packages/matplotlib/figure.py", line 3640, in tight_layout
        engine.execute(self)
      File "/home/docs/checkouts/readthedocs.org/user_builds/pvlib-python/envs/2306/lib/python3.11/site-packages/matplotlib/layout_engine.py", line 183, in execute
        kwargs = get_tight_layout_figure(
                 ^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/docs/checkouts/readthedocs.org/user_builds/pvlib-python/envs/2306/lib/python3.11/site-packages/matplotlib/_tight_layout.py", line 266, in get_tight_layout_figure
        kwargs = _auto_adjust_subplotpars(fig, renderer,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/docs/checkouts/readthedocs.org/user_builds/pvlib-python/envs/2306/lib/python3.11/site-packages/matplotlib/_tight_layout.py", line 82, in _auto_adjust_subplotpars
        bb += [martist._get_tightbbox_for_layout_only(ax, renderer)]
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/docs/checkouts/readthedocs.org/user_builds/pvlib-python/envs/2306/lib/python3.11/site-packages/matplotlib/artist.py", line 1402, in _get_tightbbox_for_layout_only
        return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/docs/checkouts/readthedocs.org/user_builds/pvlib-python/envs/2306/lib/python3.11/site-packages/matplotlib/axes/_base.py", line 4519, in get_tightbbox
        ba = martist._get_tightbbox_for_layout_only(axis, renderer)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/docs/checkouts/readthedocs.org/user_builds/pvlib-python/envs/2306/lib/python3.11/site-packages/matplotlib/artist.py", line 1402, in _get_tightbbox_for_layout_only
        return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/docs/checkouts/readthedocs.org/user_builds/pvlib-python/envs/2306/lib/python3.11/site-packages/matplotlib/axis.py", line 1362, in get_tightbbox
        ticks_to_draw = self._update_ticks()
                        ^^^^^^^^^^^^^^^^^^^^
      File "/home/docs/checkouts/readthedocs.org/user_builds/pvlib-python/envs/2306/lib/python3.11/site-packages/matplotlib/axis.py", line 1293, in _update_ticks
        major_labels = self.major.formatter.format_ticks(major_locs)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/docs/checkouts/readthedocs.org/user_builds/pvlib-python/envs/2306/lib/python3.11/site-packages/matplotlib/dates.py", line 799, in format_ticks
        if (self._locator.axis and
            ^^^^^^^^^^^^^^^^^^
    AttributeError: 'str' object has no attribute 'axis'

@kandersolar kandersolar added this to the v0.11.2 milestone Dec 16, 2024
@kandersolar
Copy link
Member Author

With the exception of some whatsnew stuff that will be fixed in the v0.11.2 finalization PR, the build now succeeds with a clean log: https://app.readthedocs.org/api/v2/build/26605245.txt

@kandersolar
Copy link
Member Author

I don't think these changes will spark any controversy, and it is needed to finalize the v0.11.2 release, so I will merge this PR without review.

@kandersolar kandersolar merged commit 0604d9b into pvlib:main Dec 16, 2024
26 checks passed
@kandersolar kandersolar deleted the docs-fix branch December 16, 2024 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant