Skip to content

Commit

Permalink
Merge pull request #2149 from hodgestar/feature/update-doc-build-requ…
Browse files Browse the repository at this point in the history
…irements

Update documentation builds to Sphix 6.1 and matplotlib 3.7
  • Loading branch information
hodgestar committed Apr 11, 2023
2 parents 8ceeba0 + 97596db commit fb72696
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 91 deletions.
8 changes: 4 additions & 4 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def qutip_version():
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down Expand Up @@ -252,7 +252,7 @@ def qutip_version():
#
# See:
# - https://docs.mathjax.org/en/v3.0-latest/input/tex/extensions/physics.html
mathjax_config = {
mathjax3_config = {
'TeX': {
'Macros': {
'bra': [r'\left\langle{#1}\right\rvert', 1],
Expand Down Expand Up @@ -362,8 +362,8 @@ def qutip_version():
## EXTLINKS CONFIGURATION ######################################################

extlinks = {
'arxiv': ('https://arxiv.org/abs/%s', 'arXiv:'),
'doi': ('https://dx.doi.org/%s', 'doi:'),
'arxiv': ('https://arxiv.org/abs/%s', 'arXiv:%s'),
'doi': ('https://dx.doi.org/%s', 'doi:%s'),
}

# configuration declares the location of the examples directory for
Expand Down
28 changes: 21 additions & 7 deletions doc/contributors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ Developers
import numpy as np
import matplotlib.pyplot as plt

from matplotlib.path import Path
from matplotlib.patches import PathPatch
from matplotlib.textpath import TextPath
from matplotlib.collections import PolyCollection
from matplotlib.font_manager import FontProperties
import matplotlib.image as mpimg
import PIL


LINK_CONTRIBUTORS = "https://api.github.com/repos/qutip/qutip/contributors"
Expand All @@ -39,8 +40,12 @@ Developers
url_object = urllib.request.urlopen(LINK_CONTRIBUTORS)
list_contributors = json.loads(url_object.read())
qutip_contributors = [element["login"] for element in list_contributors]
qutip_contributors = [s.lower() for s in qutip_contributors]
text = " ".join(qutip_contributors)

# load the QuTiP logo
img = PIL.Image.open(urllib.request.urlopen(LINK_LOGO))

# code below was inspired in the following link:
# https://github.com/dynamicwebpaige/nanowrimo-2021/blob/main/15_VS_Code_contributors.ipynb

Expand All @@ -56,12 +61,21 @@ Developers
L = np.zeros(len(T))
np.cumsum(np.sqrt(((T[1:] - T[:-1]) ** 2).sum(axis=1)), out=L[1:])

path = TextPath((0, 0), text, size=FONT_SIZE,
prop=FontProperties(family=FONT_FAMILY))
Vx, Vy = path.vertices[:, 0], path.vertices[:, 1]
path = TextPath(
(0, 0), text,
size=FONT_SIZE,
prop=FontProperties(family=FONT_FAMILY),
)

vertices = path.vertices
codes = path.codes

Vx, Vy = vertices[:, 0], vertices[:, 1]
X = np.interp(Vx, L, T[:, 0]) + Vy * np.interp(Vx, L, O[:, 0])
Y = np.interp(Vx, L, T[:, 1]) + Vy * np.interp(Vx, L, O[:, 1])
Vx[...], Vy[...] = X, Y
vertices = np.stack([X, Y], axis=-1)

path = Path(vertices, codes, closed=False)

# creating figure
fig, ax = plt.subplots(figsize=(FIGURE_SIZE, FIGURE_SIZE))
Expand All @@ -70,8 +84,7 @@ Developers
ax.set_xlim(-AXIS_SIZE, AXIS_SIZE), ax.set_xticks([])
ax.set_ylim(-AXIS_SIZE, AXIS_SIZE), ax.set_yticks([])

# uncomment lines below to add qutip logo
img = mpimg.imread(LINK_LOGO)
# add qutip logo
ax.imshow(img, alpha=LOGO_TRANSPARENCY,
extent=[-LOGO_SIZE,LOGO_SIZE, -LOGO_SIZE, LOGO_SIZE])

Expand All @@ -88,6 +101,7 @@ Lead Developers
- `Boxi Li <https://github.com/BoxiLi>`_
- `Jake Lishman <https://binhbar.com>`_
- `Simon Cross <http://hodgestar.za.net/>`_
- `Asier Galicia <https://github.com/AGaliciaMartinez>`_

Past Lead Developers
====================
Expand Down
2 changes: 1 addition & 1 deletion doc/guide/dynamics/dynamics-monte.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,4 @@ For example, the following code block plots expectation values for 1, 10 and 100
.. plot::
:context: reset
:include-source: false
:nofigs:
:nofigs:
76 changes: 37 additions & 39 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,50 +1,48 @@
alabaster==0.7.12
appnope==0.1.2
Babel==2.9.1
alabaster==0.7.13
Babel==2.12.1
backcall==0.2.0
certifi==2022.12.7
chardet==4.0.0
cycler==0.10.0
Cython==0.29.23
decorator==5.0.7
docutils==0.16
idna==2.10
imagesize==1.2.0
ipython==8.10.0
ipython-genutils==0.2.0
jedi==0.18.0
Jinja2==2.11.3
kiwisolver==1.3.1
MarkupSafe==1.1.1
matplotlib==3.3.4
numpy==1.22.0
numpydoc==1.1.0
packaging==20.9
parso==0.8.2
Cython==0.29.33
decorator==5.1.1
docutils==0.18.1
idna==3.4
imagesize==1.4.1
ipython==8.11.0
jedi==0.18.2
Jinja2==3.1.2
kiwisolver==1.4.4
MarkupSafe==2.1.2
matplotlib==3.7.1
numpy==1.24.2
numpydoc==1.5.0
packaging==23.0
parso==0.8.3
pexpect==4.8.0
pickleshare==0.7.5
Pillow==9.3.0
prompt-toolkit==3.0.36
Pillow==9.4.0
prompt-toolkit==3.0.38
ptyprocess==0.7.0
Pygments==2.8.1
pyparsing==2.4.7
python-dateutil==2.8.1
pytz==2021.1
Pygments==2.14.0
pyparsing==3.0.9
python-dateutil==2.8.2
pytz==2023.3
requests==2.28.2
scipy==1.10.0
six==1.15.0
snowballstemmer==2.1.0
Sphinx==3.5.4
sphinx-gallery==0.8.2
sphinx-rtd-theme==0.5.2
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-bibtex==2.4.1
scipy==1.10.1
six==1.16.0
snowballstemmer==2.2.0
Sphinx==6.1.3
sphinx-gallery==0.12.2
sphinx-rtd-theme==1.2.0
sphinxcontrib-applehelp==1.0.3
sphinxcontrib-bibtex==2.5.0
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==1.0.3
sphinxcontrib-htmlhelp==2.0.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.4
traitlets==5.0.5
urllib3==1.26.5
wcwidth==0.2.5
wheel==0.38.1
sphinxcontrib-serializinghtml==1.1.5
traitlets==5.9.0
urllib3==1.26.14
wcwidth==0.2.6
wheel==0.38.4
75 changes: 37 additions & 38 deletions doc/rtd-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,55 @@ name: rtd-environment
channels:
- conda-forge
dependencies:
- alabaster==0.7.12
- appnope==0.1.3
- Babel==2.9.1
- alabaster==0.7.13
- Babel==2.12.1
- backcall==0.2.0
- certifi==2022.12.7
- chardet==4.0.0
- cycler==0.10.0
- Cython==0.29.23
- decorator==5.0.7
- docutils==0.16
- idna==2.10
- imagesize==1.2.0
- ipython==8.10.0
- jedi==0.18.0
- Jinja2==2.11.3
- kiwisolver==1.3.1
- MarkupSafe==1.1.1
- matplotlib==3.3.4
- numpy==1.22.0
- numpydoc==1.1.0
- packaging==20.9
- parso==0.8.2
- Cython==0.29.33
- decorator==5.1.1
- docutils==0.18.1
- idna==3.4
- imagesize==1.4.1
- ipython==8.11.0
- jedi==0.18.2
- Jinja2==3.1.2
- kiwisolver==1.4.4
- MarkupSafe==2.1.2
- matplotlib==3.7.1
- numpy==1.24.2
- numpydoc==1.5.0
- packaging==23.0
- parso==0.8.3
- pexpect==4.8.0
- pickleshare==0.7.5
- Pillow==9.4.0
- prompt-toolkit==3.0.36
- prompt-toolkit==3.0.38
- ptyprocess==0.7.0
- Pygments==2.8.1
- pyparsing==2.4.7
- python-dateutil==2.8.1
- pytz==2021.1
- Pygments==2.14.0
- pyparsing==3.0.9
- python-dateutil==2.8.2
- pytz==2023.3
- requests==2.28.2
- scipy==1.10.0
- six==1.15.0
- snowballstemmer==2.1.0
- Sphinx==3.5.4
- sphinx-gallery==0.8.2
- sphinx-rtd-theme==1.1.1
- sphinxcontrib-applehelp==1.0.2
- sphinxcontrib-bibtex==2.4.1
- scipy==1.10.1
- six==1.16.0
- snowballstemmer==2.2.0
- Sphinx==6.1.3
- sphinx-gallery==0.12.2
- sphinx-rtd-theme==1.2.0
- sphinxcontrib-applehelp==1.0.4
- sphinxcontrib-bibtex==2.5.0
- sphinxcontrib-devhelp==1.0.2
- sphinxcontrib-htmlhelp==1.0.3
- sphinxcontrib-htmlhelp==2.0.1
- sphinxcontrib-jsmath==1.0.1
- sphinxcontrib-qthelp==1.0.3
- sphinxcontrib-serializinghtml==1.1.4
- sphinxcontrib-serializinghtml==1.1.5
- suitesparse
- traitlets==5.0.5
- urllib3==1.26.5
- wcwidth==0.2.5
- wheel==0.38.1
- traitlets==5.9.0
- urllib3==1.26.14
- wcwidth==0.2.6
- wheel==0.38.4
- pip
- pip:
- ..[full]
- ..[full]
2 changes: 1 addition & 1 deletion qutip/simdiag.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def simdiag(ops, evals: bool = True, *,
will often be eigenvectors of only the first operator.
Returns
--------
-------
eigs : tuple
Tuple of arrays representing eigvecs and eigvals of quantum objects
corresponding to simultaneous eigenvectors and eigenvalues for each
Expand Down
2 changes: 1 addition & 1 deletion qutip/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ def matrix_histogram(M, xlabels=None, ylabels=None, title=None, limits=None,
'figsize' : tuple of two numbers
The size of the figure.
Returns :
Returns
-------
fig, ax : tuple
A tuple of the matplotlib figure and axes instances used to produce
Expand Down

0 comments on commit fb72696

Please sign in to comment.