Skip to content

Commit

Permalink
ci: Quality
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Jul 8, 2024
1 parent 0c913a5 commit b9fbcd5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions docs/snippets/gallery/matplotlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
# Load a numpy record array from yahoo csv data with fields date, open, close,
# volume, adj_close from the mpl-data/example directory. The record array
# stores the date as an np.datetime64 with a day unit ('D') in the date column.
price_data = cbook.get_sample_data("goog.npz", np_load=True)["price_data"].view(np.recarray)
price_data = cbook.get_sample_data("goog.npz")["price_data"]
price_data = price_data[-250:] # get the most recent 250 trading days

delta1 = np.diff(price_data.adj_close) / price_data.adj_close[:-1]
delta1 = np.diff(price_data["adj_close"]) / price_data["adj_close"][:-1]

# Marker size in units of points^2
volume = (15 * price_data.volume[:-2] / price_data.volume[0]) ** 2
close = 0.003 * price_data.close[:-2] / 0.003 * price_data.open[:-2]
volume = (15 * price_data["volume"][:-2] / price_data["volume"][0])**2
close = 0.003 * price_data["close"][:-2] / 0.003 * price_data["open"][:-2]

fig, ax = plt.subplots()
ax.scatter(delta1[:-1], delta1[1:], c=close, s=volume, alpha=0.5)
Expand Down
4 changes: 2 additions & 2 deletions src/markdown_exec/formatters/bash.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def _run_bash(
id: str | None = None, # noqa: A002,ARG001
**extra: str,
) -> str:
process = subprocess.run(
["bash", "-c", code], # noqa: S603,S607
process = subprocess.run( # noqa: S603
["bash", "-c", code], # noqa: S607
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
text=True,
Expand Down
4 changes: 2 additions & 2 deletions src/markdown_exec/formatters/sh.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def _run_sh(
id: str | None = None, # noqa: A002,ARG001
**extra: str,
) -> str:
process = subprocess.run(
["sh", "-c", code], # noqa: S603,S607
process = subprocess.run( # noqa: S603
["sh", "-c", code], # noqa: S607
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
text=True,
Expand Down

0 comments on commit b9fbcd5

Please sign in to comment.