From 7a630a639c0f406e667cb02ca5c8ed3f791e5519 Mon Sep 17 00:00:00 2001 From: wpbonelli Date: Wed, 10 Jul 2024 11:20:27 -0400 Subject: [PATCH] ruff --- .docs/Notebooks/groundwater2023_watershed_example.py | 11 ++++++++--- .../Notebooks/mf6_parallel_model_splitting_example.py | 8 ++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.docs/Notebooks/groundwater2023_watershed_example.py b/.docs/Notebooks/groundwater2023_watershed_example.py index 5f0dfbfa8..8621505dd 100644 --- a/.docs/Notebooks/groundwater2023_watershed_example.py +++ b/.docs/Notebooks/groundwater2023_watershed_example.py @@ -24,14 +24,15 @@ import os import pathlib as pl import sys -import yaml import matplotlib as mpl import matplotlib.gridspec as gridspec import matplotlib.pyplot as plt import numpy as np -from shapely.geometry import LineString, Polygon import shapely +import yaml +from shapely.geometry import LineString, Polygon + import flopy import flopy.plot.styles as styles from flopy.discretization import StructuredGrid, VertexGrid @@ -45,6 +46,7 @@ print(f"matplotlib version: {mpl.__version__}") print(f"flopy version: {flopy.__version__}") + # define a few utility functions def string2geom(geostring, conversion=None): if conversion is None: @@ -105,7 +107,10 @@ def set_idomain(grid, boundary): idomain = idomain.reshape(grid.shape) grid.idomain = idomain -geometries = yaml.safe_load(open(pl.Path("../../examples/data/groundwater2023/geometries.yml"))) + +geometries = yaml.safe_load( + open(pl.Path("../../examples/data/groundwater2023/geometries.yml")) +) # basic figure size figwidth = 180 # 90 # mm diff --git a/.docs/Notebooks/mf6_parallel_model_splitting_example.py b/.docs/Notebooks/mf6_parallel_model_splitting_example.py index 120044bd2..a753f1fcb 100644 --- a/.docs/Notebooks/mf6_parallel_model_splitting_example.py +++ b/.docs/Notebooks/mf6_parallel_model_splitting_example.py @@ -21,19 +21,22 @@ # The `Mf6Splitter()` class supports Structured, Vertex, and Unstructured Grid models. import sys -import yaml from pathlib import Path from tempfile import TemporaryDirectory import matplotlib.pyplot as plt import numpy as np +import yaml import flopy from flopy.mf6.utils import Mf6Splitter from flopy.plot import styles from flopy.utils.geometry import LineString, Polygon -geometries = yaml.safe_load(open(Path("../../examples/data/groundwater2023/geometries.yml"))) +geometries = yaml.safe_load( + open(Path("../../examples/data/groundwater2023/geometries.yml")) +) + # define a few utility functions def string2geom(geostring, conversion=None): @@ -52,6 +55,7 @@ def string2geom(geostring, conversion=None): res.append((x, y)) return res + # ## Example 1: splitting a simple structured grid model # # This example shows the basics of using the `Mf6Splitter()` class and applies the method to the Freyberg (1988) model.