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

FIX: Property is_enabled was defined several times in the same class. #959

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MaxJPRey
Copy link
Collaborator

No description provided.

Comment on lines -349 to -370
@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)

Copy link
Collaborator Author

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:

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 😃 .

@MaxJPRey MaxJPRey changed the title FIX: Property is-enabled was defined several times in the same class. FIX: Property is_enabled was defined several times in the same class. Dec 26, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.72%. Comparing base (0ee121c) to head (5715590).

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     

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.

2 participants