Skip to content

Commit 4a9577e

Browse files
authored
Merge branch 'master' into no-intersphinx-on-win
2 parents 177f06b + e0e3214 commit 4a9577e

File tree

10 files changed

+49
-30
lines changed

10 files changed

+49
-30
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ __pycache__/
55
# C extensions
66
*.so
77

8-
# MyPy cache
9-
.mypy_cache/
8+
# mypy cache
9+
.mypy_cache
1010

1111
# Distribution / packaging
1212
.Python

ci/conda-recipe/meta.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ requirements:
2525
- fasteners
2626
- sphinx
2727
- sphinx_rtd_theme
28-
# HACK: Should be removed when https://github.com/ipython/ipykernel/pull/489
29-
# is implemented
30-
- jupyter_client <6.0.0
3128

3229
test:
3330
imports:

docs/conf.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@
6969
# The master toctree document.
7070
master_doc = 'index'
7171

72-
autodoc_default_flags = ['show_inheritance', 'autosummary']
72+
autodoc_default_options = {
73+
'show_inheritance': True,
74+
'autosummary': True,
75+
}
76+
7377
autoclass_content = 'both'
7478

7579
not_document_data = ['psyplot_gui.config.rcsetup.defaultParams',
@@ -78,7 +82,7 @@
7882
ipython_savefig_dir = os.path.join(os.path.dirname(__file__), '_static')
7983

8084
# General information about the project.
81-
project = 'psyplot_gui'
85+
project = 'psyplot-gui'
8286
copyright = psyplot_gui.__copyright__
8387
author = psyplot_gui.__author__
8488

@@ -87,7 +91,7 @@
8791
# built documents.
8892
#
8993
# The short X.Y version.
90-
version = re.match('\d+\.\d+\.\d+', psyplot_gui.__version__).group()
94+
version = re.match(r'\d+\.\d+\.\d+', psyplot_gui.__version__).group()
9195
# The full version, including alpha/beta/rc tags.
9296
release = psyplot_gui.__version__
9397

@@ -140,7 +144,7 @@
140144
# (source start file, target name, title,
141145
# author, documentclass [howto, manual, or own class]).
142146
latex_documents = [
143-
(master_doc, 'psyplot_gui.tex', u'psyplot GUI Documentation',
147+
(master_doc, 'psyplot-gui.tex', u'psyplot GUI Documentation',
144148
author, 'manual'),
145149
]
146150

@@ -149,7 +153,7 @@
149153
# One entry per manual page. List of tuples
150154
# (source start file, name, description, authors, manual section).
151155
man_pages = [
152-
(master_doc, 'psyplot_gui', u'psyplot GUI Documentation',
156+
(master_doc, 'psyplot-gui', u'psyplot GUI Documentation',
153157
[author], 1)
154158
]
155159

@@ -159,8 +163,8 @@
159163
# (source start file, target name, title, author,
160164
# dir menu entry, description, category)
161165
texinfo_documents = [
162-
(master_doc, 'psyplot_gui', 'psyplot GUI Documentation',
163-
author, 'psyplot_gui', 'Graphical user interface for the psyplot package',
166+
(master_doc, 'psyplot-gui', u'psyplot GUI Documentation',
167+
author, 'psyplot-gui', 'Graphical user interface for the psyplot package',
164168
'Visualization'),
165169
]
166170

psyplot_gui/help_explorer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from tempfile import mkdtemp
2828
try:
2929
from sphinx.application import Sphinx
30-
from sphinx.util import get_module_source
30+
from sphinx.pycode import ModuleAnalyzer
3131
try:
3232
from psyplot.sphinxext.extended_napoleon import (
3333
ExtendedNumpyDocstring as NumpyDocstring,
@@ -740,7 +740,7 @@ def is_importable(self, modname):
740740
bool
741741
True if sphinx can import the module"""
742742
try:
743-
get_module_source(modname)
743+
ModuleAnalyzer.get_module_source(modname)
744744
return True
745745
except Exception:
746746
return False

psyplot_gui/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,9 @@ def edit_preferences(self, exec_=None):
788788
widget = PrefPageClass(dlg)
789789
widget.initialize()
790790
dlg.add_page(widget)
791-
available_width = 0.667 * QDesktopWidget().availableGeometry().width()
791+
available_width = int(
792+
0.667*QDesktopWidget().availableGeometry().width()
793+
)
792794
width = dlg.sizeHint().width()
793795
height = dlg.sizeHint().height()
794796
# The preferences window should cover at least one third of the screen

psyplot_gui/sphinx_supp/conf.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,17 @@
4444
extensions.append('sphinx.ext.intersphinx')
4545
del use_intersphinx
4646

47-
autodoc_default_flags = ['show_inheritance']
47+
autodoc_default_options = {
48+
'show_inheritance': True
49+
}
4850

4951
try:
5052
import autodocsumm
5153
except ImportError:
5254
pass
5355
else:
5456
extensions.append('autodocsumm')
55-
autodoc_default_flags.append('autosummary')
57+
autodoc_default_options['autosummary'] = True
5658
not_document_data = ['psyplot.config.rcsetup.defaultParams',
5759
'psyplot.config.rcsetup.rcParams']
5860

@@ -74,16 +76,16 @@
7476
autoclass_content = 'both'
7577

7678
# General information about the project.
77-
project = u'Help'
78-
copyright = u'2016, Philipp Sommer'
79-
author = u'Philipp Sommer'
79+
project = 'psyplot Help'
80+
copyright = psyplot_gui.__copyright__
81+
author = psyplot_gui.__author__
8082

8183
# The version info for the project you're documenting, acts as replacement for
8284
# |version| and |release|, also used in various other places throughout the
8385
# built documents.
8486
#
8587
# The short X.Y version.
86-
version = re.match('\d+\.\d+\.\d+', psyplot_gui.__version__).group()
88+
version = re.match(r'\d+\.\d+\.\d+', psyplot_gui.__version__).group()
8789
# The full version, including alpha/beta/rc tags.
8890
release = psyplot_gui.__version__
8991
#

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def run_tests(self):
5858
'psyplot>=1.3.0',
5959
'qtconsole',
6060
'fasteners',
61-
'sphinx',
61+
'sphinx>=2.4.0',
6262
'sphinx_rtd_theme',
6363
],
6464
package_data={'psyplot_gui': [

tests/test_console.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _test_object_docu(self, symbol):
5656
self.insert_text('object')
5757
QTest.keyClicks(c._control, symbol)
5858
sig = '' if six.PY2 else re.sub(
59-
'^\(\s*self,\s*', '(', str(signature(object.__init__)))
59+
r'^\(\s*self,\s*', '(', str(signature(object.__init__)))
6060
header = "object" + sig
6161
bars = '=' * len(header)
6262
self.assertEqual(

tests/test_dataframeeditor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import numpy as np
77
import _base_testing as bt
88
import unittest
9-
from pandas.util.testing import assert_frame_equal
9+
from pandas.testing import assert_frame_equal
1010
from psyplot_gui.compat.qtcompat import Qt, QApplication
1111

1212

tests/test_plot_creator.py

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@
1212
asstring)
1313

1414

15+
def get_col_num(ax):
16+
try:
17+
return ax.get_subplotspec().colspan.start
18+
except AttributeError: # matplotlib<3.2
19+
return ax.colNum
20+
21+
22+
def get_row_num(ax):
23+
try:
24+
return ax.get_subplotspec().rowspan.start
25+
except AttributeError: # matplotlib<3.2
26+
return ax.rowNum
27+
28+
1529
class PlotCreatorTest(bt.PsyPlotGuiTestCase):
1630
"""Tests concerning the plot creator"""
1731

@@ -147,8 +161,8 @@ def test_add_subplots(self):
147161
self.assertEqual([ax.numRows for ax in axes], [2] * nvar)
148162
rows = [0, 0, 1] * nfigs
149163
cols = [0, 1, 0] * nfigs
150-
self.assertEqual([ax.rowNum for ax in axes], rows)
151-
self.assertEqual([ax.colNum for ax in axes], cols)
164+
self.assertEqual([get_row_num(ax) for ax in axes], rows)
165+
self.assertEqual([get_col_num(ax) for ax in axes], cols)
152166
fig_nums = list(chain(*([i] * 3 for i in range(1, nfigs + 1))))
153167
self.assertEqual([ax.get_figure().number for ax in axes], fig_nums)
154168
plt.close('all')
@@ -170,8 +184,8 @@ def test_add_single_subplots(self):
170184
# test rows, cols and figure numbers
171185
self.assertEqual([ax.numCols for ax in axes], [2] * nvar)
172186
self.assertEqual([ax.numRows for ax in axes], [2] * nvar)
173-
self.assertEqual([ax.rowNum for ax in axes], [0] * nvar)
174-
self.assertEqual([ax.colNum for ax in axes], [1] * nvar)
187+
self.assertEqual([get_row_num(ax) for ax in axes], [0] * nvar)
188+
self.assertEqual([get_col_num(ax) for ax in axes], [1] * nvar)
175189
self.assertEqual([ax.get_figure().number for ax in axes], list(
176190
range(1, nvar + 1)))
177191
plt.close('all')
@@ -203,8 +217,8 @@ def test_axescreator_subplots(self):
203217
# test rows, cols and figure numbers
204218
self.assertEqual([ax.numCols for ax in axes], [2] * nvar)
205219
self.assertEqual([ax.numRows for ax in axes], [2] * nvar)
206-
self.assertEqual([ax.rowNum for ax in axes], [0] * nvar)
207-
self.assertEqual([ax.colNum for ax in axes], [1] * nvar)
220+
self.assertEqual([get_row_num(ax) for ax in axes], [0] * nvar)
221+
self.assertEqual([get_col_num(ax) for ax in axes], [1] * nvar)
208222
self.assertEqual([ax.get_figure().number for ax in axes], list(
209223
range(1, nvar + 1)))
210224
# close figures

0 commit comments

Comments
 (0)