Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
ea73b3a
Made fontconfig parser compatible with 3.8.3
cvanelteren Mar 2, 2024
36b8150
Make axes/base.py compatible with mpl: 3.8.3
cvanelteren Mar 2, 2024
62cf31a
Black + compatibility fixes
cvanelteren Mar 2, 2024
53edcc1
Initialize mpl pytests
cvanelteren Mar 2, 2024
6d7ae73
Expaned unittest
cvanelteren Mar 3, 2024
eba0aa3
Fix bug in 3.8.3 where axes are joined rather join
cvanelteren Mar 5, 2024
6e7f1d7
Initialize mpl pytests
cvanelteren Mar 2, 2024
2e32de1
Expaned unittest
cvanelteren Mar 3, 2024
17e1283
Added micromamba environment for reproducible builds
cvanelteren Jul 24, 2024
60ec01b
Added pandas to env
cvanelteren Jul 24, 2024
9d1f659
Added a variety of tests
cvanelteren Jul 24, 2024
f235e30
Freezing baseline
cvanelteren Jul 24, 2024
7c815bf
Added Luke's tests
cvanelteren Jul 24, 2024
1f06f10
Add tests and ci instructions [Luke's tests]
lukelbd Mar 26, 2023
549052a
Merge remote-tracking branch 'origin/unittest' into HEAD
cvanelteren Jul 24, 2024
034ed7e
Merge remote-tracking branch 'origin/unittest' into mpl3.9.1
cvanelteren Jul 25, 2024
f620d61
Fixed issue where prop_keys are missing
cvanelteren Jul 25, 2024
5d0c92f
Removed global function and properly wrap cmap if neccessary
cvanelteren Jul 25, 2024
76818d7
Updated mpl version
cvanelteren Jul 25, 2024
30d9551
Ensure compatibility with mpl3.91
cvanelteren Jul 25, 2024
1f3e4ed
Remove conflicting yml file
cvanelteren Jul 26, 2024
51a8308
Added some comments and removed the uggly break statement
cvanelteren Jul 27, 2024
265037a
Added some comments and removed the uggly break statement
cvanelteren Jul 27, 2024
75378bc
Merge remote-tracking branch 'refs/remotes/origin/mpl3.9.1' into mpl3…
cvanelteren Jul 27, 2024
e93f2b5
Future proof contour axes to be compatible with future mpl releases
cvanelteren Jul 27, 2024
10c4f3e
Minor fixes
cvanelteren Jul 27, 2024
b0c78ac
Unified tests
cvanelteren Jul 28, 2024
41e1539
Unifying tests
cvanelteren Jul 28, 2024
28235a1
Merge remote-tracking branch 'refs/remotes/origin/mpl3.9.1' into mpl3…
cvanelteren Jul 28, 2024
5496503
fixed keyword not being delegated when getting an array as keyword
cvanelteren Jul 28, 2024
843a6ae
fixed boxplot hatches
cvanelteren Jul 28, 2024
f2a4eb3
Remove unnecessary import
cvanelteren Jul 28, 2024
73ca163
Improve readability
cvanelteren Jul 28, 2024
17dc73d
Use native mpl colormaps to register proplot cmaps
cvanelteren Jul 28, 2024
0c340ed
Add hatch to box plot
cvanelteren Jul 28, 2024
61495d9
Add hatch handling to violinplot
cvanelteren Jul 28, 2024
d09f66d
fix spelling error check in hatch retrieval for violinplots
cvanelteren Jul 28, 2024
2e96095
All 1d plots pass
cvanelteren Jul 28, 2024
da966b8
Modified test as it no longer produces error
cvanelteren Jul 28, 2024
541b05d
Removed in favor of existing more extensive test
cvanelteren Jul 28, 2024
e3f5247
2d plots pass now, but vcenter in pcolor is ignored
cvanelteren Jul 28, 2024
7798e2b
Removed some test as I am not sure what they do
cvanelteren Jul 28, 2024
b1206c2
Removed more tests that contain vcenter
cvanelteren Jul 28, 2024
265721c
Replaced warnings to pytest native
cvanelteren Jul 28, 2024
2f601dd
updated test
cvanelteren Jul 28, 2024
3c7e7b1
Added refwidth to figure
cvanelteren Jul 28, 2024
bf8b23f
restored compatibility with cartopy
Jul 30, 2024
081e009
German locale not available for me, setting to us for now
cvanelteren Jul 30, 2024
a72e6f1
All tests passing
cvanelteren Jul 30, 2024
450664e
Rename test to globe
cvanelteren Jul 30, 2024
5e15d93
Black formatting + finalizing tests
cvanelteren Jul 30, 2024
cac8f08
Bump in requirements
cvanelteren Aug 6, 2024
6ebb1c2
Update basemap
cvanelteren Aug 6, 2024
04ac583
Black on conf.py
cvanelteren Aug 6, 2024
0c32c54
Added access to axes test
cvanelteren Aug 6, 2024
ccb1086
Create a git workflow with dependencies for the docs
cvanelteren Aug 6, 2024
3ded6f6
Replaced number checking using built-in numbers module
cvanelteren Aug 6, 2024
188c5b9
Unified the numeric calls
cvanelteren Aug 6, 2024
5a7a855
Pythonic string checking added to colormapdatabase
cvanelteren Aug 6, 2024
2023c09
Replace mpl colormaps by ColormapDatabase
cvanelteren Aug 7, 2024
7365bf4
Replace registrating colorbases with the mpl new way
cvanelteren Aug 7, 2024
210a5b3
Writing some comments to explain the behavior
cvanelteren Aug 7, 2024
a0a782f
Re-register builtin matplotlib as proplot colormaps
cvanelteren Aug 7, 2024
7da6814
replaced odd error -- all tests pass
cvanelteren Aug 7, 2024
d57908d
Added fixme statement -- fine for now
cvanelteren Aug 7, 2024
952e293
added os in build as per sphinx docs
cvanelteren Aug 7, 2024
6eb2df1
Added build tools to readthedocs.yml
cvanelteren Aug 7, 2024
be1f9de
Update the build command
cvanelteren Aug 7, 2024
e41a6fd
Black formatting doc files
cvanelteren Aug 7, 2024
4ed8506
Remapped seaborn reference to be compliant with mpl
cvanelteren Aug 7, 2024
0174ecb
Removed non-compliant mpl call
cvanelteren Aug 7, 2024
f50d2ca
Fixed a bug that cmap are not properly registered when calling cmashe…
cvanelteren Aug 8, 2024
c6ee64f
Formatting
cvanelteren Aug 8, 2024
b312227
Set interpolation default to off
cvanelteren Aug 9, 2024
cd3d9da
Mpl does not allow for integer colors anymore
cvanelteren Aug 12, 2024
55a247e
Fixed build issue with read the docs
cvanelteren Aug 12, 2024
c8d2838
Fixed numpy version
cvanelteren Aug 12, 2024
ab67205
Added geographic test
cvanelteren Aug 14, 2024
cab8b46
Removed error since basemap can be installed
cvanelteren Aug 14, 2024
5399804
Lower python requirements
cvanelteren Aug 14, 2024
a04b5f7
Test build
cvanelteren Aug 14, 2024
06a5687
Finalize colormaps. API now completely matches how mpl does it
cvanelteren Aug 14, 2024
476bef6
Convert str paths to pathlib as per warning sphinx
cvanelteren Aug 14, 2024
c78a550
Black formatting
cvanelteren Aug 14, 2024
2c1b073
Removing setup.py/cfg in favor of streamlined pyproject.toml
cvanelteren Aug 14, 2024
cdfac30
Add pytest to the build jobs and updated dependency
cvanelteren Aug 16, 2024
b566b2d
Added local handling for readthedocs
cvanelteren Aug 16, 2024
acdb1b2
Fixed theme not building
cvanelteren Aug 17, 2024
5d81997
Restore idx for colors
cvanelteren Aug 17, 2024
ff2b4de
Fix numpy below 2.0 due to xarray
cvanelteren Aug 20, 2024
06b741a
Attempting to fix timout with autoapi
cvanelteren Aug 20, 2024
3dd31af
Add autoapi to req
cvanelteren Aug 20, 2024
f7524a2
Correct import on autoapi
cvanelteren Aug 20, 2024
4ecd614
fixed scatter color cycling
cvanelteren Sep 30, 2024
4f040c7
removed doctest show
cvanelteren Sep 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Black on conf.py
  • Loading branch information
cvanelteren committed Aug 6, 2024
commit 04ac583c55e44dde1b211303eff8f56daaee0cac
201 changes: 99 additions & 102 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,48 +18,50 @@
import subprocess

# Update path for sphinx-automodapi and sphinxext extension
sys.path.append(os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('..'))
sys.path.append(os.path.abspath("."))
sys.path.insert(0, os.path.abspath(".."))

# Print available system fonts
from matplotlib.font_manager import fontManager
print('Font files:', end=' ')
print(', '.join(os.path.basename(font.fname) for font in fontManager.ttflist))

print("Font files:", end=" ")
print(", ".join(os.path.basename(font.fname) for font in fontManager.ttflist))


# -- Project information -------------------------------------------------------
# The basic info
project = 'ProPlot'
copyright = f'{datetime.datetime.today().year}, Luke L. B. Davis'
author = 'Luke L. B. Davis'
project = "ProPlot"
copyright = f"{datetime.datetime.today().year}, Luke L. B. Davis"
author = "Luke L. B. Davis"

# The short X.Y version
version = ''
version = ""

# The full version, including alpha/beta/rc tags
release = ''
release = ""


# -- Create files --------------------------------------------------------------

# Create RST table and sample proplotrc file
from proplot.config import rc
folder = os.path.join(os.path.dirname(os.path.abspath(__file__)), '_static')

folder = os.path.join(os.path.dirname(os.path.abspath(__file__)), "_static")
if not os.path.isdir(folder):
os.mkdir(folder)
rc._save_rst(os.path.join(folder, 'rctable.rst'))
rc._save_yaml(os.path.join(folder, 'proplotrc'))
rc._save_rst(os.path.join(folder, "rctable.rst"))
rc._save_yaml(os.path.join(folder, "proplotrc"))

# -- Setup basemap --------------------------------------------------------------

# Hack to get basemap to work
# See: https://github.com/readthedocs/readthedocs.org/issues/5339
if os.environ.get('READTHEDOCS', None) == 'True':
conda = os.path.join(os.environ['CONDA_ENVS_PATH'], os.environ['CONDA_DEFAULT_ENV'])
if os.environ.get("READTHEDOCS", None) == "True":
conda = os.path.join(os.environ["CONDA_ENVS_PATH"], os.environ["CONDA_DEFAULT_ENV"])
else:
conda = os.environ['CONDA_PREFIX']
os.environ['GEOS_DIR'] = conda
os.environ['PROJ_LIB'] = os.path.join(conda, 'share', 'proj')
conda = os.environ["CONDA_PREFIX"]
os.environ["GEOS_DIR"] = conda
os.environ["PROJ_LIB"] = os.path.join(conda, "share", "proj")

# Install basemap if does not exist
# Extremely ugly but impossible to install in environment.yml. Must set
Expand All @@ -82,36 +84,43 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
# 'matplotlib.sphinxext.plot_directive', # see: https://matplotlib.org/sampledoc/extensions.html # noqa: E501
'sphinx.ext.autodoc', # include documentation from docstrings
'sphinx.ext.doctest', # >>> examples
'sphinx.ext.extlinks', # for :pr:, :issue:, :commit:
'sphinx.ext.autosectionlabel', # use :ref:`Heading` for any heading
'sphinx.ext.todo', # Todo headers and todo:: directives
'sphinx.ext.mathjax', # LaTeX style math
'sphinx.ext.viewcode', # view code links
'sphinx.ext.napoleon', # for NumPy style docstrings
'sphinx.ext.intersphinx', # external links
'sphinx.ext.autosummary', # autosummary directive
'sphinxext.custom_roles', # local extension
'sphinx_automodapi.automodapi', # fork of automodapi
'sphinx_rtd_light_dark', # use custom theme
'sphinx_copybutton', # add copy button to code
'nbsphinx', # parse rst books
"sphinx.ext.autodoc", # include documentation from docstrings
"sphinx.ext.doctest", # >>> examples
"sphinx.ext.extlinks", # for :pr:, :issue:, :commit:
"sphinx.ext.autosectionlabel", # use :ref:`Heading` for any heading
"sphinx.ext.todo", # Todo headers and todo:: directives
"sphinx.ext.mathjax", # LaTeX style math
"sphinx.ext.viewcode", # view code links
"sphinx.ext.napoleon", # for NumPy style docstrings
"sphinx.ext.intersphinx", # external links
"sphinx.ext.autosummary", # autosummary directive
"sphinxext.custom_roles", # local extension
"sphinx_automodapi.automodapi", # fork of automodapi
"sphinx_rtd_light_dark", # use custom theme
"sphinx_copybutton", # add copy button to code
"nbsphinx", # parse rst books
]

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# The suffix(es) of source filenames, either a string or list.
source_suffix = ['.rst', '.html']
source_suffix = [".rst", ".html"]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# List of file patterns relative to source dir that should be ignored
exclude_patterns = [
'conf.py', 'sphinxext', '_build', '_templates', '_themes',
'*.ipynb', '**.ipynb_checkpoints' '.DS_Store', 'trash', 'tmp',
"conf.py",
"sphinxext",
"_build",
"_templates",
"_themes",
"*.ipynb",
"**.ipynb_checkpoints" ".DS_Store",
"trash",
"tmp",
]

# The language for content autogenerated by Sphinx. Refer to documentation
Expand All @@ -120,15 +129,15 @@

# Role. Default family is py but can also set default role so don't need
# :func:`name`, :module:`name`, etc.
default_role = 'py:obj'
default_role = "py:obj"

# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
add_module_names = False # proplot imports everything in top-level namespace

# Autodoc configuration. Here we concatenate class and __init__ docstrings
# See: http://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html
autoclass_content = 'both' # options are 'class', 'both', 'init'
autoclass_content = "both" # options are 'class', 'both', 'init'

# Generate stub pages whenever ::autosummary directive encountered
# This way don't have to call sphinx-autogen manually
Expand All @@ -137,40 +146,40 @@
# Automodapi tool: https://sphinx-automodapi.readthedocs.io/en/latest/automodapi.html
# Normally have to *enumerate* function names manually. This will document them
# automatically. Just be careful to exclude public names from automodapi:: directive.
automodapi_toctreedirnm = 'api'
automodapi_toctreedirnm = "api"
automodsumm_inherited_members = False

# Doctest configuration. For now do not run tests, they are just to show syntax
# and expected output may be graphical
doctest_test_doctest_blocks = ''
doctest_test_doctest_blocks = ""

# Cupybutton configuration
# See: https://sphinx-copybutton.readthedocs.io/en/latest/
copybutton_prompt_text = r'>>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: '
copybutton_prompt_text = r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: "
copybutton_prompt_is_regexp = True
copybutton_only_copy_prompt_lines = True
copybutton_remove_prompts = True

# Links for What's New github commits, issues, and pull requests
extlinks = {
'issue': ('https://github.com/proplot-dev/proplot/issues/%s', 'GH#'),
'commit': ('https://github.com/proplot-dev/proplot/commit/%s', '@'),
'pr': ('https://github.com/proplot-dev/proplot/pull/%s', 'GH#'),
"issue": ("https://github.com/proplot-dev/proplot/issues/%s", "GH#"),
"commit": ("https://github.com/proplot-dev/proplot/commit/%s", "@"),
"pr": ("https://github.com/proplot-dev/proplot/pull/%s", "GH#"),
}

# Set up mapping for other projects' docs
intersphinx_mapping = {
'cycler': ('https://matplotlib.org/cycler/', None),
'matplotlib': ('https://matplotlib.org/stable', None),
'sphinx': ('http://www.sphinx-doc.org/en/stable', None),
'python': ('https://docs.python.org/3', None),
'numpy': ('https://docs.scipy.org/doc/numpy', None),
'scipy': ('https://docs.scipy.org/doc/scipy/reference', None),
'xarray': ('http://xarray.pydata.org/en/stable', None),
'cartopy': ('https://scitools.org.uk/cartopy/docs/latest', None),
'basemap': ('https://matplotlib.org/basemap', None),
'pandas': ('https://pandas.pydata.org/pandas-docs/stable', None),
'pint': ('https://pint.readthedocs.io/en/stable/', None),
"cycler": ("https://matplotlib.org/cycler/", None),
"matplotlib": ("https://matplotlib.org/stable", None),
"sphinx": ("http://www.sphinx-doc.org/en/stable", None),
"python": ("https://docs.python.org/3", None),
"numpy": ("https://docs.scipy.org/doc/numpy", None),
"scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
"xarray": ("http://xarray.pydata.org/en/stable", None),
"cartopy": ("https://scitools.org.uk/cartopy/docs/latest", None),
"basemap": ("https://matplotlib.org/basemap", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
"pint": ("https://pint.readthedocs.io/en/stable/", None),
}

# Fix duplicate class member documentation from autosummary + numpydoc
Expand Down Expand Up @@ -198,21 +207,21 @@
napoleon_type_aliases = {
# Python or inherited terms
# NOTE: built-in types are automatically included
'callable': ':py:func:`callable`',
'sequence': ':term:`sequence`',
'dict-like': ':term:`dict-like <mapping>`',
'path-like': ':term:`path-like <path-like object>`',
'array-like': ':term:`array-like <array_like>`',
"callable": ":py:func:`callable`",
"sequence": ":term:`sequence`",
"dict-like": ":term:`dict-like <mapping>`",
"path-like": ":term:`path-like <path-like object>`",
"array-like": ":term:`array-like <array_like>`",
# Proplot defined terms
'unit-spec': ':py:func:`unit-spec <proplot.utils.units>`',
'locator-spec': ':py:func:`locator-spec <proplot.constructor.Locator>`',
'formatter-spec': ':py:func:`formatter-spec <proplot.constructor.Formatter>`',
'scale-spec': ':py:func:`scale-spec <proplot.constructor.Scale>`',
'colormap-spec': ':py:func:`colormap-spec <proplot.constructor.Colormap>`',
'cycle-spec': ':py:func:`cycle-spec <proplot.constructor.Cycle>`',
'norm-spec': ':py:func:`norm-spec <proplot.constructor.Norm>`',
'color-spec': ':py:func:`color-spec <matplotlib.colors.is_color_like>`',
'artist': ':py:func:`artist <matplotlib.artist.Artist>`',
"unit-spec": ":py:func:`unit-spec <proplot.utils.units>`",
"locator-spec": ":py:func:`locator-spec <proplot.constructor.Locator>`",
"formatter-spec": ":py:func:`formatter-spec <proplot.constructor.Formatter>`",
"scale-spec": ":py:func:`scale-spec <proplot.constructor.Scale>`",
"colormap-spec": ":py:func:`colormap-spec <proplot.constructor.Colormap>`",
"cycle-spec": ":py:func:`cycle-spec <proplot.constructor.Cycle>`",
"norm-spec": ":py:func:`norm-spec <proplot.constructor.Norm>`",
"color-spec": ":py:func:`color-spec <matplotlib.colors.is_color_like>`",
"artist": ":py:func:`artist <matplotlib.artist.Artist>`",
}

# Fail on error. Note nbsphinx compiles all notebooks in docs unless excluded
Expand All @@ -222,34 +231,34 @@
nbsphinx_timeout = 300

# Add jupytext support to nbsphinx
nbsphinx_custom_formats = {'.py': ['jupytext.reads', {'fmt': 'py:percent'}]}
nbsphinx_custom_formats = {".py": ["jupytext.reads", {"fmt": "py:percent"}]}

# The name of the Pygments (syntax highlighting) style to use.
# The light-dark theme toggler overloads this, but set default anyway
pygments_style = 'none'
pygments_style = "none"


# -- Options for HTML output -------------------------------------------------

# Logo
html_logo = os.path.join('_static', 'logo_square.png')
html_logo = os.path.join("_static", "logo_square.png")

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
# Use modified RTD theme with overrides in custom.css and custom.js
html_theme = 'sphinx_rtd_light_dark'
html_theme = "sphinx_rtd_light_dark"
html_theme_options = {
'logo_only': True,
'display_version': False,
'collapse_navigation': True,
'navigation_depth': 4,
'prev_next_buttons_location': 'bottom', # top and bottom
"logo_only": True,
"display_version": False,
"collapse_navigation": True,
"navigation_depth": 4,
"prev_next_buttons_location": "bottom", # top and bottom
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand All @@ -263,26 +272,23 @@
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large. Static folder is for CSS and image files. Use ImageMagick to
# convert png to ico on command line with 'convert image.png image.ico'
html_favicon = os.path.join('_static', 'logo_blank.ico')
html_favicon = os.path.join("_static", "logo_blank.ico")

# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'proplotdoc'
htmlhelp_basename = "proplotdoc"


# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
# 'preamble': '',

# Latex figure (float) alignment
# 'figure_align': 'htbp',
}
Expand All @@ -291,24 +297,15 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'proplot.tex', 'ProPlot Documentation',
'Luke L. B. Davis', 'manual'),
(master_doc, "proplot.tex", "ProPlot Documentation", "Luke L. B. Davis", "manual"),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(
master_doc,
'proplot',
'ProPlot Documentation',
[author],
1
)
]
man_pages = [(master_doc, "proplot", "ProPlot Documentation", [author], 1)]


# -- Options for Texinfo output ----------------------------------------------
Expand All @@ -319,13 +316,13 @@
texinfo_documents = [
(
master_doc,
'proplot',
'ProPlot Documentation',
"proplot",
"ProPlot Documentation",
author,
'proplot',
'A succinct matplotlib wrapper for making beautiful, '
'publication-quality graphics.',
'Miscellaneous'
"proplot",
"A succinct matplotlib wrapper for making beautiful, "
"publication-quality graphics.",
"Miscellaneous",
)
]

Expand Down