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
2f078c26
Commit
2f078c26
authored
5 years ago
by
Joseph Weston
Browse files
Options
Downloads
Patches
Plain Diff
provide clearer error message when a Builder is passed to plot_2d_bands
Closes #196.
parent
4fcc45d7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#19293
passed with warnings
5 years ago
Stage: build
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kwant/wraparound.py
+5
-1
5 additions, 1 deletion
kwant/wraparound.py
with
5 additions
and
1 deletion
kwant/wraparound.py
+
5
−
1
View file @
2f078c26
...
...
@@ -362,10 +362,14 @@ def plot_2d_bands(syst, k_x=31, k_y=31, params=None,
if
not
hasattr
(
syst
,
'
_wrapped_symmetry
'
):
raise
TypeError
(
"
Expecting a system that was produced by
"
"'
kwant.wraparound.wraparound
'
.
"
)
if
not
isinstance
(
syst
,
system
.
F
initeSystem
):
if
isinstance
(
syst
,
system
.
Inf
initeSystem
):
msg
=
(
"
All symmetry directions must be wrapped around: specify
"
"'
keep=None
'
when calling
'
kwant.wraparound.wraparound
'
.
"
)
raise
TypeError
(
msg
)
if
isinstance
(
syst
,
builder
.
Builder
):
msg
=
(
"
Expecting a finalized system: remember to finalize your
"
"
system with
'
syst.finalized()
'
.
"
)
raise
TypeError
(
msg
)
params
=
params
or
{}
lat_ndim
,
space_ndim
=
syst
.
_wrapped_symmetry
.
periods
.
shape
...
...
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