diff --git a/my/body/weight.py b/my/body/weight.py index 277b4d1..51e6513 100644 --- a/my/body/weight.py +++ b/my/body/weight.py @@ -83,7 +83,7 @@ def make_dataframe(data: Iterator[Result]): } df = pd.DataFrame(it()) - df.set_index('dt', inplace=True) + df = df.set_index('dt') # TODO not sure about UTC?? df.index = pd.to_datetime(df.index, utc=True) return df diff --git a/my/emfit/__init__.py b/my/emfit/__init__.py index 71a483f..9934903 100644 --- a/my/emfit/__init__.py +++ b/my/emfit/__init__.py @@ -155,9 +155,9 @@ def dataframe() -> DataFrameT: last = s # meh dicts.append(d) - import pandas + import pandas as pd - return pandas.DataFrame(dicts) + return pd.DataFrame(dicts) def stats() -> Stats: diff --git a/ruff.toml b/ruff.toml index 8cbc642..c2c88ef 100644 --- a/ruff.toml +++ b/ruff.toml @@ -9,9 +9,11 @@ lint.extend-select = [ "C4", # flake8-comprehensions -- unnecessary list/map/dict calls "COM", # trailing commas "EXE", # various checks wrt executable files + "ICN", # various import conventions "FBT", # detect use of boolean arguments "FURB", # various rules "PERF", # various potential performance speedups + "PD", # pandas rules "PIE", # 'misc' lints "PLR", # 'refactor' rules "PLW", # pylint warnings @@ -104,4 +106,6 @@ lint.ignore = [ "PT012", # pytest raises should contain a single statement "COM812", # trailing comma missing -- TODO maybe use this? + + "PD901", # generic variable name df ]