hammer icon indicating copy to clipboard operation
hammer copied to clipboard

Hammer tech JSON validity checker tool

Open edwardcwang opened this issue 6 years ago • 7 comments

Would be nice to have a hammer shell tool that checks that a technology's .json is valid.

This is the .tech.json equivalent of #160

edwardcwang avatar Aug 13 '18 01:08 edwardcwang

See #220

colinschmidt avatar Oct 17 '18 23:10 colinschmidt

Related #114

colinschmidt avatar Mar 08 '19 19:03 colinschmidt

Is this really needed if we solve #114 and #220?

jwright6323 avatar Oct 17 '19 23:10 jwright6323

Yes, I think we still need this since #114 is to make writing MMMC easier and #220 is specific to MMMC. This is needed to help catch errors like gds map flie.

@colinschmidt Are you working on this actively?

edwardcwang avatar Oct 19 '19 05:10 edwardcwang

No I will be working on #114 and #220 because I think thats the primary cause for need for validation.

colinschmidt avatar Oct 20 '19 22:10 colinschmidt

TechJSON is now a Pydantic model, so validation is implicit.

I think having printed schema is still helpful - @vighneshiyer thoughts on having our PR CI generate/update a schema.json file using .schema_json() on the TechJSON class?

harrisonliew avatar Jan 21 '23 01:01 harrisonliew

Technically Pydantic doesn't perform precise validation on types upon deserialization (since it can coerce values found in the JSON to those annotated in the BaseModel). But it will validate that the schema / structure of the JSON matches that of the BaseModel.

And sure we can create a schema file from the TechJSON Model. I think we can have the readthedocs dotfile call a script that produces the schema.json file and we can include it in the docs.

vighneshiyer avatar Jan 21 '23 02:01 vighneshiyer