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
1cff8cbf
Commit
1cff8cbf
authored
5 years ago
by
Joseph Weston
Browse files
Options
Downloads
Patches
Plain Diff
add a test to disallow arrays with kwant.Builder
parent
04565f7b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#18376
passed
5 years ago
Stage: build-env
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kwant/tests/test_plotter.py
+15
-0
15 additions, 0 deletions
kwant/tests/test_plotter.py
with
15 additions
and
0 deletions
kwant/tests/test_plotter.py
+
15
−
0
View file @
1cff8cbf
...
...
@@ -169,6 +169,21 @@ def test_plot_more_site_families_than_colors():
plotter
.
plot
(
syst
,
file
=
out
)
@pytest.mark.skipif
(
not
_plotter
.
mpl_available
,
reason
=
"
Matplotlib unavailable.
"
)
def
test_plot_raises_on_bad_site_spec
():
syst
=
kwant
.
Builder
()
lat
=
kwant
.
lattice
.
square
()
syst
[(
lat
(
i
,
j
)
for
i
in
range
(
5
)
for
j
in
range
(
5
))]
=
None
# Cannot provide site_size as an array when syst is a Builder
with
pytest
.
raises
(
TypeError
):
plotter
.
plot
(
syst
,
site_size
=
[
1
]
*
25
)
# Cannot provide site_size as an array when syst is a Builder
with
pytest
.
raises
(
TypeError
):
plotter
.
plot
(
syst
,
site_symbol
=
[
'
o
'
]
*
25
)
def
good_transform
(
pos
):
x
,
y
=
pos
return
y
,
x
...
...
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