From 54c2f71d387b2a3b116b89b11149ad0faf293209 Mon Sep 17 00:00:00 2001 From: Fabien Maussion Date: Sun, 11 Feb 2024 19:05:14 +0000 Subject: [PATCH] theme (#238) --- .gitignore | 4 + LICENSE.rst | 2 +- ci/requirements-py311-all.yml | 1 - docs/conf.py | 178 ++++++++++++++++++---------------- docs/environment.yml | 1 + 5 files changed, 99 insertions(+), 87 deletions(-) diff --git a/.gitignore b/.gitignore index 998a561..3912eda 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,10 @@ *.py[cod] __pycache__ .vscode +savefig +.eggs +dist/ +sg_execution_times.rst # PyCharm stuffs .idea/ diff --git a/LICENSE.rst b/LICENSE.rst index 7a2fb96..58c5a35 100644 --- a/LICENSE.rst +++ b/LICENSE.rst @@ -6,7 +6,7 @@ license. Salem uses short parts of the code of the "xarray", "descartes" and "NCL" libraries (when this is the case, this is indicated in the function's docstring). Their licenses are reproduced in the salem/licenses directory. -Copyright (c) 2014-2021, Fabien Maussion and Salem Development Team +Copyright (c) 2014-2024, Fabien Maussion and Salem Development Team All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/ci/requirements-py311-all.yml b/ci/requirements-py311-all.yml index 22a9e6e..8a5be3c 100644 --- a/ci/requirements-py311-all.yml +++ b/ci/requirements-py311-all.yml @@ -3,7 +3,6 @@ channels: - conda-forge dependencies: - python=3.11 - - six - numpy - scipy - pyproj diff --git a/docs/conf.py b/docs/conf.py index a355ebb..3e60b93 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -21,72 +21,86 @@ print("python version:", sys.version) try: import numpy + print("numpy: %s, %s" % (numpy.__version__, numpy.__file__)) except ImportError: print("no numpy") try: import scipy + print("scipy: %s, %s" % (scipy.__version__, scipy.__file__)) except ImportError: print("no scipy") try: import pyproj + print("pyproj: %s, %s" % (pyproj.__version__, pyproj.__file__)) except ImportError: print("no pyproj") try: import joblib + print("joblib: %s, %s" % (joblib.__version__, joblib.__file__)) except ImportError: print("no joblib") try: import rasterio + print("rasterio: %s, %s" % (rasterio.__version__, rasterio.__file__)) except ImportError: print("no rasterio") try: import geopandas + print("geopandas: %s, %s" % (geopandas.__version__, geopandas.__file__)) except ImportError: print("no geopandas") try: import matplotlib - matplotlib.use('Agg') + + matplotlib.use("Agg") print("matplotlib: %s, %s" % (matplotlib.__version__, matplotlib.__file__)) except ImportError: print("no matplotlib") try: import cartopy + print("cartopy: %s, %s" % (cartopy.__version__, cartopy.__file__)) except ImportError: print("no cartopy") try: import netCDF4 + print("netCDF4: %s, %s" % (netCDF4.__version__, netCDF4.__file__)) except ImportError: print("no netCDF4") try: import pandas + print("pandas: %s, %s" % (pandas.__version__, pandas.__file__)) except ImportError: print("no pandas") try: import xarray + print("xarray: %s, %s" % (xarray.__version__, xarray.__file__)) except ImportError: print("no xarray") try: import dask + print("dask: %s, %s" % (dask.__version__, dask.__file__)) except ImportError: print("no dask") try: import IPython + print("ipython: %s, %s" % (IPython.__version__, IPython.__file__)) except ImportError: print("no ipython") try: import sphinx + print("sphinx: %s, %s" % (sphinx.__version__, sphinx.__file__)) except ImportError: print("no sphinx") @@ -106,28 +120,30 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.autosummary', - 'sphinx.ext.intersphinx', - 'sphinx.ext.extlinks', - 'sphinx.ext.mathjax', - 'numpydoc', - 'sphinx.ext.ifconfig', - 'sphinx.ext.viewcode', - 'IPython.sphinxext.ipython_directive', - 'IPython.sphinxext.ipython_console_highlighting', - 'sphinx_gallery.gen_gallery', + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.intersphinx", + "sphinx.ext.extlinks", + "sphinx.ext.mathjax", + "numpydoc", + "sphinx.ext.ifconfig", + "sphinx.ext.viewcode", + "IPython.sphinxext.ipython_directive", + "IPython.sphinxext.ipython_console_highlighting", + "sphinx_gallery.gen_gallery", + 'sphinx_rtd_theme', ] -extlinks = {'issue': ('https://github.com/fmaussion/salem/issues/%s', 'GH%s'), - 'pull': ('https://github.com/fmaussion/salem/pull/%s', 'PR%s'), - } +extlinks = { + "issue": ("https://github.com/fmaussion/salem/issues/%s", "GH%s"), + "pull": ("https://github.com/fmaussion/salem/pull/%s", "PR%s"), +} sphinx_gallery_conf = { # path to your examples scripts - 'examples_dirs': 'examples', + "examples_dirs": "examples", # path where to save gallery generated examples - 'gallery_dirs': 'auto_examples', + "gallery_dirs": "auto_examples", } @@ -139,30 +155,30 @@ ipython_warning_is_error = False # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # source_suffix = ['.rst', '.md'] -source_suffix = '.rst' +source_suffix = ".rst" # The encoding of source files. # source_encoding = 'utf-8-sig' # The master toctree document. -master_doc = 'index' +master_doc = "index" # General information about the project. -project = 'salem' -copyright = '2015-2016, salem Developers' -author = 'salem Developers' +project = "salem" +copyright = "2015-2024, salem Developers" +author = "salem Developers" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = salem.__version__.split('+')[0] +version = salem.__version__.split("+")[0] # The full version, including alpha/beta/rc tags. release = salem.__version__ @@ -171,7 +187,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = 'en' +language = "en" # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: @@ -181,7 +197,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = ['_build'] +exclude_patterns = ["_build"] # The reST default role (used for this markup: `text`) to use for all # documents. @@ -196,13 +212,13 @@ # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. -#show_authors = False +# show_authors = False # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = "sphinx" # A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] +# modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. # keep_warnings = False @@ -215,129 +231,118 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. - -# on_rtd is whether we are on readthedocs.org, this line of code grabbed from -# docs.readthedocs.org - -on_rtd = os.environ.get('READTHEDOCS', None) == 'True' -if not on_rtd: # only import and set the theme if we're building docs locally - import sphinx_rtd_theme - html_theme = 'sphinx_rtd_theme' - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] +html_theme = "sphinx_rtd_theme" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -#html_theme_options = {} +# html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] +# html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". -#html_title = None +# html_title = None # A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None +# html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. -#html_logo = None +# html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. -#html_favicon = None +# html_favicon = None # 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"] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. -#html_extra_path = [] +# html_extra_path = [] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' +# html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. -#html_use_smartypants = True +# html_use_smartypants = True # Custom sidebar templates, maps document names to template names. -#html_sidebars = {} +# html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. -#html_additional_pages = {} +# html_additional_pages = {} # If false, no module index is generated. -#html_domain_indices = True +# html_domain_indices = True # If false, no index is generated. -#html_use_index = True +# html_use_index = True # If true, the index is split into individual pages for each letter. -#html_split_index = False +# html_split_index = False # If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True +# html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True +# html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True +# html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. -#html_use_opensearch = '' +# html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None +# html_file_suffix = None # Language to be used for generating the HTML full-text search index. # Sphinx supports the following languages: # 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja' # 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr' -#html_search_language = 'en' +# html_search_language = 'en' # A dictionary with options for the search language support, empty by default. # Now only 'ja' uses this config value -#html_search_options = {'type': 'default'} +# html_search_options = {'type': 'default'} # The name of a javascript file (relative to the configuration directory) that # implements a search results scorer. If empty, the default will be used. -#html_search_scorer = 'scorer.js' +# html_search_scorer = 'scorer.js' # Output file base name for HTML help builder. -htmlhelp_basename = 'salemdoc' +htmlhelp_basename = "salemdoc" # -- 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', + # 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', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'salem.tex', 'salem Documentation', 'salem Developers', 'manual'), + (master_doc, "salem.tex", "salem Documentation", "salem Developers", "manual"), ] # The name of an image file (relative to this directory) to place at the top of @@ -365,13 +370,10 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [ - (master_doc, 'salem', 'salem Documentation', - [author], 1) -] +man_pages = [(master_doc, "salem", "salem Documentation", [author], 1)] # If true, show URL addresses after external links. -#man_show_urls = False +# man_show_urls = False # -- Options for Texinfo output ------------------------------------------- @@ -380,9 +382,15 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - (master_doc, 'salem', 'salem Documentation', - author, 'salem', 'Geoscientific data analysis and map projections.', - 'Miscellaneous'), + ( + master_doc, + "salem", + "salem Documentation", + author, + "salem", + "Geoscientific data analysis and map projections.", + "Miscellaneous", + ), ] # Documents to append as an appendix to all manuals. @@ -399,7 +407,7 @@ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = { - 'python': ('https://docs.python.org/3.6/', None), - 'pandas': ('http://pandas.pydata.org/pandas-docs/stable/', None), - 'numpy': ('http://docs.scipy.org/doc/numpy/', None), + "python": ("https://docs.python.org/3.6/", None), + "pandas": ("http://pandas.pydata.org/pandas-docs/stable/", None), + "numpy": ("http://docs.scipy.org/doc/numpy/", None), } diff --git a/docs/environment.yml b/docs/environment.yml index ac2aa50..9c3a097 100644 --- a/docs/environment.yml +++ b/docs/environment.yml @@ -22,4 +22,5 @@ dependencies: - pip - pip: # relative to this file. Needs to be editable to be accepted. + - sphinx_rtd_theme - -e .. \ No newline at end of file