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

Proposal to move base properties under header #56

Open
bgyori opened this issue Aug 14, 2023 · 3 comments
Open

Proposal to move base properties under header #56

bgyori opened this issue Aug 14, 2023 · 3 comments

Comments

@bgyori
Copy link
Collaborator

bgyori commented Aug 14, 2023

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
Copy link
Collaborator

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
Copy link
Collaborator

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.

@brandomr brandomr moved this to Todo in Integration Aug 15, 2023
@brandomr brandomr moved this from Todo to In Progress in Integration Aug 15, 2023
@bgyori
Copy link
Collaborator Author

bgyori commented Aug 22, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

No branches or pull requests

3 participants