Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix API section in docs #480

Merged
merged 1 commit into from
Feb 28, 2024
Merged

Fix API section in docs #480

merged 1 commit into from
Feb 28, 2024

Conversation

timmens
Copy link
Member

@timmens timmens commented Feb 28, 2024

In this PR, I fix the API section in the documentation.

In particular, I restrict plotly to version 5.18 or lower.

When using 5.19, autodoc returned the following error, which is raised in plotly-code that was newly introduced in version 5.19:

WARNING: autodoc: failed to import function 'convergence_plot' from module 'estimagic'; the following exception was raised:
Traceback (most recent call last):
  File "/home/tim/miniforge3/envs/estimagic-docs/lib/python3.9/site-packages/sphinx/ext/autodoc/importer.py", line 62, in import_module
    return importlib.import_module(modname)
  File "/home/tim/miniforge3/envs/estimagic-docs/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/tim/miniforge3/envs/estimagic-docs/lib/python3.9/site-packages/estimagic/__init__.py", line 2, in <module>
    from estimagic.benchmarking.get_benchmark_problems import get_benchmark_problems
  File "/home/tim/miniforge3/envs/estimagic-docs/lib/python3.9/site-packages/estimagic/benchmarking/get_benchmark_problems.py", line 5, in <module>
    from estimagic.benchmarking.cartis_roberts import CARTIS_ROBERTS_PROBLEMS
  File "/home/tim/miniforge3/envs/estimagic-docs/lib/python3.9/site-packages/estimagic/benchmarking/cartis_roberts.py", line 21, in <module>
    from estimagic.config import IS_NUMBA_INSTALLED
  File "/home/tim/miniforge3/envs/estimagic-docs/lib/python3.9/site-packages/estimagic/config.py", line 3, in <module>
    import plotly.express as px
  File "/home/tim/miniforge3/envs/estimagic-docs/lib/python3.9/site-packages/plotly/express/__init__.py", line 14, in <module>
    from ._imshow import imshow
  File "/home/tim/miniforge3/envs/estimagic-docs/lib/python3.9/site-packages/plotly/express/_imshow.py", line 3, in <module>
    from ._core import apply_default_cascade, init_figure, configure_animation_controls
  File "/home/tim/miniforge3/envs/estimagic-docs/lib/python3.9/site-packages/plotly/express/_core.py", line 20, in <module>
    pandas_2_2_0 = version.parse(pd.__version__) >= version.parse("2.2.0")
  File "/home/tim/miniforge3/envs/estimagic-docs/lib/python3.9/site-packages/packaging/version.py", line 54, in parse
    return Version(version)
  File "/home/tim/miniforge3/envs/estimagic-docs/lib/python3.9/site-packages/packaging/version.py", line 198, in __init__
    match = self._regex.search(version)
TypeError: expected string or bytes-like object

@hmgaudecker
Copy link
Member

Wild idea, but would updating Python help?

Copy link

codecov bot commented Feb 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.97%. Comparing base (28ca664) to head (cf4c0e9).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #480   +/-   ##
=======================================
  Coverage   92.97%   92.97%           
=======================================
  Files         193      193           
  Lines       14635    14635           
=======================================
  Hits        13607    13607           
  Misses       1028     1028           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@timmens
Copy link
Member Author

timmens commented Feb 28, 2024

Wild idea, but would updating Python help?

I wrote it down in my notes! We won't look into the details for now, though.

@timmens timmens requested a review from hmgaudecker February 28, 2024 16:58
Copy link
Member

@hmgaudecker hmgaudecker left a comment

Choose a reason for hiding this comment

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

Thanks!

@timmens timmens merged commit 55f05ca into main Feb 28, 2024
15 checks passed
@timmens timmens deleted the fix-docs-api branch February 28, 2024 17:02
@timmens timmens mentioned this pull request Mar 8, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants