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
5179b5e6
Commit
5179b5e6
authored
3 years ago
by
Matthias Puchner
Browse files
Options
Downloads
Patches
Plain Diff
adapt python tests
parent
0cf58862
No related branches found
No related tags found
1 merge request
!475
Harmonized and less generic UI for minimizers
Pipeline
#50187
passed
3 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Tests/Functional/PyFit/minimizer_api.py
+0
-23
0 additions, 23 deletions
Tests/Functional/PyFit/minimizer_api.py
with
0 additions
and
23 deletions
Tests/Functional/PyFit/minimizer_api.py
+
0
−
23
View file @
5179b5e6
...
@@ -64,28 +64,5 @@ class MinimizerAPITest(unittest.TestCase):
...
@@ -64,28 +64,5 @@ class MinimizerAPITest(unittest.TestCase):
self
.
assertTrue
(
params
[
"
par4
"
].
limits
().
isFixed
())
self
.
assertTrue
(
params
[
"
par4
"
].
limits
().
isFixed
())
def
test_SimpleMinimizer
(
self
):
minimizer
=
ba
.
Minimizer
()
minimizer
.
setMinimizer
(
"
Test
"
)
pars
=
ba
.
Parameters
()
pars
.
add
(
ba
.
Parameter
(
"
par0
"
,
0
))
pars
.
add
(
ba
.
Parameter
(
"
par1
"
,
1
))
pars
.
add
(
ba
.
Parameter
(
"
par2
"
,
2
))
helper
=
TestMinimizerHelper
()
result
=
minimizer
.
minimize
(
helper
.
objective_function
,
pars
)
# return value of objective function was propagated to MinimizerResult
self
.
assertEqual
(
result
.
minValue
(),
42
)
# objective function was called twice
#(once by test minimizer, and second time during return type deduction)
self
.
assertEqual
(
helper
.
m_ncalls
,
2
)
# starting values of fit parameters were correctly send to objective func
self
.
assertEqual
(
list
(
helper
.
m_pars
.
values
()),
[
0
,
1
,
2.0
])
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
unittest
.
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