From fa69506c7dbde2cf2e7a54c20648a7d9031ac1ce Mon Sep 17 00:00:00 2001 From: Blair Azzopardi Date: Sat, 13 Jan 2024 08:43:16 +0000 Subject: [PATCH] more lint changes --- .flake8 | 2 +- pyproject.toml | 4 ++++ yabte/utilities/plot/matplotlib/strategy_runner.py | 2 +- yabte/utilities/portopt/hierarchical_risk_parity.py | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.flake8 b/.flake8 index fa351e0..69331a0 100644 --- a/.flake8 +++ b/.flake8 @@ -1,3 +1,3 @@ [flake8] max-line-length = 88 -extend-ignore = E203, E704 \ No newline at end of file +extend-ignore = E203, E704, E741 \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index ae5fe27..42bdbe5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,6 +51,10 @@ nbconvert = "^7.2.9" [tool.isort] profile = "black" +[[tool.mypy.overrides]] +module = "plotly.*,scipy.*,matplotlib.*" +ignore_missing_imports = true + [build-system] requires = ["poetry-core>=1.0.0", "setuptools==69.0.2", "mypy==1.8.0", "pandas-stubs==2.1.4.231227"] build-backend = "poetry.core.masonry.api" diff --git a/yabte/utilities/plot/matplotlib/strategy_runner.py b/yabte/utilities/plot/matplotlib/strategy_runner.py index ccbf1b0..70acf8d 100644 --- a/yabte/utilities/plot/matplotlib/strategy_runner.py +++ b/yabte/utilities/plot/matplotlib/strategy_runner.py @@ -111,7 +111,7 @@ def plot_strategy_runner(sr: StrategyRunner, settings: dict[str, Any] | None = N vax = axs[2 * i + 1] vax.yaxis.set_major_formatter(FuncFormatter(lambda x, p: f"{x/1000:,.0f}")) - vax.set_ylabel(f"Volume (thousands)") + vax.set_ylabel("Volume (thousands)") vax.fmt_xdata = date_formatter vax.bar( diff --git a/yabte/utilities/portopt/hierarchical_risk_parity.py b/yabte/utilities/portopt/hierarchical_risk_parity.py index ce250e0..60576fe 100644 --- a/yabte/utilities/portopt/hierarchical_risk_parity.py +++ b/yabte/utilities/portopt/hierarchical_risk_parity.py @@ -36,7 +36,7 @@ def _getClusterVar(cov, cItems): def _getRecBipart(cov, sortIx): # Compute HRP alloc - w = pd.Series(1., index=sortIx) + w = pd.Series(1.0, index=sortIx) cItems = [sortIx] # initialize all items in one cluster while len(cItems) > 0: cItems = [