diff --git a/examples/calculations/Smoothing.py b/examples/calculations/Smoothing.py index a4ca2c278b9..333ada73a29 100644 --- a/examples/calculations/Smoothing.py +++ b/examples/calculations/Smoothing.py @@ -22,11 +22,11 @@ ########################################### # Start with a base pattern with random noise -np.random.seed(61461542) +rng = np.random.default_rng(61461542) size = 128 x, y = np.mgrid[:size, :size] distance = np.sqrt((x - size / 2) ** 2 + (y - size / 2) ** 2) -raw_data = np.random.random((size, size)) * 0.3 + distance / distance.max() * 0.7 +raw_data = rng.random((size, size)) * 0.3 + distance / distance.max() * 0.7 fig, ax = plt.subplots(1, 1, figsize=(4, 4)) ax.set_title('Raw Data') diff --git a/examples/gridding/Inverse_Distance_Verification.py b/examples/gridding/Inverse_Distance_Verification.py index 3427aae85f2..d17d5f274b7 100644 --- a/examples/gridding/Inverse_Distance_Verification.py +++ b/examples/gridding/Inverse_Distance_Verification.py @@ -46,9 +46,9 @@ def draw_circle(ax, x, y, r, m, label): # Generate random x and y coordinates, and observation values proportional to x * y. # # Set up two test grid locations at (30, 30) and (60, 60). -np.random.seed(100) -pts = np.random.randint(0, 100, (10, 2)) +pts = np.array([[8, 24], [67, 87], [79, 48], [10, 94], [52, 98], + [53, 66], [98, 14], [34, 24], [15, 60], [58, 16]]) xp = pts[:, 0] yp = pts[:, 1] zp = xp**2 / 1000 diff --git a/examples/gridding/Natural_Neighbor_Verification.py b/examples/gridding/Natural_Neighbor_Verification.py index ae314665708..b63b2bcd76e 100644 --- a/examples/gridding/Natural_Neighbor_Verification.py +++ b/examples/gridding/Natural_Neighbor_Verification.py @@ -67,9 +67,11 @@ # estimate a value using natural neighbor interpolation. # # The locations of these observations are then used to generate a Delaunay triangulation. -np.random.seed(100) -pts = np.random.randint(0, 100, (10, 2)) +# Some randomly selected points +pts = np.array([[8, 24], [67, 87], [79, 48], [10, 94], [52, 98], + [53, 66], [98, 14], [34, 24], [15, 60], [58, 16]]) + xp = pts[:, 0] yp = pts[:, 1] zp = (pts[:, 0] * pts[:, 0]) / 1000 diff --git a/pyproject.toml b/pyproject.toml index 51e5d5b5fca..eb8c65bcc71 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -119,7 +119,7 @@ filterwarnings = [ [tool.ruff] line-length = 95 exclude = ["docs", "build", "src/metpy/io/_metar_parser/metar_parser.py"] -select = ["A", "B", "C", "CPY001", "D", "E", "E226", "F", "G", "I", "N", "Q", "R", "S", "T", "U", "W"] +select = ["A", "B", "C", "CPY001", "D", "E", "E226", "F", "G", "I", "N", "NPY", "Q", "R", "S", "T", "U", "W"] ignore = ["F405", "I001", "RET504", "RET505", "RET506", "RET507", "RUF100"] preview = true explicit-preview-rules = true