DARPA-ASKEM / Model-Representations

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

Proposal to move base properties under header #56

Open bgyori opened 10 months ago

bgyori commented 10 months ago

In #54, a the new AMR structure implemented by @jpfairbanks for Decapodes puts base (top-level) properties of the AMR under a key called header. These properties are: schema, schema_name, name, description and model_version. If we decide to put these properties under header for Decapodes then for consistency with a single base schema it would be good to make the same change for other frameworks, petrinet and regnet. Example:

Current:

{
  "name": "SIR Model",
  "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json",
  "description": "SIR model",
  "schema_name": "petrinet",
  "model_version": "0.1",
  "model": {...},
  "semantics": {...}
  ...
}

Proposed:

{
  "header": {
    "name": "SIR Model",
    "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json",
    "description": "SIR model",
    "schema_name": "petrinet",
    "model_version": "0.1",
  },
  "model": {...},
  "semantics": {...}
  ...
} 

What are people's thoughts about this?

brandomr commented 10 months ago

In general this change seems fine to me.

I do worry a bit that this will require (small) updates to a variety of applications and might introduce some regressions. Nothing we can't handle but it will impact most teams I suspect.

jpfairbanks commented 10 months ago

Yeah, it shouldn't be a big deal in existing code, but going forward the Decapodes AMR will have nested models that have as fields lists of models. Each of the models all the way down will have header objects and if we don't group them into a struct that can be included in each model type, there will be several structs with several repeated fields. Better to fix it now before we make more copy-pasta.

bgyori commented 10 months ago

I merged my changes to the schemas and examples, and released tags petrinet_v0.6 and regnet_v0.2. Teams should take note to update their code to work with the latest formats.