Skip to content

Commit 304fc4e

Browse files
authored
Merge pull request #26 from sebapersson/explicit_assignments
Use explicit assignments for array data
2 parents f6b360c + f487cb4 commit 304fc4e

83 files changed

Lines changed: 81 additions & 74 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/petab/parameters.jl

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const ALPHA = DataFrame(
44
lowerBound = 0.0,
55
upperBound = 15.0,
66
nominalValue = 1.3,
7-
estimate = 1
7+
estimate = true
88
)
99

1010
const DELTA = DataFrame(
@@ -13,7 +13,7 @@ const DELTA = DataFrame(
1313
lowerBound = 0.0,
1414
upperBound = 15.0,
1515
nominalValue = 1.8,
16-
estimate = 1
16+
estimate = true
1717
)
1818

1919
const BETA = DataFrame(
@@ -22,7 +22,7 @@ const BETA = DataFrame(
2222
lowerBound = 0.0,
2323
upperBound = 15.0,
2424
nominalValue = 0.9,
25-
estimate = 1
25+
estimate = true
2626
)
2727

2828
const GAMMA = DataFrame(
@@ -31,7 +31,7 @@ const GAMMA = DataFrame(
3131
lowerBound = 0.0,
3232
upperBound = 15.0,
3333
nominalValue = 0.8,
34-
estimate = 1
34+
estimate = true
3535
)
3636

3737
const NET1_INPUT_PRE1 = DataFrame(
@@ -40,7 +40,7 @@ const NET1_INPUT_PRE1 = DataFrame(
4040
lowerBound = "-inf",
4141
upperBound = "inf",
4242
nominalValue = 1.0,
43-
estimate = 0
43+
estimate = false
4444
)
4545

4646
const NET1_INPUT_PRE2 = DataFrame(
@@ -49,7 +49,7 @@ const NET1_INPUT_PRE2 = DataFrame(
4949
lowerBound = "-inf",
5050
upperBound = "inf",
5151
nominalValue = 1.0,
52-
estimate = 0
52+
estimate = false
5353
)
5454

5555
const NET1_INPUT_PRE2_EST = DataFrame(
@@ -58,7 +58,7 @@ const NET1_INPUT_PRE2_EST = DataFrame(
5858
lowerBound = "-inf",
5959
upperBound = "inf",
6060
nominalValue = 1.0,
61-
estimate = 1
61+
estimate = true
6262
)
6363

6464
const NET2_INPUT_PRE1 = DataFrame(
@@ -67,7 +67,7 @@ const NET2_INPUT_PRE1 = DataFrame(
6767
lowerBound = "-inf",
6868
upperBound = "inf",
6969
nominalValue = 2.0,
70-
estimate = 0
70+
estimate = false
7171
)
7272

7373
const NET2_INPUT_PRE2 = DataFrame(
@@ -76,7 +76,7 @@ const NET2_INPUT_PRE2 = DataFrame(
7676
lowerBound = "-inf",
7777
upperBound = "inf",
7878
nominalValue = 2.0,
79-
estimate = 0
79+
estimate = false
8080
)
8181

8282
const NET1_LAYER1 = DataFrame(
@@ -85,34 +85,34 @@ const NET1_LAYER1 = DataFrame(
8585
lowerBound = "-inf",
8686
upperBound = "inf",
8787
nominalValue = 0.0,
88-
estimate = 1
88+
estimate = true
8989
)
9090

9191
const NET1_LAYER1_FREEZE = DataFrame(
9292
parameterId = "net1_layer1",
9393
parameterScale = "lin",
9494
lowerBound = "-inf",
9595
upperBound = "inf",
96-
nominalValue = missing,
97-
estimate = 0
96+
nominalValue = "array",
97+
estimate = false
9898
)
9999

100100
const NET1_LAYER1_WEIGHT_FREEZE = DataFrame(
101101
parameterId = "net1_layer1_weight",
102102
parameterScale = "lin",
103103
lowerBound = "-inf",
104104
upperBound = "inf",
105-
nominalValue = missing,
106-
estimate = 0
105+
nominalValue = "array",
106+
estimate = false
107107
)
108108

109109
const NET1_LAYER1_PRIOR = DataFrame(
110110
parameterId = "net1_layer1_prior",
111111
parameterScale = "lin",
112112
lowerBound = "-inf",
113113
upperBound = "inf",
114-
nominalValue = missing,
115-
estimate = 1,
114+
nominalValue = "array",
115+
estimate = true,
116116
priorDistribution = "normal",
117117
priorParameters = "0.0;2.0"
118118
)
@@ -122,8 +122,8 @@ const NET1_LAYER1_WEIGHT_PRIOR = DataFrame(
122122
parameterScale = "lin",
123123
lowerBound = "-inf",
124124
upperBound = "inf",
125-
nominalValue = missing,
126-
estimate = 1,
125+
nominalValue = "array",
126+
estimate = true,
127127
priorDistribution = "normal",
128128
priorParameters = "0.0;2.0"
129129
)
@@ -141,7 +141,7 @@ function save_parameters_table(
141141
net_ids = @. string(_net_ids) * "_ps"
142142
df_nn = DataFrame(
143143
parameterId = net_ids, parameterScale = :lin, lowerBound = "-inf",
144-
upperBound = "inf", nominalValue = missing, estimate = Int(estimate_net_parameters)
144+
upperBound = "inf", nominalValue = "array", estimate = Int(estimate_net_parameters)
145145
)
146146

147147
df_save = vcat(df_mech, df_nn, cols = :union)

src/test_values/nllh.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,9 @@ function get_x(petab_parameters_ids, x_nn, nets_info::Dict)
459459
x_mechanistic = Vector{Pair{Symbol, Float64}}(undef, 0)
460460
for id in petab_parameters_ids
461461
_get_parameter_info(id, :estimate) == false && continue
462-
ismissing(_get_parameter_info(id, :value)) && continue
462+
if _get_parameter_info(id, :value) == "array"
463+
continue
464+
end
463465
push!(x_mechanistic, id => _get_parameter_info(id, :value))
464466
end
465467
x_mechanistic = NamedTuple(x_mechanistic)
0 Bytes
Binary file not shown.

test_cases/initialization/001/petab/parameters.tsv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ alpha lin 0.0 15.0 1.3 1
33
delta lin 0.0 15.0 1.8 1
44
beta lin 0.0 15.0 0.9 1
55
net1_layer1 lin -inf inf 0.0 1
6-
net1_ps lin -inf inf 1
6+
net1_ps lin -inf inf array 1
0 Bytes
Binary file not shown.

test_cases/initialization/002/petab/parameters.tsv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ alpha lin 0.0 15.0 1.3 1
33
delta lin 0.0 15.0 1.8 1
44
beta lin 0.0 15.0 0.9 1
55
net1_layer1 lin -inf inf 0.0 1
6-
net1_ps lin -inf inf 1
6+
net1_ps lin -inf inf array 1
0 Bytes
Binary file not shown.

test_cases/initialization/003/petab/parameters.tsv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ alpha lin 0.0 15.0 1.3 1
33
delta lin 0.0 15.0 1.8 1
44
beta lin 0.0 15.0 0.9 1
55
net1_layer1 lin -inf inf 0.0 1
6-
net1_ps lin -inf inf 1
6+
net1_ps lin -inf inf array 1
0 Bytes
Binary file not shown.

test_cases/sciml_problem_import/001/petab/parameters.tsv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ parameterId parameterScale lowerBound upperBound nominalValue estimate
22
alpha lin 0.0 15.0 1.3 1
33
delta lin 0.0 15.0 1.8 1
44
beta lin 0.0 15.0 0.9 1
5-
net1_ps lin -inf inf 1
5+
net1_ps lin -inf inf array 1

0 commit comments

Comments
 (0)