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
cb599390
Commit
cb599390
authored
2 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
transform_CoreShellBox.py: mv material initialization to top
parent
63cc5700
No related branches found
No related tags found
1 merge request
!1214
Further reorganize tests; revise some Py functional tests
Pipeline
#84129
passed
2 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Tests/Py/Functional/transform_CoreShellBox.py
+6
-11
6 additions, 11 deletions
Tests/Py/Functional/transform_CoreShellBox.py
Tests/Py/Functional/transform_box.py
+1
-2
1 addition, 2 deletions
Tests/Py/Functional/transform_box.py
with
7 additions
and
13 deletions
Tests/Py/Functional/transform_CoreShellBox.py
+
6
−
11
View file @
cb599390
...
@@ -10,15 +10,18 @@ import unittest
...
@@ -10,15 +10,18 @@ import unittest
import
utils
import
utils
from
bornagain
import
*
from
bornagain
import
*
mAmbience
=
RefractiveMaterial
(
"
Vacuum
"
,
0
,
0
)
mSubstrate
=
RefractiveMaterial
(
"
Substrate
"
,
3e-6
,
3e-8
)
mMiddle
=
RefractiveMaterial
(
"
Teflon
"
,
2.9e-6
,
6e-9
)
mCore
=
RefractiveMaterial
(
"
Ag
"
,
1.2e-5
,
5e-7
)
mShell
=
RefractiveMaterial
(
"
AgO2
"
,
8.6e-6
,
3.4e-7
)
layer_thickness
=
100.0
layer_thickness
=
100.0
class
TransformCoreShellBoxTest
(
unittest
.
TestCase
):
class
TransformCoreShellBoxTest
(
unittest
.
TestCase
):
def
get_sample
(
self
,
particle
):
def
get_sample
(
self
,
particle
):
mAmbience
=
RefractiveMaterial
(
"
Vacuum
"
,
0
,
0
)
mMiddle
=
RefractiveMaterial
(
"
Teflon
"
,
2.900e-6
,
6.019e-9
)
mSubstrate
=
RefractiveMaterial
(
"
Substrate
"
,
3.212e-6
,
3.244e-8
)
layout
=
ParticleLayout
()
layout
=
ParticleLayout
()
layout
.
addParticle
(
particle
)
layout
.
addParticle
(
particle
)
...
@@ -44,7 +47,6 @@ class TransformCoreShellBoxTest(unittest.TestCase):
...
@@ -44,7 +47,6 @@ class TransformCoreShellBoxTest(unittest.TestCase):
Box particle placed in the center of the middle layer is compared against
Box particle placed in the center of the middle layer is compared against
CoreShell particle, where core and shell are made of the same material.
CoreShell particle, where core and shell are made of the same material.
"""
"""
mCore
=
RefractiveMaterial
(
"
Ag
"
,
1.245e-5
,
5.419e-7
)
shell_length
=
50.0
shell_length
=
50.0
shell_width
=
20.0
shell_width
=
20.0
...
@@ -79,8 +81,6 @@ class TransformCoreShellBoxTest(unittest.TestCase):
...
@@ -79,8 +81,6 @@ class TransformCoreShellBoxTest(unittest.TestCase):
Second CoreShell particle has dimensions (50,20,10) with one rotationZ to be
Second CoreShell particle has dimensions (50,20,10) with one rotationZ to be
like the reference one.
like the reference one.
"""
"""
mCore
=
RefractiveMaterial
(
"
Ag
"
,
1.245e-5
,
5.419e-7
)
mShell
=
RefractiveMaterial
(
"
AgO2
"
,
8.600e-6
,
3.442e-7
)
# building reference CoreShell particle
# building reference CoreShell particle
shell_length
=
20.0
shell_length
=
20.0
...
@@ -131,9 +131,6 @@ class TransformCoreShellBoxTest(unittest.TestCase):
...
@@ -131,9 +131,6 @@ class TransformCoreShellBoxTest(unittest.TestCase):
Second CoreShell particle has dimensions (50,20,10) with one rotationZ to be
Second CoreShell particle has dimensions (50,20,10) with one rotationZ to be
like the reference one.
like the reference one.
"""
"""
mCore
=
RefractiveMaterial
(
"
Ag
"
,
1.245e-5
,
5.419e-7
)
mShell
=
RefractiveMaterial
(
"
AgO2
"
,
8.600e-6
,
3.442e-7
)
# building reference CoreShell particle
# building reference CoreShell particle
shell_length
=
10.0
shell_length
=
10.0
shell_width
=
20.0
shell_width
=
20.0
...
@@ -183,8 +180,6 @@ class TransformCoreShellBoxTest(unittest.TestCase):
...
@@ -183,8 +180,6 @@ class TransformCoreShellBoxTest(unittest.TestCase):
Second CoreShell particle has dimensions (50,20,10) with two rotations to be
Second CoreShell particle has dimensions (50,20,10) with two rotations to be
like the reference one.
like the reference one.
"""
"""
mCore
=
RefractiveMaterial
(
"
Ag
"
,
1.245e-5
,
5.419e-7
)
mShell
=
RefractiveMaterial
(
"
AgO2
"
,
8.600e-6
,
3.442e-7
)
# building reference CoreShell particle
# building reference CoreShell particle
shell_length
=
10.0
shell_length
=
10.0
...
...
This diff is collapsed.
Click to expand it.
Tests/Py/Functional/transform_box.py
+
1
−
2
View file @
cb599390
...
@@ -66,8 +66,7 @@ class BoxTransformationsTest(unittest.TestCase):
...
@@ -66,8 +66,7 @@ class BoxTransformationsTest(unittest.TestCase):
data
=
self
.
get_result
(
box
)
data
=
self
.
get_result
(
box
)
diff
=
ba
.
meanRelativeDifference
(
data
,
reference_data
)
diff
=
ba
.
meanRelativeDifference
(
data
,
reference_data
)
print
(
diff
)
self
.
assertLess
(
diff
,
1e-13
)
self
.
assertLess
(
diff
,
1e-10
)
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__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