Skip to content

Commit

Permalink
Add more unit and ci tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tmnp19 committed Feb 16, 2024
1 parent 8a7c46a commit 6dbb9e7
Show file tree
Hide file tree
Showing 54 changed files with 1,340 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,5 @@ reference/

# Example results
examples/*/config/
test/example_init_shot/*/
test/example_init_shot/data.out
14 changes: 14 additions & 0 deletions test/example_init_shot/parameter_output_1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

iters: 20

optimiser: random

parameters:
Young2: [20, 10, 30]

output_parameters:
Young: Young2*10

objective:
name: analytical
expression: (Young-150)**2
16 changes: 16 additions & 0 deletions test/example_init_shot/parameter_output_2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

iters: 20

optimiser: random

parameters:
Young2: [20, 10, 30]

output_parameters:
Young: Young2*10

init_shot_from: parameter_output_1.yaml

objective:
name: analytical
expression: (Young-150)**2
20 changes: 20 additions & 0 deletions test/example_init_shot/parameter_output_3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

iters: 2
max_func_calls: 0

optimiser:
name: botorch
acquisition: ucb
beta: 0.9
n_test: 2
export: data.out


parameters:
Young: [200, 100, 300]


objective:
name: analytical
expression: (Young-150)**2

20 changes: 20 additions & 0 deletions test/example_init_shot/parameter_output_4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

iters: 2
max_func_calls: 0

optimiser:
name: botorch
acquisition: ucb
beta: 0.9
n_test: 2
load_file: data.out


parameters:
Young: [200, 100, 300]


objective:
name: analytical
expression: (Young-150)**2

18 changes: 18 additions & 0 deletions test/examples/bo_1call_ei.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

iters: 2
max_func_calls: 0

optimiser:
name: botorch
acquisition: ei
beta: 0.9
n_test: 2


parameters:
Young: [200, 100, 300]


objective:
name: analytical
expression: (Young-150)**2
18 changes: 18 additions & 0 deletions test/examples/bo_1call_kg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

iters: 2
max_func_calls: 0

optimiser:
name: botorch
acquisition: kg
beta: 0.9
n_test: 2


parameters:
Young: [200, 100, 300]


objective:
name: analytical
expression: (Young-150)**2
18 changes: 18 additions & 0 deletions test/examples/bo_1call_pi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

iters: 2
max_func_calls: 0

optimiser:
name: botorch
acquisition: pi
beta: 0.9
n_test: 2


parameters:
Young: [200, 100, 300]


objective:
name: analytical
expression: (Young-150)**2
18 changes: 18 additions & 0 deletions test/examples/bo_1call_qei.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

iters: 2
max_func_calls: 0

optimiser:
name: botorch
acquisition: qei
beta: 0.9
n_test: 2


parameters:
Young: [200, 100, 300]


objective:
name: analytical
expression: (Young-150)**2
18 changes: 18 additions & 0 deletions test/examples/bo_1call_qkg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

iters: 2
max_func_calls: 0

optimiser:
name: botorch
acquisition: qkg
beta: 0.9
n_test: 2


parameters:
Young: [200, 100, 300]


objective:
name: analytical
expression: (Young-150)**2
18 changes: 18 additions & 0 deletions test/examples/bo_1call_qpi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

iters: 2
max_func_calls: 0

optimiser:
name: botorch
acquisition: qpi
beta: 0.9
n_test: 2


parameters:
Young: [200, 100, 300]


objective:
name: analytical
expression: (Young-150)**2
18 changes: 18 additions & 0 deletions test/examples/bo_1call_qucb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

iters: 2
max_func_calls: 0

optimiser:
name: botorch
acquisition: qucb
beta: 0.9
n_test: 2


parameters:
Young: [200, 100, 300]


objective:
name: analytical
expression: (Young-150)**2
26 changes: 26 additions & 0 deletions test/examples/design_integral.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

iters: 10

optimiser: random


parameters:
a: [2, 0.5, 4]



objective:
name: design
solver:
name: curve
cases:
'case_1':
expression: <a> * x ** 2
parametric: x
bounds: [-5, 5]
points: 100
targets:
'integral_quantity':
quantity: integral
prediction: ['case_1']
negate: False
29 changes: 29 additions & 0 deletions test/examples/design_missing_quantity_script.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

iters: 10

optimiser: random


parameters:
a: [2, 0.5, 4]



objective:
name: design
solver:
name: curve
cases:
'case_1':
expression: <a> * x ** 2
parametric: x
bounds: [-5, 5]
points: 100
targets:
'script_quantity':
quantity:
name: script
script: min_script.py # Path to the script
class: MinQuantity # Class name (must be derived from Quantity)
prediction: ['case_1']
negate: True
27 changes: 27 additions & 0 deletions test/examples/dummy_composite_ei.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

iters: 10

optimiser:
name: botorch
acquisition: ei


parameters:
a: [0, -4, 4]



objective:
name: fitting
composite: True
solver:
name: curve
cases:
'case_1':
expression: <a> * x ** 2
parametric: x
bounds: [-5, 5]
points: 100
references:
'reference_curve.txt':
prediction: ['case_1']
27 changes: 27 additions & 0 deletions test/examples/dummy_composite_pi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

iters: 10

optimiser:
name: botorch
acquisition: pi


parameters:
a: [0, -4, 4]



objective:
name: fitting
composite: True
solver:
name: curve
cases:
'case_1':
expression: <a> * x ** 2
parametric: x
bounds: [-5, 5]
points: 100
references:
'reference_curve.txt':
prediction: ['case_1']
26 changes: 26 additions & 0 deletions test/examples/dummy_design_pred_str.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

iters: 10

optimiser: random


parameters:
a: [2, 0.5, 4]



objective:
name: design
solver:
name: curve
cases:
'case_1':
expression: <a> * x ** 2
parametric: x
bounds: [-5, 5]
points: 100
targets:
'maximum_force':
quantity: max
prediction: case_1
negate: False
25 changes: 25 additions & 0 deletions test/examples/dummy_simple_pred_str.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

iters: 10

optimiser: random


parameters:
a: [0, -4, 4]



objective:
name: fitting
composite: False
solver:
name: curve
cases:
'case_1':
expression: <a> * x ** 2
parametric: x
bounds: [-5, 5]
points: 100
references:
'reference_curve.txt':
prediction: case_1
Loading

0 comments on commit 6dbb9e7

Please sign in to comment.