Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
088bb8a5
Commit
088bb8a5
authored
2 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
prepare auto_slicing for more tests
parent
b8e83a2f
No related branches found
Branches containing commit
No related tags found
1 merge request
!1222
Py fu tests: merge -> known_slicing; start auto_slicing tests
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Tests/Py/Functional/auto_slicing.py
+31
-29
31 additions, 29 deletions
Tests/Py/Functional/auto_slicing.py
with
31 additions
and
29 deletions
Tests/Py/Functional/auto_slicing.py
+
31
−
29
View file @
088bb8a5
...
...
@@ -16,40 +16,42 @@ R = 10.0
dz
=
4.0
# shift beneath interface
def
get_sample
(
particle
,
sliced
):
"""
Returns a sample, with given particles attached to substrate or vacuum layer.
"""
layout
=
ba
.
ParticleLayout
()
layout
.
addParticle
(
particle
)
sample
=
ba
.
MultiLayer
()
sample
.
addLayer
(
ba
.
Layer
(
matVacuum
))
if
sliced
:
decorated
=
ba
.
Layer
(
matSubstrate
,
2
)
decorated
.
addLayout
(
layout
)
sample
.
addLayer
(
decorated
)
sample
.
addLayer
(
ba
.
Layer
(
matSubstrate
,
3
))
sample
.
addLayer
(
ba
.
Layer
(
matSubstrate
,
5
))
else
:
decorated
=
ba
.
Layer
(
matSubstrate
,
10
)
decorated
.
addLayout
(
layout
)
sample
.
addLayer
(
decorated
)
sample
.
addLayer
(
ba
.
Layer
(
matSubstrate
))
return
sample
class
SlicedSpheresTest
(
unittest
.
TestCase
):
def
get_sample
(
self
,
particle
,
sliced
):
"""
Returns a sample, with given particles attached to substrate or vacuum layer.
"""
layout
=
ba
.
ParticleLayout
()
layout
.
addParticle
(
particle
)
sample
=
ba
.
MultiLayer
()
sample
.
addLayer
(
ba
.
Layer
(
matVacuum
))
if
sliced
:
decorated
=
ba
.
Layer
(
matSubstrate
,
2
)
decorated
.
addLayout
(
layout
)
sample
.
addLayer
(
decorated
)
sample
.
addLayer
(
ba
.
Layer
(
matSubstrate
,
3
))
sample
.
addLayer
(
ba
.
Layer
(
matSubstrate
,
5
))
else
:
decorated
=
ba
.
Layer
(
matSubstrate
,
10
)
decorated
.
addLayout
(
layout
)
sample
.
addLayer
(
decorated
)
sample
.
addLayer
(
ba
.
Layer
(
matSubstrate
))
return
sample
def
testSlicingPyramid
(
self
):
ff
=
ba
.
Pyramid3
(
8.
,
10.
,
80
*
ba
.
deg
)
def
runPlainFF
(
self
,
ff
):
particle
=
ba
.
Particle
(
matSubstrate
,
ff
)
diff
=
infrastruct
.
diff_MiniGISAS
(
self
.
get_sample
(
particle
,
False
),
self
.
get_sample
(
particle
,
True
))
diff
=
infrastruct
.
diff_MiniGISAS
(
get_sample
(
particle
,
False
),
get_sample
(
particle
,
True
))
self
.
assertLess
(
diff
,
1e-13
)
def
testSlicingPlainFF
(
self
):
self
.
runPlainFF
(
ba
.
Pyramid3
(
8.
,
10.
,
80
*
ba
.
deg
))
if
__name__
==
'
__main__
'
:
unittest
.
main
()
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