-
Notifications
You must be signed in to change notification settings - Fork 14
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
Inability to save output #93
Comments
@evadelmas any idea what this is? @kwootton the line to save in JSON should have |
Sorry for the delay. It's fixed now and should be released in the next few days. This was caused by JSON not being able to convert some parameters to strings (i.e. density dependent mortality for consumers and resources - dp and dc - because they are functions). They will now be saved as |
Great, thank you! |
Closed by #98 |
Expected behavior
I have run the simulations and now want to save the output - ideally in a form where I can read it into R.
Actual behavior
If I run BioEnergeticFoodWebs.save(filename, as = json) I don't get any error, but I also don't get any output.
If I try JSON.print(f,sim) I get the error:
ERROR: Cannot serialize type getfield(BioEnergeticFoodWebs, Symbol("##10#14"))
JSON.print used to work for me fine a year or two ago so I guess there's some issue with an update somewhere along the line?
Steps to reproduce
1.using BioEnergeticFoodWebs, JSON
2.foodweb = nichemodel(10,0.3);
3.bm = rand(size(foodweb,1));
4. params = model_parameters(foodweb)
5. sim = simulate(params, bm, start = 0, stop = 1000);
6.f=open("trial.json","w")
7.JSON.print(f,sim)
System information
julia --version
julia version 1.1.0 (but I have the same problem with 1.0.5)
Pkg.status("BioEnergeticFoodWebs")
BioEnergeticFoodWebs v1.1.2
OS and version
Ubuntu 18.04.4 LTS (Bionic Beaver)
The text was updated successfully, but these errors were encountered: