Skip to content

Commit

Permalink
Update pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
zmoon committed Sep 19, 2024
1 parent 5e9b9df commit 7b00e4a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 21 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.4.0"
rev: "v4.6.0"
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-yaml

- repo: https://github.com/asottile/pyupgrade
rev: "v3.3.1"
rev: "v3.17.0"
hooks:
- id: pyupgrade
args: [--py36-plus]

- repo: https://github.com/PyCQA/isort
rev: "5.12.0"
rev: "5.13.2"
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: "23.1.0"
rev: "24.8.0"
hooks:
- id: black

- repo: https://github.com/PyCQA/flake8
rev: "6.0.0"
rev: "7.1.1"
hooks:
- id: flake8

Expand Down
3 changes: 2 additions & 1 deletion monet/plots/colorbars.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Colorbar helper functions"""

import matplotlib.pyplot as plt


Expand Down Expand Up @@ -40,7 +41,7 @@ def cmap_discretize(cmap, N):
import matplotlib.colors as mcolors
import numpy as np

if type(cmap) == str:
if isinstance(cmap, str):
cmap = plt.get_cmap(cmap)
colors_i = np.concatenate((np.linspace(0, 1.0, N), (0.0, 0.0, 0.0, 0.0)))
colors_rgba = cmap(colors_i)
Expand Down
1 change: 1 addition & 0 deletions monet/plots/plots.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""plotting routines"""

import functools

import matplotlib.pyplot as plt
Expand Down
1 change: 1 addition & 0 deletions monet/plots/taylordiagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Taylor diagram (Taylor, 2001) test implementation.
http://www-pcmdi.llnl.gov/about/staff/Taylor/CV/Taylor_diagram_primer.htm
"""

import functools

import matplotlib.pyplot as plt
Expand Down
30 changes: 15 additions & 15 deletions monet/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,30 +324,30 @@ def calc_13_category_usda_soil_type(clay, sand, silt):

stype = zeros(clay.shape)
stype[where((silt + clay * 1.5 < 15.0) & (clay != 255))] = 1.0 # SAND
stype[
where((silt + 1.5 * clay >= 15.0) & (silt + 1.5 * clay < 30) & (clay != 255))
] = 2.0 # Loamy Sand
stype[where((silt + 1.5 * clay >= 15.0) & (silt + 1.5 * clay < 30) & (clay != 255))] = (
2.0 # Loamy Sand
)
stype[
where((clay >= 7.0) & (clay < 20) & (sand > 52) & (silt + 2 * clay >= 30) & (clay != 255))
] = 3.0 # Sandy Loam (cond 1)
stype[
where((clay < 7) & (silt < 50) & (silt + 2 * clay >= 30) & (clay != 255))
] = 3 # sandy loam (cond 2)
stype[
where((silt >= 50) & (clay >= 12) & (clay < 27) & (clay != 255))
] = 4 # silt loam (cond 1)
stype[where((clay < 7) & (silt < 50) & (silt + 2 * clay >= 30) & (clay != 255))] = (
3 # sandy loam (cond 2)
)
stype[where((silt >= 50) & (clay >= 12) & (clay < 27) & (clay != 255))] = (
4 # silt loam (cond 1)
)
stype[where((silt >= 50) & (silt < 80) & (clay < 12) & (clay != 255))] = 4 # silt loam (cond 2)
stype[where((silt >= 80) & (clay < 12) & (clay != 255))] = 5 # silt
stype[
where((clay >= 7) & (clay < 27) & (silt >= 28) & (silt < 50) & (sand <= 52) & (clay != 255))
] = 6 # loam
stype[
where((clay >= 20) & (clay < 35) & (silt < 28) & (sand > 45) & (clay != 255))
] = 7 # sandy clay loam
stype[where((clay >= 20) & (clay < 35) & (silt < 28) & (sand > 45) & (clay != 255))] = (
7 # sandy clay loam
)
stype[where((clay >= 27) & (clay < 40.0) & (sand > 40) & (clay != 255))] = 8 # silt clay loam
stype[
where((clay >= 27) & (clay < 40.0) & (sand > 20) & (sand <= 45) & (clay != 255))
] = 9 # clay loam
stype[where((clay >= 27) & (clay < 40.0) & (sand > 20) & (sand <= 45) & (clay != 255))] = (
9 # clay loam
)
stype[where((clay >= 35) & (sand > 45) & (clay != 255))] = 10 # sandy clay
stype[where((clay >= 40) & (silt >= 40) & (clay != 255))] = 11 # silty clay
stype[where((clay >= 40) & (sand <= 45) & (silt < 40) & (clay != 255))] = 12 # clay
Expand Down

0 comments on commit 7b00e4a

Please sign in to comment.