-
Notifications
You must be signed in to change notification settings - Fork 184
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
Component info/metadata #2623
Comments
I think generally this is fine. Maybe I can explain why kfactory is doing this. If your info (and to some degree settings) are kayout serializable types (mainly shapes, this theoretically includes some potentially interesting types such as a full lyp datastructure, therefore enabling saving the lyp within the gds/oas), you can save your layout (or even pdk) and completely restore a (static) state. Meaning if your pdk only contains static cells, you can package it as a gds. This comes in extremely handy when you want to load for example special cells from the fab or old designs. They still have all the info and even paramters accessible. But yes, if info should be fully dynamic, we can rename the attribute in kfactory and with that avoid having to have separate types for info.metadata vs the rest of info. |
Thanks for the explanation, the info constraint makes a lot more sense in the context of storing the full state within the GDS file. Technically we can add extra attributes directly to the Maybe it would make sense to have there be a |
KFactory can now read any dict/tuple/list if they contain built-ins (int/float/bool/None) or KLayout shapes (and theoretically other serializable objects. I would still caution against storing test manifest or similar in there. There is a max size and if that one is exceeded, kfactory/klayout will crash ugly on write (core dump) |
Recently, the model field validation of
Info
(used forComponent.info
) was changed to only allow sequences, numbers, and strings. I understand that this is to be able to serialize the wholeInfo
object and add it to the GDS metadata once we transition to using the kfactory backend.I find that this change unnecessarily limits what we can add to the
Info
, and it specifically prevents hierarchical data from being added in a nice way (we can use nested tuples but parsing that is needlessly complicated). A carve-out was recently added for theschematic
key and I wonder whether we can instead just have ametadata
field withinInfo
and constrain its types instead of all ofInfo
. Doing is this way would also make it clearer that whatever is going intoInfo.metadata
is intended to be written as GDS metadata.So I propose we add a
metadata
field to theInfo
model and enforce the GDS metadata-serializable types on it rather than on everything withinInfo
.Let me know what you think @joamatab
The text was updated successfully, but these errors were encountered: