Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more Unit and CI tests #9

Merged
merged 4 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add more unit and ci tests
  • Loading branch information
tmnp19 committed Feb 16, 2024
commit 6dbb9e7a8e8375444f6e6137df3c22edc0e7b1c4
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
Loading