Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
kwant
kwant
Commits
a82d9e88
Commit
a82d9e88
authored
May 27, 2016
by
Joseph Weston
Browse files
fix not-equal comparison of `SiteFamily`s
parent
109e145a
Pipeline
#472
skipped
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
kwant/builder.py
View file @
a82d9e88
...
...
@@ -137,7 +137,7 @@ class SiteFamily(object):
try
:
return
self
.
canonical_repr
!=
other
.
canonical_repr
except
AttributeError
:
return
Fals
e
return
Tru
e
@
abc
.
abstractmethod
def
normalize_tag
(
self
,
tag
):
...
...
kwant/tests/test_builder.py
View file @
a82d9e88
...
...
@@ -9,7 +9,7 @@
from
__future__
import
division
import
warnings
from
random
import
Random
from
nose.tools
import
assert_raises
from
nose.tools
import
assert_raises
,
assert_not_equal
from
numpy.testing
import
assert_equal
,
assert_almost_equal
import
tinyarray
as
ta
import
kwant
...
...
@@ -103,6 +103,12 @@ def test_site_families():
assert_equal
(
sys
[
ofam
(
1
)],
123
)
assert_raises
(
KeyError
,
sys
.
__getitem__
,
yafam
(
1
))
# test site families compare equal/not-equal
assert_equal
(
fam
,
ofam
)
assert_not_equal
(
fam
,
yafam
)
assert_not_equal
(
fam
,
None
)
assert_not_equal
(
fam
,
'a'
)
class
VerySimpleSymmetry
(
builder
.
Symmetry
):
def
__init__
(
self
,
period
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment