Skip to content

0.30: TypeList PCell parameter issue in Instance Properties dialog #2025

Description

@caspar-iqm

Starting with version 0.30.0 (testing on Windows), list parameters get surrounded in parentheses in the Instance Properties dialog. Every time any parameter is changed, another set of parentheses is added around the list.

From what I can see, this issue is related to the properties window. I did not notice issues using PCells programatically.

Example

A basic PCell with list parameter:

import pya

class DummyPCell(pya.PCellDeclarationHelper):
  def __init__(self):
    super(DummyPCell, self).__init__()

    self.param("s", self.TypeShape, "", default = pya.DPoint(0, 0))  # Something to select
    self.param("n", self.TypeInt, "Number", default = 10)
    self.param("list_of_strings", self.TypeList, "List of strings", default = ["one", "two", "three"])

  def coerce_parameters_impl(self):
    print(f"{self.n=}, {self.list_of_strings=}")


class MyLib(pya.Library):
  def __init__(self):
    self.description = "Dummy Library"
    self.layout().register_pcell("DummyPCell", DummyPCell())
    self.register("MyLib")

MyLib()

Placing an instance and opening the properties dialog:

Image

Editing the n property or even just going through the list with tab adds more parentheses:

Image

The printout in coerce_parameters_impl shows that when reading the dialog, the parentheses just get interpreted as part of the first and last item:

self.n=1, self.list_of_strings=['one', 'two', 'three']
self.n=1, self.list_of_strings=['(one', 'two', 'three)']
self.n=1, self.list_of_strings=['((one', 'two', 'three))']
self.n=1, self.list_of_strings=['(((one', 'two', 'three)))']

Activity

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions