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

Add local Pylint rule ignore directives for E1130 false positives #1197

Merged
merged 7 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ disable = [
"C",
"W",
"E0611", # no-name-in-module
"E1130", # bad operand type for unary ~
]


Expand Down
2 changes: 1 addition & 1 deletion src/tlo/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def unset(self, where, *elements: str, columns: Optional[Union[str, List[str]]]
update. If set to ``None`` (the default) a ``column`` argument must have
been specified when constructing the ``BitsetHandler`` object.
"""
self.df.loc[where, self._get_columns(columns)] &= ~self.element_repr(*elements)
self.df.loc[where, self._get_columns(columns)] &= ~self.element_repr(*elements) # pylint: disable=E1130

def clear(self, where, columns: Optional[Union[str, List[str]]] = None):
"""Clears all the bits for the specified rows.
Expand Down
4 changes: 2 additions & 2 deletions tests/test_bladder_cancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def test_check_progression_through_stages_is_happening(seed):

# check that there are now some people in each of the later stages:
df = sim.population.props
assert not pd.isnull(df.bc_status[~pd.isna(df.date_of_birth)]).any()
assert not pd.isnull(df.bc_status[~pd.isna(df.date_of_birth)]).any() # pylint: disable=E1130
assert (df.loc[df.is_alive & (df.age_years >= 15)].bc_status.value_counts().drop(index='none') > 0).all()

# check that some people have died of bladder cancer
Expand Down Expand Up @@ -314,7 +314,7 @@ def test_that_there_is_no_treatment_without_the_hsi_running(seed):
# check that there are now some people in each of the later stages:
df = sim.population.props
assert len(df.loc[df.is_alive & (df.bc_status != 'none')]) > 0
assert not pd.isnull(df.bc_status[~pd.isna(df.date_of_birth)]).any()
assert not pd.isnull(df.bc_status[~pd.isna(df.date_of_birth)]).any() # pylint: disable=E1130
assert (df.loc[df.is_alive].bc_status.value_counts().drop(index='none') > 0).all()

# check that some people have died of bladder cancer
Expand Down
2 changes: 1 addition & 1 deletion tests/test_breast_cancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def test_check_progression_through_stages_is_happening(seed):

# check that there are now some people in each of the later stages:
df = sim.population.props
assert not pd.isnull(df.brc_status[~pd.isna(df.date_of_birth)]).any()
assert not pd.isnull(df.brc_status[~pd.isna(df.date_of_birth)]).any() # pylint: disable=E1130
# debugging on this line below and there are women alive with breast cancer so not sure why assert is not working
# Create variable for the condition
# condition = df.is_alive & (df.age_years >= 15) & (df.sex == 'F')
Expand Down