Skip to content
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

Help on adding datatypes as an option to qgeometries #982

Open
maxhant opened this issue Jan 16, 2024 · 5 comments
Open

Help on adding datatypes as an option to qgeometries #982

maxhant opened this issue Jan 16, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@maxhant
Copy link

maxhant commented Jan 16, 2024

I want to have the option to choose which GDS datatype each geometry will belong to. For that, I have tried editing the render as follows:

    def _qgeometry_to_gds(
        self, qgeometry_element: pd.Series
    ) -> Union['gdspy.polygon', 'gdspy.FlexPath', None]:
        """
         Docs
        """

        # pylint: disable=too-many-locals

        corners = self.options.corners
        tolerance = self.parse_value(self.options.tolerance)
        precision = self.parse_value(self.options.precision)
        max_points = int(self.parse_value(self.options.max_points))

        geom = qgeometry_element.geometry  # type: shapely.geometry.base.BaseGeometry

        if isinstance(geom, shapely.geometry.Polygon):
            exterior_poly = gdspy.Polygon(
                list(geom.exterior.coords),
                layer=qgeometry_element.layer,
                datatype=qgeometry_element.sublayer,
            )

However, it does not work and I don't really understand why. It has an impact which is that all geometries are now on datatype 0. Can someone point me to the right direction?

What is the feature being requested?

Being able to expose the same layer with different intensities. Having them on separate layers does not work, else the cheesing will ignore the feature on higher layers. I have been discussing this on Slack.

What are use cases for this feature?

Having a more advanced fab.

@maxhant maxhant added the enhancement New feature or request label Jan 16, 2024
@zlatko-minev zlatko-minev self-assigned this Jan 16, 2024
@zlatko-minev
Copy link
Collaborator

You have correctly identified the location where the GDS polygon is created and you can specify its
datatype (integer) – The GDSII datatype for this element (between 0 and 255).

What is qgeometry_element.sublayer? How do you set it, it must be set to zero.
You can print the dataframe that is qgeometry_element or where it comes from. This is probably the issue that this dataframe object is not set correctly

@maxhant
Copy link
Author

maxhant commented Jan 17, 2024

Hi @zlatko-minev, thanks for your quick answer. I have created a draft PR #983 for you to see what I have done. Please, keep in mind that I am a novice at all this, but I am happy to learn to make it right!

@zlatko-minev
Copy link
Collaborator

Great job, very well done! This is a substantial change part of the code so we should take this a little carefully.

Have you checked this in one or two settings to make sure it works and doesn't fail anywhere?

Is it backwards compatible

@maxhant
Copy link
Author

maxhant commented Jan 18, 2024

Have you checked this in one or two settings to make sure it works and doesn't fail anywhere?

For now, it does not work, so it is already failing. I was hoping that you would know what am I missing to have it working.

Once it works, which settings do you want me to test and I will test it properly?

@zlatko-minev
Copy link
Collaborator

Can you tell me more about where it is failing.

Ideally you can print the pandas datatables that are the tables and post a screenshot of them here.

you can do

from IPython.display import display
display(my_table_variable)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants