Skip to content

Commit

Permalink
fix NPY201, np trapz
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed Sep 1, 2024
1 parent 31e8364 commit 49809a1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pymatviz/uncertainty.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from packaging import version
from scipy.stats import norm

import pymatviz as pmv
from pymatviz.utils import df_to_arrays


if version.parse(np.__version__) < version.parse("2.0.0"):
np.trapezoid = np.trapz # noqa: NPY201


if TYPE_CHECKING:
from collections.abc import Sequence

Expand Down Expand Up @@ -86,7 +91,7 @@ def qq_gaussian(
ax.fill_between(
exp_proportions, y1=obs_proportions, y2=exp_proportions, alpha=0.2
)
miscal_area = np.trapz( # noqa: NPY201
miscal_area = np.trapezoid(
np.abs(obs_proportions - exp_proportions), dx=1 / resolution
)
lines.append([line, miscal_area])
Expand Down

0 comments on commit 49809a1

Please sign in to comment.