Skip to content

Commit bb59bbd

Browse files
committed
Adds names and checks to "test_run.py"
1 parent fe9e16c commit bb59bbd

File tree

2 files changed

+90
-8
lines changed

2 files changed

+90
-8
lines changed

tests/test_inputs.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,14 @@ def test_names():
132132
def test_checks():
133133
"""The expected checks object from "standard_layers_project", "domains_project" and "custom_xy_project"."""
134134
checks = Checks()
135-
checks.params = [1, 0, 0, 0]
136-
checks.backgroundParams = [0]
137-
checks.scalefactors = [0]
138-
checks.qzshifts = []
139-
checks.bulkIns = [0]
140-
checks.bulkOuts = [0]
141-
checks.resolutionParams = [0]
142-
checks.domainRatios = []
135+
checks.params = np.array([1, 0, 0, 0])
136+
checks.backgroundParams = np.array([0])
137+
checks.scalefactors = np.array([0])
138+
checks.qzshifts = np.array([])
139+
checks.bulkIns = np.array([0])
140+
checks.bulkOuts = np.array([0])
141+
checks.resolutionParams = np.array([0])
142+
checks.domainRatios = np.array([])
143143

144144
return checks
145145

tests/test_run.py

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,47 @@ def reflectivity_calculation_problem():
168168
[1.00e-02, 5.00e-02],
169169
],
170170
)
171+
problem.names.params = [
172+
"Substrate Roughness",
173+
"Oxide Thickness",
174+
"Oxide SLD",
175+
"SAM Tails Thickness",
176+
"SAM Tails SLD",
177+
"SAM Tails Hydration",
178+
"SAM Roughness",
179+
"CW Thickness",
180+
"CW SLD",
181+
"SAM Heads Thickness",
182+
"SAM Heads SLD",
183+
"SAM Heads Hydration",
184+
"Bilayer Heads Thickness",
185+
"Bilayer Heads SLD",
186+
"Bilayer Roughness",
187+
"Bilayer Tails Thickness",
188+
"Bilayer Tails SLD",
189+
"Bilayer Tails Hydration",
190+
"Bilayer Heads Hydration",
191+
"CW Hydration",
192+
"Oxide Hydration",
193+
]
194+
problem.names.backgroundParams = ["Background parameter D2O", "Background parameter SMW"]
195+
problem.names.scalefactors = ["Scalefactor 1", "Scalefactor 2"]
196+
problem.names.qzshifts = []
197+
problem.names.bulkIns = ["Silicon"]
198+
problem.names.bulkOuts = ["D2O", "SMW"]
199+
problem.names.resolutionParams = ["Resolution Param 1"]
200+
problem.names.domainRatios = []
201+
problem.names.contrasts = ["D2O", "SMW"]
202+
problem.checks.params = np.array(
203+
[1.0, 1.0, 0.0, 1.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0]
204+
)
205+
problem.checks.backgroundParams = np.array([1.0, 1.0])
206+
problem.checks.scalefactors = np.array([0.0, 0.0])
207+
problem.checks.qzshifts = np.array([])
208+
problem.checks.bulkIns = np.array([0.0])
209+
problem.checks.bulkOuts = np.array([1.0, 1.0])
210+
problem.checks.resolutionParams = np.array([0.0])
211+
problem.checks.domainRatios = np.array([])
171212

172213
return problem
173214

@@ -325,6 +366,47 @@ def dream_problem():
325366
[0.00e00, 0.00e00],
326367
],
327368
)
369+
problem.names.params = [
370+
"Substrate Roughness",
371+
"Oxide Thickness",
372+
"Oxide SLD",
373+
"SAM Tails Thickness",
374+
"SAM Tails SLD",
375+
"SAM Tails Hydration",
376+
"SAM Roughness",
377+
"CW Thickness",
378+
"CW SLD",
379+
"SAM Heads Thickness",
380+
"SAM Heads SLD",
381+
"SAM Heads Hydration",
382+
"Bilayer Heads Thickness",
383+
"Bilayer Heads SLD",
384+
"Bilayer Roughness",
385+
"Bilayer Tails Thickness",
386+
"Bilayer Tails SLD",
387+
"Bilayer Tails Hydration",
388+
"Bilayer Heads Hydration",
389+
"CW Hydration",
390+
"Oxide Hydration",
391+
]
392+
problem.names.backgroundParams = ["Background parameter D2O", "Background parameter SMW"]
393+
problem.names.scalefactors = ["Scalefactor 1", "Scalefactor 2"]
394+
problem.names.qzshifts = []
395+
problem.names.bulkIns = ["Silicon"]
396+
problem.names.bulkOuts = ["D2O", "SMW"]
397+
problem.names.resolutionParams = ["Resolution Param 1"]
398+
problem.names.domainRatios = []
399+
problem.names.contrasts = ["D2O", "SMW"]
400+
problem.checks.params = np.array(
401+
[1.0, 1.0, 0.0, 1.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0]
402+
)
403+
problem.checks.backgroundParams = np.array([1.0, 1.0])
404+
problem.checks.scalefactors = np.array([0.0, 0.0])
405+
problem.checks.qzshifts = np.array([])
406+
problem.checks.bulkIns = np.array([0.0])
407+
problem.checks.bulkOuts = np.array([1.0, 1.0])
408+
problem.checks.resolutionParams = np.array([0.0])
409+
problem.checks.domainRatios = np.array([])
328410

329411
return problem
330412

0 commit comments

Comments
 (0)