Skip to content

Commit

Permalink
ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
wpbonelli committed Jul 10, 2024
1 parent cc2f57a commit 7a630a6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
11 changes: 8 additions & 3 deletions .docs/Notebooks/groundwater2023_watershed_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions .docs/Notebooks/mf6_parallel_model_splitting_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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.
Expand Down

0 comments on commit 7a630a6

Please sign in to comment.