Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
kwant
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Joseph Weston
kwant
Commits
a82d9e88
There was a problem fetching the pipeline summary.
Commit
a82d9e88
authored
8 years ago
by
Joseph Weston
Browse files
Options
Downloads
Patches
Plain Diff
fix not-equal comparison of `SiteFamily`s
parent
109e145a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
kwant/builder.py
+1
-1
1 addition, 1 deletion
kwant/builder.py
kwant/tests/test_builder.py
+7
-1
7 additions, 1 deletion
kwant/tests/test_builder.py
with
8 additions
and
2 deletions
kwant/builder.py
+
1
−
1
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
):
...
...
This diff is collapsed.
Click to expand it.
kwant/tests/test_builder.py
+
7
−
1
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
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment