-
Notifications
You must be signed in to change notification settings - Fork 8
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
FIX: Property is_enabled was defined several times in the same class. #959
base: main
Are you sure you want to change the base?
Conversation
@property | ||
def is_enabled(self): | ||
"""Flag indicating if the current object is enabled. | ||
|
||
Returns | ||
------- | ||
bool | ||
``True`` if current object is enabled, ``False`` otherwise. | ||
""" | ||
if self.type in ["Resistor", "Capacitor", "Inductor"]: | ||
return self.component_property.IsEnabled() | ||
else: # pragma: no cover | ||
return True | ||
|
||
@is_enabled.setter | ||
def is_enabled(self, enabled): | ||
"""Enables the current object.""" | ||
if self.type in ["Resistor", "Capacitor", "Inductor"]: | ||
component_property = self.component_property | ||
component_property.SetEnabled(enabled) | ||
self.edbcomponent.SetComponentProperty(component_property) | ||
|
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.
@hui-zhou-a @svandenb-dev . I think we can delete those lines as is_enabled
is deprecated in favor of enabled
based on this comment:
pyedb/src/pyedb/dotnet/edb_core/cell/hierarchy/component.py
Lines 183 to 197 in 3172b5b
def is_enabled(self): | |
"""Get or Set the component to active mode. | |
Returns | |
------- | |
bool | |
``True`` if component is active, ``False`` if is disabled.. | |
""" | |
warnings.warn("Use new property :func:`enabled` instead.", DeprecationWarning) | |
return self.enabled | |
@is_enabled.setter | |
def is_enabled(self, value): | |
warnings.warn("Use new property :func:`enabled` instead.", DeprecationWarning) | |
self.enabled = value |
Your expertise will decide if we keep it or not 😃 .
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #959 +/- ##
==========================================
+ Coverage 82.69% 82.72% +0.03%
==========================================
Files 160 160
Lines 21117 21108 -9
==========================================
- Hits 17462 17461 -1
+ Misses 3655 3647 -8 |
No description provided.