You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
parser.add_argument( 'location', type=str, help='Required: Directory in which the scripts (in tsv format) are all located. OR: File in which each line is the filename of a scripts.tsv file, followed by weight to assign for that file.')
112
122
parser.add_argument( '-n', '--numProcesses', type=int, help='Optional: Number of processes to spawn', default=2 )
113
123
parser.add_argument( '-m', '--model', type=str, help='Optional: Composite model definition file. First searched in directory "location", then in current directory.', default="FindSim_compositeModel_1.g" )
114
-
parser.add_argument( '-p', '--parameter_sweep', nargs='*', default=[], help='Does a parameter sweep in range 0.5-2x of each object.field pair.' )
115
-
parser.add_argument( '-f', '--file', type=str, help='Optional: File name for output of parameter sweep', default="" )
124
+
parser.add_argument( '-p', '--parameter_optimize', nargs='*', default=[], help='Does a parameter optimization for each specified object.field pair.' )
125
+
parser.add_argument( '-ps', '--presettle', nargs=3, default=[], help='Arguments: tsv_file, model_file, settle_time. Obtains values of all concentrations after a specified settle-time, so that all calculations for the optimization runs can be initialized to this presettled value. The tsv_file is to specify which subset of the model_file to use. This option is most useful in costly multiscale models.' )
126
+
parser.add_argument( '-f', '--file', type=str, help='Optional: File name for output of parameter optimization', default=""
127
+
)
116
128
args=parser.parse_args()
117
129
location=args.location
118
130
iflocation[-1] !='/':
@@ -130,13 +142,14 @@ def main():
130
142
pool=Pool( processes=args.numProcesses )
131
143
132
144
results= {}
133
-
foriinargs.parameter_sweep:
145
+
foriinargs.parameter_optimize:
134
146
print( "{}".format( i ) )
135
147
spl=i.split( '.' )
136
148
assert( len(spl) ==2 )
137
149
obj, field=spl
138
-
ev=EvalFunc( i, fnames, weights, pool, modelFile )
139
-
results[i] =optimize.minimize_scalar( ev.doEval )
150
+
ev=EvalFunc( i, fnames, weights, pool, modelFile, args.presettle )
print( "Error: Scale {} out of range".format( scale ) )
550
+
assert( False )
551
+
#assert( scale >= 0.0 and scale <= 100.0 )
549
552
ifparams[1] =='Kd':
550
553
ifnotobj.isA[ "ReacBase" ]:
551
554
raiseSimError( "scaleParam: can only assign Kd to a Reac, was: '{}'".format( obj.className ) )
@@ -1435,11 +1438,19 @@ def main():
1435
1438
parser.add_argument( '-hs', '--hide_subplots', action="store_true", help='Hide subplot output of simulation. By default the graphs include dotted lines to indicate individual quantities (e.g., states of a molecule) that are being summed to give a total response. This flag turns off just those dotted lines, while leaving the main plot intact.' )
1436
1439
parser.add_argument( '-o', '--optimize_elec', action="store_true", help='Optimize electrical computation. By default the electrical computation runs for the entire duration of the simulation. With this flag the system turns off the electrical engine except during the times when electrical stimuli are being given. This can be *much* faster.' )
parser.add_argument( '-settle_time', '--settle_time', type=float, default=0, help='Run model for specified settle time and return dict of {path,conc}.' )
0 commit comments