-
Notifications
You must be signed in to change notification settings - Fork 134
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
Conversation
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.
…Enhancement/PlotEDBRemote
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.
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") |
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.
When is it going in this except
considering the if
at line 33?
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.
when you pass a wrong argument
pyaedt/edb_core/EDB_Data.py
Outdated
# 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") |
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.
@maxcapodi78 Can it be deleted or otherwise remove the comments?
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.
Done. Thanks
pyaedt/edb_core/layout.py
Outdated
@@ -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()) |
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.
# self._prims.append(el.GetLayoutObj()) |
pyaedt/edb_core/EDB_Data.py
Outdated
------- | ||
bool | ||
""" | ||
return not point.IsArc() |
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.
Should it be:
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`. | ||
|
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.
pyaedt/edb_core/EDB_Data.py
Outdated
|
||
def _get_points_for_plot(self, my_net_points, num): | ||
""" | ||
Get the points to be plot |
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.
Get the points to be plot | |
Get the points to be plotted. |
pyaedt/edb_core/EDB_Data.py
Outdated
Returns | ||
------- | ||
list | ||
points generated along the arc. |
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.
points generated along the arc. | |
Points generated along the arc. |
pyaedt/edb_core/EDB_Data.py
Outdated
|
||
Returns | ||
------- | ||
list |
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.
@maxcapodi78 I think that it returns 2 lists.
pyaedt/edb_core/EDB_Data.py
Outdated
y = [] | ||
for i, point in enumerate(my_net_points): | ||
# point = my_net_points[i] | ||
if not point.IsArc(): |
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.
You can use the is_arc
property (defined below) here.
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.