Fix local variable is assigned to but never used

This commit is contained in:
Christian Clauss
2021-03-06 10:01:42 +01:00
parent bf1a2a5c33
commit 9fcfe1bdca
4 changed files with 12 additions and 9 deletions

View File

@@ -24,7 +24,7 @@ jobs:
- run: bandit -r . || true
- run: black --check .
- run: codespell --ignore-words-list="mape" --quiet-level=2 --skip=".git" # --skip=""
- run: flake8 . --count --ignore=E203,E302,F401,F841,W503 --max-line-length=140 --show-source --statistics
- run: flake8 . --count --ignore=E203,E302,F401,W503 --max-line-length=140 --show-source --statistics
- run: mypy --ignore-missing-imports . || true
- run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true
- run: safety check

View File

@@ -163,10 +163,10 @@ def inference(l_args, s_ticker):
if df_tweets["sentiment_estimation"].values[-1] > 0:
n_pos = df_tweets[df_tweets["prob_sen"] > 0]["prob_sen"].sum()
# pylint: disable=unused-variable
n_pct = round(100 * n_pos / df_tweets["probability"].sum())
n_pct = round(100 * n_pos / df_tweets["probability"].sum()) # noqa: F841
else:
n_neg = abs(df_tweets[df_tweets["prob_sen"] < 0]["prob_sen"].sum())
n_pct = round(100 * n_neg / df_tweets["probability"].sum())
n_pct = round(100 * n_neg / df_tweets["probability"].sum()) # noqa: F841
# Parse tweets
dt_from = dateutil.parser.parse(df_tweets["created_at"].values[-1])

View File

@@ -215,7 +215,7 @@ def vwap(l_args, s_ticker, s_interval, df_stock):
plt.ylabel("Share Price ($)")
plt.legend([s_ticker, "VWAP"])
# pylint: disable=unused-variable
axVolume = axPrice.twinx()
axVolume = axPrice.twinx() # noqa: F841
plt.bar(
df_stock.index,
df_stock["6. volume"].values,
@@ -248,7 +248,8 @@ def vwap(l_args, s_ticker, s_interval, df_stock):
plt.xlabel("Time")
plt.ylabel("Share Price ($)")
plt.legend([s_ticker, "VWAP"])
axVolume = axPrice.twinx()
# pylint: disable=unused-variable
axVolume = axPrice.twinx() # noqa: F841
plt.bar(
df_stock.index,
df_stock["5. volume"].values,

View File

@@ -79,7 +79,7 @@ def ad(l_args, s_ticker, s_interval, df_stock):
plt.minorticks_on()
plt.grid(b=True, which="minor", color="#999999", linestyle="-", alpha=0.2)
# pylint: disable=unused-variable
axVolume = axPrice.twinx()
axVolume = axPrice.twinx() # noqa: F841
plt.bar(
df_stock.index,
df_stock["6. volume"].values,
@@ -128,7 +128,8 @@ def ad(l_args, s_ticker, s_interval, df_stock):
plt.grid(b=True, which="major", color="#666666", linestyle="-")
plt.minorticks_on()
plt.grid(b=True, which="minor", color="#999999", linestyle="-", alpha=0.2)
axVolume = axPrice.twinx()
# pylint: disable=unused-variable
axVolume = axPrice.twinx() # noqa: F841
plt.bar(
df_stock.index,
df_stock["5. volume"].values,
@@ -203,7 +204,7 @@ def obv(l_args, s_ticker, s_interval, df_stock):
plt.minorticks_on()
plt.grid(b=True, which="minor", color="#999999", linestyle="-", alpha=0.2)
# pylint: disable=unused-variable
axVolume = axPrice.twinx()
axVolume = axPrice.twinx() # noqa: F841
plt.bar(
df_stock.index,
df_stock["6. volume"].values,
@@ -237,7 +238,8 @@ def obv(l_args, s_ticker, s_interval, df_stock):
plt.grid(b=True, which="major", color="#666666", linestyle="-")
plt.minorticks_on()
plt.grid(b=True, which="minor", color="#999999", linestyle="-", alpha=0.2)
axVolume = axPrice.twinx()
# pylint: disable=unused-variable
axVolume = axPrice.twinx() # noqa: F841
plt.bar(
df_stock.index,
df_stock["5. volume"].values,