-
Notifications
You must be signed in to change notification settings - Fork 17
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
attempt to add interface models #14
Conversation
clean notebook outputs
74915fa
to
eb103fb
Compare
It also looks like the notebooks did not cleanup properly. Or maybe they're just hard to read haha |
@@ -599,6 +738,11 @@ | |||
" netlist, instance_models = _extract_instance_models(netlist)\n", | |||
" \n", | |||
" recnet: RecursiveNetlist = _validate_net(netlist)\n", | |||
"\n", | |||
" # add connection models into recursive netlist\n", | |||
" if connection_models:\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the call to modify the netlist/models based on the contents of connection_models
" return connections, ports, models\n", | ||
"\n", | ||
"\n", | ||
"def _add_connection_models_recursive(recnet, models, connection_models):\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function and the one below try to add the connection_models to the main netlist/models
Hi Simon, I realize using nbdev might be a bit of a strange environment to work in. I personally love it, but I think to encourage future contributions I might convert the repository to a more standard layout again. Personally, I often just use the interactive nature of a notebook for debugging, but there are other options such as this one: In terms of generating the library from the notebooks, it's easiest to do a I'm fine with merging into main directly. As long as a commit is not tagged I consider this a dev branch. Is the PR finished? Currently when I run |
Thanks for the tips! I still need to figure out this component issue, might not be able to get to it for another week or so |
Closing for now since this can be emulated with interface components anyway |
Hi @flaport , I've started giving a shot at #13 , see attached branch. Can I merge to a dev branch here maybe?
Couple questions:
It's my first time using nbdev for development, what is your typical workflow? I've been adding cells in the most relevant notebook and rerunning the higher cells with code I need to change, but it seems a bit unwieldy. Also what debugger do you use?
Playing with notebook 07, I was able to update the netlist/add models conditioned on if a key of the new "connection_models" dict matches an existing connection. The simplest plan would be to replace, in the unrolled netlist, all the connections that are represented in the "connection_models" keys by a old_instance --> dummy_component associated with connection_model --> old_instance sequence, and then running the calculation as usual.
But now I am getting errors about the instance being added not being a gdsfactory Component. However I think we don't think gdsfactory is a dependency. Or is it? What do you recommend?
Thanks!