Skip to content

Commit

Permalink
Merge pull request #3 from ITISFoundation/discrete_vars
Browse files Browse the repository at this point in the history
Discrete vars
  • Loading branch information
wvangeit authored Jun 17, 2024
2 parents 5d021b4 + 435cfba commit e835143
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.0.3
current_version = 0.0.4
commit = False
message = service version: {current_version} → {new_version}
tag = False
Expand Down
4 changes: 2 additions & 2 deletions .osparc/osparc-meta-dakota/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: DakotaService
description: "DakotaServiceService"
key: simcore/services/dynamic/osparc-meta-dakota
version: 0.0.3
integration-version: 0.0.3
version: 0.0.4
integration-version: 0.0.4
type: dynamic
authors:
- name: Werner Van Geit
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SHELL = /bin/sh
MAKEFLAGS += -j3

export DOCKER_IMAGE_NAME ?= osparc-meta-dakota
export DOCKER_IMAGE_TAG ?= 0.0.3
export DOCKER_IMAGE_TAG ?= 0.0.4

export MASTER_AWS_REGISTRY ?= registry.osparc-master-zmt.click
export MASTER_REGISTRY ?= registry.osparc-master.speag.com
Expand Down Expand Up @@ -37,15 +37,16 @@ clean:

.PHONY: build
build: clean compose-spec ## build docker image
docker-compose build
docker compose build

clean-validation:
sudo rm -rf validation-tmp
cp -r validation validation-tmp
chmod -R 770 validation-tmp

run-compose-local: clean-validation
docker-compose --file docker-compose-local.yml up
docker compose down
docker compose --file docker-compose-local.yml up

run-mock-mapservice: clean-validation
pip install osparc-filecomms
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-local.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.7'
services:
osparc-meta-dakota:
image: simcore/services/dynamic/osparc-meta-dakota:0.0.3
image: simcore/services/dynamic/osparc-meta-dakota:0.0.4
ports:
- "8888:8888"
environment:
Expand Down
24 changes: 12 additions & 12 deletions docker_scripts/dakota-start.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,18 @@ def start(self):
def model_callback(self, dak_inputs):
param_sets = [
{
label: value
for label, value in zip(
dak_input["cv_labels"], dak_input["cv"]
)
**{
label: value
for label, value in zip(
dak_input["cv_labels"], dak_input["cv"]
)
},
**{
label: value
for label, value in zip(
dak_input["div_labels"], dak_input["div"]
)
},
}
for dak_input in dak_inputs
]
Expand All @@ -134,14 +142,6 @@ def model_callback(self, dak_inputs):
]
return dak_outputs

def model(self, input, mus=NOISE_MUS, sigmas=NOISE_SIGMAS):
x0, x1, x2 = input
noise0 = np.random.normal(mus[0], sigmas[0])
noise1 = np.random.normal(mus[1], sigmas[1])
y0 = x0 + x1 + noise0
y1 = x2 + noise1
return y0, y1

def start_dakota(self, dakota_conf, output_dir):
with working_directory(output_dir):
callbacks = {"model": self.model_callback}
Expand Down
8 changes: 8 additions & 0 deletions validation-client/dakota.in.template
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ variables
descriptors
'x0'
'x1'
discrete_design_set
integer 2
elements_per_variable 2 2
elements
0 1 0 1
descriptors
'd0'
'd1'

interface
id_interface = 'INTERFACE'
Expand Down
6 changes: 3 additions & 3 deletions validation/opt.dat.expected
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
%eval_id interface x0 x1 x0 x1
1 INTERFACE 0.1061623875 0.06907974939 0.1061623875 0.06907974939
2 INTERFACE 0.05718197938 0.03021853491 0.05718197938 0.03021853491
%eval_id interface x0 x1 d0 d1 x0 x1
1 INTERFACE 0.05718197938 0.03021853491 1 0 0.05718197938 0.03021853491
2 INTERFACE 0.1061623875 0.06907974939 0 1 0.1061623875 0.06907974939

0 comments on commit e835143

Please sign in to comment.