DARPA-ASKEM / Model-Representations

Modeling framework representations for ASKEM
https://darpa-askem.github.io/Model-Representations/
8 stars 2 forks source link

AMR issues with pde petrinets #78

Open sabinala opened 5 months ago

sabinala commented 5 months ago

When trying to use the petrinet AMRs from this directory to solve PDEs with PyCIEMSS, I found a few issues with the AMRs:

P.S. there's a typo in Drisana's last name should be Mosaphir, or Iverson (Mosaphir)

sabinala commented 5 months ago

@danbryce After correcting the AMR issues, I'm still getting a Runtime error so I don't have results yet, but I will track down what's going on and get back to you.

danbryce commented 5 months ago

@sabinala Thanks for the feedback. I've updated the PR #77 to address a few of your points, summarized as follows:

I think most of these issues are based on how I'm generating python from the json schema and then serializing it with pydantic. It should be correct (for some definition of correct), but needed some care with the serialization flags.

sabinala commented 5 months ago

@danbryce Thank you. I may have misinterpreted the error message re: the header, it said something about this needing to be the first thing in the file, so as long as what follows is further indented, it should be ok. I'll try using these AMRs again later today.

danbryce commented 5 months ago

@sabinala Which tool is complaining about the format? I’ve been generating the json with pydantic, based upon Python classes generated from the json schema for petrinet AMRs. The PR README links to the script used to generate the json files. The specific location is: https://github.com/siftech/funman/blob/f092804465b0665f23e587e7f5bc05689c483711/auxiliary_packages/pde2petri/src/pde2petri/generators/common.py#L107

It should be relatively painless to modify the code to deserialize the json if you working in Python. See: https://docs.pydantic.dev/latest/concepts/json/

On Jan 18, 2024, at 10:59 AM, sabinala @.***> wrote:

@danbryce Thank you. I may have misinterpreted the error message re: the header, it said something about this needing to be the first thing in the file, so as long as what follows is further indented, it should be ok. I'll try using these AMRs again later today. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

sabinala commented 5 months ago

@danbryce ok thanks, I'll take a look at that. The error is coming from PyCIEMSS when trying to read the AMR.