Skip to content

Commit

Permalink
Fix pytest warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dean0x7d committed May 27, 2017
1 parent 9e5ee53 commit 5ea1e60
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/examples/lattice/phosphorene.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ def phosphorene_4band():
kx = pi / ax
ky = pi / ay
bands = solver.calc_bands([kx, ky], [kx, 0], [0, 0], [0, ky], [kx, ky])
bands.plot(point_labels=['S', 'Y', '$\Gamma$', 'X', 'S'])
bands.plot(point_labels=["S", "Y", r"$\Gamma$", "X", "S"])
plt.show()


model.lattice.plot_brillouin_zone(decorate=False)
bands.plot_kpath(point_labels=['S', 'Y', '$\Gamma$', 'X', 'S'])
bands.plot_kpath(point_labels=["S", "Y", r"$\Gamma$", "X", "S"])
plt.show()
2 changes: 1 addition & 1 deletion docs/examples/ribbons/bilayer_graphene.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ def bilayer_graphene():

solver = pb.solver.lapack(model)
bands = solver.calc_bands(-pi/graphene.a, pi/graphene.a)
bands.plot(point_labels=['$-\pi / a$', '$\pi / a$'])
bands.plot(point_labels=[r"$-\pi / a$", r"$\pi / a$"])
plt.show()
3 changes: 2 additions & 1 deletion docs/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ def example_file(request):
def test_docs(example_file):
"""Make sure all example files execute without error"""
filename = str(example_file)
exec(compile(open(filename, 'rb').read(), filename, 'exec'), {})
with open(filename, "rb") as file:
exec(compile(file.read(), filename, "exec"), {})
2 changes: 1 addition & 1 deletion docs/tutorial/shape_symmetry_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def contains(x, y, z):
solver = pb.solver.arpack(model, k=10)
a = 3.8 # [nm] unit cell length
bands = solver.calc_bands(-pi/a, pi/a)
bands.plot(point_labels=['$-\pi / a$', '$\pi / a$'])
bands.plot(point_labels=[r'$-\pi / a$', r'$\pi / a$'])
plt.show()


Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ addopts = --doctest-modules --ignore=setup.py --ignore=docs/conf.py
testpaths = pybinding tests docs
norecursedirs = .* *.egg build cpp* dist docs/*
minversion = 3.0
filterwarnings = ignore::ImportWarning

0 comments on commit 5ea1e60

Please sign in to comment.