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

Nets and Primitives Refactoring #680

Merged
merged 12 commits into from
Dec 29, 2021
Merged

Nets and Primitives Refactoring #680

merged 12 commits into from
Dec 29, 2021

Conversation

maxcapodi78
Copy link
Collaborator

Now Primitives and Nets from EDB are casted into a new data object. They both inherit the original EDB object so the functionalities and back compatibility is preserved.

Now Primitives and Nets from EDB are casted into a new data object. They both inherit the original EDB object so the functionalities and back compatibility is preserved.
Now Primitives and Nets from EDB are casted into a new data object. They both inherit the original EDB object so the functionalities and back compatibility is preserved.
Copy link
Contributor

@Alberto-DM Alberto-DM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look good to me.
I have only one question about the try: except: clause.

try:
return getattr(self, key)
except:
raise AttributeError("Attribute not present")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When is it going in this except considering the if at line 33?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when you pass a wrong argument

Comment on lines 45 to 55
# def __setattr__(self, key, value):
# if key in dir(self):
# try:
# return setattr(self, key, value)
# except:
# raise AttributeError("Attribute not present")
# else:
# try:
# return setattr(self.rimitive, key, value)
# except:
# raise AttributeError("Attribute not present")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maxcapodi78 Can it be deleted or otherwise remove the comments?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks

@@ -92,7 +93,8 @@ def update_primitives(self):
layoutObjectInstances = layoutInstance.GetAllLayoutObjInstances()
for el in layoutObjectInstances.Items:
try:
self._prims.append(el.GetLayoutObj())
# self._prims.append(el.GetLayoutObj())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# self._prims.append(el.GetLayoutObj())

-------
bool
"""
return not point.IsArc()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be:

Suggested change
return not point.IsArc()
return point.IsArc()

It is surprising to have the not. Maybe the IsArc() implementation is not intuitive.

----------
arc_segments : int
Number of facets to convert an arc. Default is `6`.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change


def _get_points_for_plot(self, my_net_points, num):
"""
Get the points to be plot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Get the points to be plot
Get the points to be plotted.

Returns
-------
list
points generated along the arc.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
points generated along the arc.
Points generated along the arc.


Returns
-------
list
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maxcapodi78 I think that it returns 2 lists.

y = []
for i, point in enumerate(my_net_points):
# point = my_net_points[i]
if not point.IsArc():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the is_arc property (defined below) here.

@maxcapodi78 maxcapodi78 merged commit 2792869 into main Dec 29, 2021
@maxcapodi78 maxcapodi78 deleted the Enhancement/PlotEDBRemote branch December 29, 2021 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants