Skip to content

Commit

Permalink
remove useless pylint suppression (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
rpreen authored Jun 3, 2024
1 parent 7f145e7 commit 6e1dde5
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 15 deletions.
12 changes: 6 additions & 6 deletions acro/acro_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self, config) -> None:
self.config = config
self.results: Records = Records()

def ols( # pylint: disable=too-many-locals
def ols(
self, endog, exog=None, missing="none", hasconst=None, **kwargs
) -> RegressionResultsWrapper:
"""Fits Ordinary Least Squares Regression.
Expand Down Expand Up @@ -76,7 +76,7 @@ def ols( # pylint: disable=too-many-locals
)
return results

def olsr( # pylint: disable=too-many-locals,keyword-arg-before-vararg
def olsr( # pylint: disable=keyword-arg-before-vararg
self, formula, data, subset=None, drop_cols=None, *args, **kwargs
) -> RegressionResultsWrapper:
"""Fits Ordinary Least Squares Regression from a formula and dataframe.
Expand Down Expand Up @@ -141,7 +141,7 @@ def olsr( # pylint: disable=too-many-locals,keyword-arg-before-vararg
)
return results

def logit( # pylint: disable=too-many-arguments,too-many-locals
def logit(
self,
endog,
exog,
Expand Down Expand Up @@ -190,7 +190,7 @@ def logit( # pylint: disable=too-many-arguments,too-many-locals
)
return results

def logitr( # pylint: disable=too-many-locals,keyword-arg-before-vararg
def logitr( # pylint: disable=keyword-arg-before-vararg
self, formula, data, subset=None, drop_cols=None, *args, **kwargs
) -> RegressionResultsWrapper:
"""Fits Logit model from a formula and dataframe.
Expand Down Expand Up @@ -255,7 +255,7 @@ def logitr( # pylint: disable=too-many-locals,keyword-arg-before-vararg
)
return results

def probit( # pylint: disable=too-many-arguments,too-many-locals
def probit(
self,
endog,
exog,
Expand Down Expand Up @@ -304,7 +304,7 @@ def probit( # pylint: disable=too-many-arguments,too-many-locals
)
return results

def probitr( # pylint: disable=too-many-locals,keyword-arg-before-vararg
def probitr( # pylint: disable=keyword-arg-before-vararg
self, formula, data, subset=None, drop_cols=None, *args, **kwargs
) -> RegressionResultsWrapper:
"""Fits Probit model from a formula and dataframe.
Expand Down
4 changes: 2 additions & 2 deletions acro/acro_stata_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def parse_table_details(
return details


def parse_and_run( # pylint: disable=too-many-arguments,too-many-locals
def parse_and_run( # pylint: disable=too-many-arguments
mydata: pd.DataFrame,
command: str,
varlist_as_str: str,
Expand Down Expand Up @@ -438,7 +438,7 @@ def creates_datasets(data, details):
return set_of_data, msg


def run_table_command( # pylint: disable=too-many-arguments,too-many-locals
def run_table_command( # pylint: disable=too-many-locals
data: pd.DataFrame,
varlist: list,
weights: str,
Expand Down
12 changes: 6 additions & 6 deletions acro/acro_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def pivot_table( # pylint: disable=too-many-arguments,too-many-locals
n_agg: int = 1 if not isinstance(aggfunc, list) else len(aggfunc)

# requested table
table: DataFrame = pd.pivot_table( # pylint: disable=too-many-function-args
table: DataFrame = pd.pivot_table(
data,
values,
index,
Expand Down Expand Up @@ -445,7 +445,7 @@ def surv_func( # pylint: disable=too-many-arguments,too-many-locals
"""
logger.debug("surv_func()")
command: str = utils.get_command("surv_func()", stack())
survival_func: DataFrame = sm.SurvfuncRight( # pylint: disable=too-many-function-args
survival_func: DataFrame = sm.SurvfuncRight(
time,
status,
entry,
Expand Down Expand Up @@ -488,7 +488,7 @@ def surv_func( # pylint: disable=too-many-arguments,too-many-locals
return (plot, filename)
return None

def survival_table( # pylint: disable=too-many-arguments,too-many-locals
def survival_table( # pylint: disable=too-many-arguments
self, survival_table, safe_table, status, sdc, command, summary, outcome
):
"""Create the survival table according to the status of suppressing."""
Expand All @@ -506,7 +506,7 @@ def survival_table( # pylint: disable=too-many-arguments,too-many-locals
)
return survival_table

def survival_plot( # pylint: disable=too-many-arguments,too-many-locals
def survival_plot( # pylint: disable=too-many-arguments
self, survival_table, survival_func, filename, status, sdc, command, summary
):
"""Create the survival plot according to the status of suppressing."""
Expand Down Expand Up @@ -644,7 +644,7 @@ def hist( # pylint: disable=too-many-arguments,too-many-locals
)
return None

freq, _ = np.histogram( # pylint: disable=too-many-function-args
freq, _ = np.histogram(
data[column], bins, range=(data[column].min(), data[column].max())
)

Expand Down Expand Up @@ -1557,7 +1557,7 @@ def crosstab_with_totals( # pylint: disable=too-many-arguments,too-many-locals
return table


def manual_crossstab_with_totals( # pylint: disable=too-many-arguments,too-many-locals
def manual_crossstab_with_totals( # pylint: disable=too-many-arguments
table,
aggfunc,
index,
Expand Down
2 changes: 1 addition & 1 deletion acro/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def load_output(path: str, output: list[str]) -> list[str] | list[DataFrame]:
return loaded


class Record: # pylint: disable=too-many-instance-attributes,too-few-public-methods
class Record: # pylint: disable=too-many-instance-attributes
"""Stores data related to a single output record.
Attributes
Expand Down
26 changes: 26 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,31 @@ lint.select = [
"D", # pydocstyle
# "DTZ", # flake8-datetimez
# "E", # pycodestyle
# "EM", # flake8-errmsg
# "ERA", # eradicate
"F", # Pyflakes
"I", # isort
"ICN", # flake8-import-conventions
"N", # pep8-naming
# "PD", # pandas-vet
# "PGH", # pygrep-hooks
"PIE", # flake8-pie
# "PL", # Pylint
"PLC", # Pylint
"PLE", # Pylint
# "PLR", # Pylint
# "PLW", # Pylint
# "PT", # flake8-pytest-style
"Q", # flake8-quotes
# "RET", # flake8-return
"RUF100", # Ruff-specific
# "S", # flake8-bandit
# "SIM", # flake8-simplify
# "T20", # flake8-print
"TID", # flake8-tidy-imports
"UP", # pyupgrade
"W", # pycodestyle
"YTT", # flake8-2020
]

exclude = [
Expand All @@ -54,3 +61,22 @@ convention = "numpy"
[tool.ruff.format]
docstring-code-format = true
docstring-code-line-length = 20

[tool.pylint]
master.py-version = "3.9"
reports.output-format = "colorized"

[tool.pylint.messages_control]
enable = [
"useless-suppression",
]

[tool.mypy]
python_version = "3.9"
#exclude = "docs/source/conf.py"
#strict = false
#warn_unreachable = true
#ignore_missing_imports = true
#follow_imports = false
#disallow_untyped_defs = false
#disallow_untyped_calls = false

0 comments on commit 6e1dde5

Please sign in to comment.