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
---------------------------------------------------------------------------KeyErrorTraceback (mostrecentcalllast)
CellIn[16], line63logging_step_size=10.04num_samples=1---->6result=pyciemss.sample(model, end_time, logging_step_size, num_samples, start_time=start_time)
7# display(result['data'].head())89# Plot results10schema=plots.trajectories(result["data"], keep=".*_state")
File~/Projects/pyciemss/pyciemss/integration_utils/custom_decorators.py:29, inpyciemss_logging_wrapper.<locals>.wrapped(*args, **kwargs)
17log_message=""" 18 ############################### 19 (...) 26 ################################ 27 """28logging.exception(log_message, function.__name__, function.__doc__)
--->29raiseeFile~/Projects/pyciemss/pyciemss/integration_utils/custom_decorators.py:10, inpyciemss_logging_wrapper.<locals>.wrapped(*args, **kwargs)
8try:
9start_time=time.perf_counter()
--->10result=function(*args, **kwargs)
11end_time=time.perf_counter()
12logging.info(
13"Elapsed time for %s: %f", function.__name__, end_time-start_time14 )
File~/Projects/pyciemss/pyciemss/interfaces.py:239, insample(model_path_or_json, end_time, logging_step_size, num_samples, noise_model, noise_model_kwargs, solver_method, solver_options, start_time, inferred_parameters, static_state_interventions, static_parameter_interventions, dynamic_state_interventions, dynamic_parameter_interventions)
171""" 172 Load a model from a file, compile it into a probabilistic program, and sample from it. 173 (...) 235 and (num_samples,) for parameters. 236 """238withtorch.no_grad():
-->239model=CompiledDynamics.load(model_path_or_json)
241logging_times=torch.arange(
242start_time+logging_step_size, end_time, logging_step_size243 )
245# Check that num_samples is a positive integerFile~/anaconda3/lib/python3.10/functools.py:926, insingledispatchmethod.__get__.<locals>._method(*args, **kwargs)
924def_method(*args, **kwargs):
925method=self.dispatcher.dispatch(args[0].__class__)
-->926returnmethod.__get__(obj, cls)(*args, **kwargs)
File~/Projects/pyciemss/pyciemss/compiled_dynamics.py:108, inCompiledDynamics._load_from_url_or_path(cls, path)
106model=mira.sources.amr.model_from_url(path)
107else:
-->108model=mira.sources.amr.model_from_json_file(path)
109returncls.load(model)
File~/anaconda3/lib/python3.10/site-packages/mira/sources/amr/__init__.py:45, inmodel_from_json_file(fname)
43withopen(fname) asfh:
44model_json=json.load(fh)
--->45returnmodel_from_json(model_json)
File~/anaconda3/lib/python3.10/site-packages/mira/sources/amr/__init__.py:71, inmodel_from_json(model_json)
69returnregnet.template_model_from_amr_json(model_json)
70elif'stockflow'inheader['schema']:
--->71returnstockflow.template_model_from_amr_json(model_json)
72else:
73raiseValueError(f'Unknown schema: {header["schema"]}')
File~/anaconda3/lib/python3.10/site-packages/mira/sources/amr/stockflow.py:112, intemplate_model_from_amr_json(model_json)
105# A stock is considered a controller if it has a link to the given106# flow but is not an input to the flow, and is not an auxiliary107controllers= [link['source'] forlinkinlinksif (
108link['target'] ==flow['id']
109andlink['source'] !=input110andlink['source'] notinaux_expressions)]
-->112input_concepts= [concepts[input].copy(deep=True)]
113output_concepts= [concepts[output].copy(deep=True)]
114controller_concepts= [concepts[i].copy(deep=True) foriincontrollers]
KeyError: None
The text was updated successfully, but these errors were encountered:
mira/notebooks/hackathon_2024.02/scenario5/scenario_5_stockflow.json
Line 15 in 17b194e
results in this error
The text was updated successfully, but these errors were encountered: