Skip to content

Commit 1ea0714

Browse files
committed
update tests, fix warning
1 parent ac5daca commit 1ea0714

File tree

7 files changed

+60
-62
lines changed

7 files changed

+60
-62
lines changed

README.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -154,17 +154,6 @@ To run the tests, just check out this repository and type
154154
pytest
155155
```
156156

157-
### Distribution
158-
159-
To create a new release
160-
161-
1. bump the `__version__` number,
162-
163-
2. publish to PyPi and GitHub:
164-
```
165-
$ make publish
166-
```
167-
168157
### License
169158

170159
matplotlib2tikz is published under the [MIT license](https://en.wikipedia.org/wiki/MIT_License).

doc/conf.py

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,42 +16,43 @@
1616
import os
1717

1818
import mock
19-
MOCK_MODULES = ['matplotlib', 'pipdate']
19+
20+
MOCK_MODULES = ["matplotlib", "pipdate"]
2021
for mod_name in MOCK_MODULES:
2122
sys.modules[mod_name] = mock.Mock()
2223

2324
# If extensions (or modules to document with autodoc) are in another directory,
2425
# add these directories to sys.path here. If the directory is relative to the
2526
# documentation root, use os.path.abspath to make it absolute, like shown here.
26-
sys.path.append(os.path.abspath('../src'))
27+
sys.path.append(os.path.abspath("../src"))
2728

2829
# -- General configuration ----------------------------------------------------
2930

3031
# Add any Sphinx extension module names here, as strings. They can be
3132
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
3233
extensions = [
33-
'sphinx.ext.autodoc',
34-
'sphinx.ext.doctest',
35-
'sphinx.ext.todo',
36-
'sphinx.ext.coverage',
37-
'sphinx.ext.pngmath'
38-
]
34+
"sphinx.ext.autodoc",
35+
"sphinx.ext.doctest",
36+
"sphinx.ext.todo",
37+
"sphinx.ext.coverage",
38+
"sphinx.ext.pngmath",
39+
]
3940

4041
# Add any paths that contain templates here, relative to this directory.
41-
templates_path = ['_templates']
42+
templates_path = ["_templates"]
4243

4344
# The suffix of source filenames.
44-
source_suffix = '.rst'
45+
source_suffix = ".rst"
4546

4647
# The encoding of source files.
4748
# source_encoding = 'utf-8'
4849

4950
# The master toctree document.
50-
master_doc = 'index'
51+
master_doc = "index"
5152

5253
# General information about the project.
53-
project = u'matplotlib2tikz'
54-
copyright = u'2010-2018, Nico Schlömer'
54+
project = u"matplotlib2tikz"
55+
copyright = u"2010-2018, Nico Schlömer"
5556

5657
# The version info for the project you're documenting, acts as replacement for
5758
# |version| and |release|, also used in various other places throughout the
@@ -60,13 +61,13 @@
6061
# https://packaging.python.org/single_source_version/
6162
this_dir = os.path.abspath(os.path.dirname(__file__))
6263
about = {}
63-
about_file = os.path.join(this_dir, '..', 'matplotlib2tikz', '__about__.py')
64+
about_file = os.path.join(this_dir, "..", "matplotlib2tikz", "__about__.py")
6465
with open(about_file) as f:
6566
exec(f.read(), about)
6667
# The short X.Y version.
67-
version = '.'.join(about['__version__'].split('.')[:2])
68+
version = ".".join(about["__version__"].split(".")[:2])
6869
# The full version, including alpha/beta/rc tags.
69-
release = about['__version__']
70+
release = about["__version__"]
7071

7172
# The language for content autogenerated by Sphinx. Refer to documentation
7273
# for a list of supported languages.
@@ -83,7 +84,7 @@
8384

8485
# List of directories, relative to source directory, that shouldn't be searched
8586
# for source files.
86-
exclude_trees = ['_build']
87+
exclude_trees = ["_build"]
8788

8889
# The reST default role (used for this markup: `text`) to use for all
8990
# documents.
@@ -101,7 +102,7 @@
101102
# show_authors = False
102103

103104
# The name of the Pygments (syntax highlighting) style to use.
104-
pygments_style = 'sphinx'
105+
pygments_style = "sphinx"
105106

106107
# A list of ignored prefixes for module index sorting.
107108
# modindex_common_prefix = []
@@ -111,7 +112,7 @@
111112

112113
# The theme to use for HTML and HTML Help pages. Major themes that come with
113114
# Sphinx are currently 'default' and 'sphinxdoc'.
114-
html_theme = 'default'
115+
html_theme = "default"
115116

116117
# Theme options are theme-specific and customize the look and feel of a theme
117118
# further. For a list of options available for each theme, see the
@@ -140,7 +141,7 @@
140141
# Add any paths that contain custom static files (such as style sheets) here,
141142
# relative to this directory. They are copied after the builtin static files,
142143
# so a file named "default.css" will overwrite the builtin "default.css".
143-
html_static_path = ['_static']
144+
html_static_path = ["_static"]
144145

145146
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
146147
# using the given strftime format.
@@ -178,22 +179,27 @@
178179
# html_file_suffix = ''
179180

180181
# Output file base name for HTML help builder.
181-
htmlhelp_basename = 'matplotlib2tikzdoc'
182+
htmlhelp_basename = "matplotlib2tikzdoc"
182183

183184

184185
# -- Options for LaTeX output -------------------------------------------------
185186

186187
# The paper size ('letter' or 'a4').
187-
latex_paper_size = 'a4'
188+
latex_paper_size = "a4"
188189

189190
# The font size ('10pt', '11pt' or '12pt').
190191
# latex_font_size = '10pt'
191192

192193
# Grouping the document tree into LaTeX files. List of tuples (source start
193194
# file, target name, title, author, documentclass [howto/manual]).
194195
latex_documents = [
195-
('index', 'matplotlib2tikz.tex', u'matplotlib2tikz Documentation',
196-
u'Nico Schlömer', 'manual'),
196+
(
197+
"index",
198+
"matplotlib2tikz.tex",
199+
u"matplotlib2tikz Documentation",
200+
u"Nico Schlömer",
201+
"manual",
202+
)
197203
]
198204

199205
# The name of an image file (relative to this directory) to place at the top of

matplotlib2tikz/axes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,8 @@ def _get_label_rotation_and_horizontal_alignment(self, obj, data, x_or_y):
505505
def _get_tick_position(obj, axes_obj):
506506
major_ticks = obj.xaxis.majorTicks if axes_obj == "x" else obj.yaxis.majorTicks
507507

508-
major_ticks_bottom = [tick.tick1On for tick in major_ticks]
509-
major_ticks_top = [tick.tick2On for tick in major_ticks]
508+
major_ticks_bottom = [tick.tick1line.get_visible() for tick in major_ticks]
509+
major_ticks_top = [tick.tick2line.get_visible() for tick in major_ticks]
510510

511511
major_ticks_bottom_show_all = False
512512
if len(set(major_ticks_bottom)) == 1 and major_ticks_bottom[0] is True:

test/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def assert_equality(plot, filename, **extra_get_tikz_code_args):
4343
this_dir = os.path.dirname(os.path.abspath(__file__))
4444
with open(os.path.join(this_dir, filename), "r", encoding="utf-8") as f:
4545
reference = f.read()
46-
assert reference == code, _unidiff_output(reference, code)
46+
assert reference == code, _unidiff_output(code, reference)
4747

4848
code = matplotlib2tikz.get_tikz_code(
4949
include_disclaimer=False, standalone=True, **extra_get_tikz_code_args

test/test_loglogplot_reference.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
tick align=outside,
99
tick pos=left,
1010
x grid style={white!69.01960784313725!black},
11-
xmin=0.501187233627272, xmax=1995262.31496887,
11+
xmin=0.501187233627272, xmax=1995262.31496888,
1212
xmode=log,
1313
xtick style={color=black},
1414
y grid style={white!69.01960784313725!black},
15-
ymin=0.251188643150958, ymax=3981071705534.95,
15+
ymin=0.251188643150958, ymax=3981071705534.97,
1616
ymode=log,
1717
ytick style={color=black}
1818
]

test/test_logplot_reference.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
xtick style={color=black},
1212
y grid style={green!50.0!black},
1313
ymajorgrids,
14-
ymin=0.354813389233575, ymax=2818382931.26444,
14+
ymin=0.354813389233575, ymax=2818382931.26445,
1515
yminorgrids,
1616
ymode=log,
1717
ytick style={color=black}

test/test_tick_positions_reference.tex

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
xmin=0.85, xmax=4.15,
2828
xtick style={color=black},
2929
y grid style={white!69.01960784313725!black},
30+
ymajorticks=false,
3031
ymin=0.6, ymax=9.4,
31-
ytick pos=right,
3232
ytick style={color=black}
3333
]
3434
\addplot [semithick, red, mark=*, mark size=3, mark options={solid}, only marks]
@@ -46,8 +46,8 @@
4646
xmin=0.85, xmax=4.15,
4747
xtick style={color=black},
4848
y grid style={white!69.01960784313725!black},
49+
ymajorticks=false,
4950
ymin=0.6, ymax=9.4,
50-
ytick pos=left,
5151
ytick style={color=black}
5252
]
5353
\addplot [semithick, red, mark=*, mark size=3, mark options={solid}, only marks]
@@ -65,8 +65,8 @@
6565
xmin=0.85, xmax=4.15,
6666
xtick style={color=black},
6767
y grid style={white!69.01960784313725!black},
68+
ymajorticks=false,
6869
ymin=0.6, ymax=9.4,
69-
ytick pos=both,
7070
ytick style={color=black}
7171
]
7272
\addplot [semithick, red, mark=*, mark size=3, mark options={solid}, only marks]
@@ -80,8 +80,8 @@
8080
\nextgroupplot[
8181
tick align=outside,
8282
x grid style={white!69.01960784313725!black},
83+
xmajorticks=false,
8384
xmin=0.85, xmax=4.15,
84-
xtick pos=right,
8585
xtick style={color=black},
8686
y grid style={white!69.01960784313725!black},
8787
ymajorticks=false,
@@ -98,11 +98,12 @@
9898

9999
\nextgroupplot[
100100
tick align=outside,
101-
tick pos=right,
102101
x grid style={white!69.01960784313725!black},
102+
xmajorticks=false,
103103
xmin=0.85, xmax=4.15,
104104
xtick style={color=black},
105105
y grid style={white!69.01960784313725!black},
106+
ymajorticks=false,
106107
ymin=0.6, ymax=9.4,
107108
ytick style={color=black}
108109
]
@@ -117,12 +118,12 @@
117118
\nextgroupplot[
118119
tick align=outside,
119120
x grid style={white!69.01960784313725!black},
121+
xmajorticks=false,
120122
xmin=0.85, xmax=4.15,
121-
xtick pos=right,
122123
xtick style={color=black},
123124
y grid style={white!69.01960784313725!black},
125+
ymajorticks=false,
124126
ymin=0.6, ymax=9.4,
125-
ytick pos=left,
126127
ytick style={color=black}
127128
]
128129
\addplot [semithick, red, mark=*, mark size=3, mark options={solid}, only marks]
@@ -136,12 +137,12 @@
136137
\nextgroupplot[
137138
tick align=outside,
138139
x grid style={white!69.01960784313725!black},
140+
xmajorticks=false,
139141
xmin=0.85, xmax=4.15,
140-
xtick pos=right,
141142
xtick style={color=black},
142143
y grid style={white!69.01960784313725!black},
144+
ymajorticks=false,
143145
ymin=0.6, ymax=9.4,
144-
ytick pos=both,
145146
ytick style={color=black}
146147
]
147148
\addplot [semithick, red, mark=*, mark size=3, mark options={solid}, only marks]
@@ -155,8 +156,8 @@
155156
\nextgroupplot[
156157
tick align=outside,
157158
x grid style={white!69.01960784313725!black},
159+
xmajorticks=false,
158160
xmin=0.85, xmax=4.15,
159-
xtick pos=left,
160161
xtick style={color=black},
161162
y grid style={white!69.01960784313725!black},
162163
ymajorticks=false,
@@ -174,12 +175,12 @@
174175
\nextgroupplot[
175176
tick align=outside,
176177
x grid style={white!69.01960784313725!black},
178+
xmajorticks=false,
177179
xmin=0.85, xmax=4.15,
178-
xtick pos=left,
179180
xtick style={color=black},
180181
y grid style={white!69.01960784313725!black},
182+
ymajorticks=false,
181183
ymin=0.6, ymax=9.4,
182-
ytick pos=right,
183184
ytick style={color=black}
184185
]
185186
\addplot [semithick, red, mark=*, mark size=3, mark options={solid}, only marks]
@@ -192,11 +193,12 @@
192193

193194
\nextgroupplot[
194195
tick align=outside,
195-
tick pos=left,
196196
x grid style={white!69.01960784313725!black},
197+
xmajorticks=false,
197198
xmin=0.85, xmax=4.15,
198199
xtick style={color=black},
199200
y grid style={white!69.01960784313725!black},
201+
ymajorticks=false,
200202
ymin=0.6, ymax=9.4,
201203
ytick style={color=black}
202204
]
@@ -211,12 +213,12 @@
211213
\nextgroupplot[
212214
tick align=outside,
213215
x grid style={white!69.01960784313725!black},
216+
xmajorticks=false,
214217
xmin=0.85, xmax=4.15,
215-
xtick pos=left,
216218
xtick style={color=black},
217219
y grid style={white!69.01960784313725!black},
220+
ymajorticks=false,
218221
ymin=0.6, ymax=9.4,
219-
ytick pos=both,
220222
ytick style={color=black}
221223
]
222224
\addplot [semithick, red, mark=*, mark size=3, mark options={solid}, only marks]
@@ -230,8 +232,8 @@
230232
\nextgroupplot[
231233
tick align=outside,
232234
x grid style={white!69.01960784313725!black},
235+
xmajorticks=false,
233236
xmin=0.85, xmax=4.15,
234-
xtick pos=both,
235237
xtick style={color=black},
236238
y grid style={white!69.01960784313725!black},
237239
ymajorticks=false,
@@ -249,12 +251,12 @@
249251
\nextgroupplot[
250252
tick align=outside,
251253
x grid style={white!69.01960784313725!black},
254+
xmajorticks=false,
252255
xmin=0.85, xmax=4.15,
253-
xtick pos=both,
254256
xtick style={color=black},
255257
y grid style={white!69.01960784313725!black},
258+
ymajorticks=false,
256259
ymin=0.6, ymax=9.4,
257-
ytick pos=right,
258260
ytick style={color=black}
259261
]
260262
\addplot [semithick, red, mark=*, mark size=3, mark options={solid}, only marks]
@@ -268,12 +270,12 @@
268270
\nextgroupplot[
269271
tick align=outside,
270272
x grid style={white!69.01960784313725!black},
273+
xmajorticks=false,
271274
xmin=0.85, xmax=4.15,
272-
xtick pos=both,
273275
xtick style={color=black},
274276
y grid style={white!69.01960784313725!black},
277+
ymajorticks=false,
275278
ymin=0.6, ymax=9.4,
276-
ytick pos=left,
277279
ytick style={color=black}
278280
]
279281
\addplot [semithick, red, mark=*, mark size=3, mark options={solid}, only marks]
@@ -286,11 +288,12 @@
286288

287289
\nextgroupplot[
288290
tick align=outside,
289-
tick pos=both,
290291
x grid style={white!69.01960784313725!black},
292+
xmajorticks=false,
291293
xmin=0.85, xmax=4.15,
292294
xtick style={color=black},
293295
y grid style={white!69.01960784313725!black},
296+
ymajorticks=false,
294297
ymin=0.6, ymax=9.4,
295298
ytick style={color=black}
296299
]

0 commit comments

Comments
 (0)