Skip to content

Reloading cell libraries does not work #2168

Closed

Description

@martinjankoehler

Steps to reproduce

  • Create a cell library ~/.klayout/libraries/mylib.gds.gz with a top cell rect
  • In another tab, open a top.gds layout and place an instance of the mylib.rect
  • Then switch to the mylib tab, set rect as top cell and change the layout, then save
  • Switch to top.gds tab, and click File→Reload
  • EXPECTED: instance mylib.rect to be updated with the latest saved version
  • OBTAINED: instance stays the same

Activity

  1. klayoutmatthias commented on Oct 2, 2025

    @klayoutmatthias
    Collaborator

    Hi Martin,

    You're right. That is not supported right now. Libraries are instantiated at startup time and not reloaded. The original intention is to have libraries that are static (i.e. PDK) components, not pieces that are edited in parallel.

    I understand that a "reload" feature would help too. But there are corner cases: libraries are basically Python or Ruby objects - loading them from a file is one option, but dynamically generating them is another one. Also there is a request to load multiple files into the same library. That flexibility makes it difficult to define "reload". At least in case of the code, execution of the code equals "reloading", but that requires an extension of the library API by a "reload" method and also implementation of that function.

    Matthias

  2. martinjankoehler commented on Oct 3, 2025

    @martinjankoehler
    CollaboratorAuthor

    Hi Matthias,

    this API function already seems to exist
    https://www.klayout.de/doc/code/class_Library.html#method29

    Signature: void refresh

    Description: Updates all layouts using this library.

    This method will retire cells or update layouts in the attached clients. It will also recompute the PCells inside the library. This method has been introduced in version 0.27.8.

  3. added this to the 0.30.5 milestone on Oct 11, 2025
  4. klayoutmatthias commented on Oct 11, 2025

    @klayoutmatthias
    Collaborator

    There is a new Method "Library#refresh_all" (static) and you can create your own reloader by reimplementing Library#reload (needs to return the library name). Also, the "File" menu now has a new entry "Refresh Libraries".

    However, I could not reproduce the original issue - for me, library layouts that got changed are reloaded automatically.

    Because it was convenient, this patch also contains new features for #2172.

  5. linked a pull request that will close this issueFeature/issue 2168 #2178on Oct 18, 2025
  6. klayoutmatthias commented on Nov 9, 2025

    @klayoutmatthias
    Collaborator

    Feature is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions