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

bug in kappy retrieval of snapshots with variables in their name #632

Open
yarden opened this issue Feb 4, 2021 · 0 comments
Open

bug in kappy retrieval of snapshots with variables in their name #632

yarden opened this issue Feb 4, 2021 · 0 comments

Comments

@yarden
Copy link
Contributor

yarden commented Feb 4, 2021

Hi all,

It looks like parsing of snapshots via kappy is broken in newer versions of KappaTools. When the snapshots have variables like [E] in their name, kappy doesn't parse them. Example:

model_code = '''
%agent: A()
%init: 100 A()
'r1' A() -> . @ 0.001
%obs: 'A' |A()|
// model with snapshot
%mod: alarm 500.0 do $SNAPSHOT "snap".[E].".json";
'''
runtime = kappa_std.KappaStd(kappa_sim.KAPPY_URL_TO_USE)
runtime.add_model_string(model_code)
runtime.project_parse()
sim_params = kappy.SimulationParameter(pause_condition="[T] > 600", plot_period=0.1)
runtime.simulation_start(sim_params)
runtime.wait_for_simulation_stop()
result = runtime.simulation_plot()

then if we retrieve the snapshot IDs with:

runtime.simulation_snapshots()

yields, ['snap[E].json'], which is incorrect. (Though kappy will still give you the contents of that snapshot with runtime.simulation_snapshot('snap[E].json').)

If I run the same model via the command KaSim it of course works, producing snapshots such as snap36.json. This used to work with kappy too, if I remember correctly, but I recently upgraded and can't trace now which version had it working. Unless perhaps something else in the interface changed that I'm missing? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant