Skip to content

Commit ab14ba2

Browse files
author
Andreagiovanni Reina
committed
Patched issue for 1D models
1 parent 1c08906 commit ab14ba2

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

mumot/utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,14 @@ def _format_advanced_option(optionName: str, inputValue, initValues, extraParam=
188188
initialState[reactant][1] = (1 - sumNorm + pop[0])
189189
# initialState[reactant][3] = minStep
190190
if not _almostEqual(sumValues, 1):
191+
reactantToFix = sorted(allReactants, key=str)[0] if idleReactant is None else idleReactant
191192
new_val = 1 - sum([initialState[reactant][0]
192193
for reactant in allReactants
193-
if reactant != idleReactant])
194-
wrn_msg = f"WARNING! the initial value of reactant {idleReactant} has been changed to {new_val}\n"
194+
if reactant != reactantToFix])
195+
wrn_msg = f"WARNING! the initial value of reactant {reactantToFix} has been changed to {new_val}\n"
195196
print(wrn_msg)
196197
#raise exceptions.MuMoTWarning(wrn_msg)
197-
initialState[idleReactant][0] = new_val
198+
initialState[reactantToFix][0] = new_val
198199
return [initialState, fixedBool]
199200
# print("Initial State is " + str(initialState))
200201
if optionName == 'maxTime':

0 commit comments

Comments
 (0)