Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
force-bdss
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
Container Registry
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
Adham Hashibon
force-bdss
Commits
e7c4b3e5
Commit
e7c4b3e5
authored
6 years ago
by
Stefano Borini
Browse files
Options
Downloads
Patches
Plain Diff
ported MCO probe to new API
parent
dc5d55ce
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!130
Safer plugin import - 2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
force_bdss/tests/probe_classes/mco.py
+16
-19
16 additions, 19 deletions
force_bdss/tests/probe_classes/mco.py
with
16 additions
and
19 deletions
force_bdss/tests/probe_classes/mco.py
+
16
−
19
View file @
e7c4b3e5
from
traits.api
import
Str
,
Type
,
Bool
,
Int
,
Function
from
traits.api
import
Bool
,
Int
,
Function
from
force_bdss.ids
import
mco_parameter_id
,
factory_id
from
force_bdss.core.data_value
import
DataValue
from
force_bdss.api
import
(
BaseMCOModel
,
BaseMCO
,
BaseMCOFactory
,
...
...
@@ -36,9 +35,11 @@ class ProbeParameter(BaseMCOParameter):
class
ProbeParameterFactory
(
BaseMCOParameterFactory
):
id
=
Str
(
mco_parameter_id
(
"
enthought
"
,
"
test_mco
"
,
"
test
"
))
def
get_identifier
(
self
):
return
"
test
"
model_class
=
Type
(
ProbeParameter
)
def
get_model_class
(
self
):
return
ProbeParameter
class
ProbeMCOCommunicator
(
BaseMCOCommunicator
):
...
...
@@ -58,31 +59,27 @@ class ProbeMCOCommunicator(BaseMCOCommunicator):
class
ProbeMCOFactory
(
BaseMCOFactory
):
id
=
Str
(
factory_id
(
"
enthought
"
,
"
test_mco
"
)
)
nb_output_data_values
=
Int
(
0
)
model_class
=
Type
(
ProbeMCOModel
)
def
get_identifier
(
self
):
return
"
test_mco
"
communicator_class
=
Type
(
ProbeMCOCommunicator
)
def
get_model_class
(
self
):
return
ProbeMCOModel
mco_class
=
Type
(
ProbeMCO
)
def
get_communicator_class
(
self
):
return
ProbeMCOCommunicator
nb_output_data_values
=
Int
(
0
)
def
get_optimizer_class
(
self
):
return
ProbeMCO
def
create_model
(
self
,
model_data
=
None
):
if
model_data
is
None
:
model_data
=
{}
return
self
.
model_class
(
self
,
**
model_data
)
def
get_name
(
self
):
return
"
testmco
"
def
create_communicator
(
self
):
return
self
.
communicator_class
(
self
,
nb_output_data_values
=
self
.
nb_output_data_values
)
def
create_optimizer
(
self
):
return
self
.
mco_class
(
self
)
def
parameter_factories
(
self
):
return
[
ProbeParameterFactory
(
mco_factory
=
self
)]
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