Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions .github/workflows/lint.yml

This file was deleted.

28 changes: 15 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 23.12.0
rev: 24.10.0
hooks:
- id: black
name: black
Expand All @@ -23,7 +23,7 @@ repos:
additional_dependencies: [".[jupyter]"]

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.1
rev: 1.9.1
hooks:
- id: nbqa-pyupgrade
args: ["--py310-plus"]
Expand All @@ -32,14 +32,14 @@ repos:
args: ["--extend-ignore=E402"]

- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
rev: 0.8.1
hooks:
- id: nbstripout
description: Strip output from jupyter notebooks
args: [--drop-empty-cells]

- repo: https://github.com/pycqa/flake8
rev: 6.1.0
rev: 7.1.1
hooks:
- id: flake8
additional_dependencies:
Expand All @@ -48,19 +48,21 @@ repos:
- flake8-simplify

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.19.1
hooks:
- id: pyupgrade
args: [--py38-plus]
args: [--py310-plus]

- repo: https://github.com/asottile/reorder-python-imports
rev: v3.12.0
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: reorder-python-imports
args: [--py310-plus, --add-import, "from __future__ import annotations"]
- id: isort
name: isort (python)
args: [--add-import, "from __future__ import annotations"]
types: [python]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-builtin-literals
- id: check-added-large-files
Expand All @@ -81,14 +83,14 @@ repos:
- id: name-tests-test

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.8
rev: v0.9.2
hooks:
- id: ruff
files: sequence/.*\.py$
args: [--fix]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.1
rev: v1.14.1
hooks:
- id: mypy
language_version: python3.12
Expand Down
36 changes: 18 additions & 18 deletions docs/tutorials/notebooks/example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "2815939c",
"id": "0",
"metadata": {},
"source": [
"![Sequence Logo](https://raw.githubusercontent.com/sequence-dev/sequence/develop/docs/_static/sequence-logo-text-lowercase.png)\n",
Expand All @@ -14,7 +14,7 @@
},
{
"cell_type": "markdown",
"id": "722b40f1",
"id": "1",
"metadata": {},
"source": [
"# Create the *sequence* model grid\n",
Expand All @@ -25,7 +25,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "c90feada",
"id": "2",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -38,7 +38,7 @@
},
{
"cell_type": "markdown",
"id": "1f44bed6",
"id": "3",
"metadata": {},
"source": [
"The following code create a new grid with 100 vertical stacks that are each 1000 m in width. We then set the initial topoography (and bathymetry) for the model as well as setting sea level."
Expand All @@ -47,7 +47,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "43bc9d89",
"id": "4",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -58,7 +58,7 @@
},
{
"cell_type": "markdown",
"id": "753b28ce",
"id": "5",
"metadata": {},
"source": [
"# Create the process components\n",
Expand All @@ -73,7 +73,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "96d9cc6f",
"id": "6",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -110,7 +110,7 @@
},
{
"cell_type": "markdown",
"id": "9f2dce0a",
"id": "7",
"metadata": {},
"source": [
"# Create a new *Sequence* model\n",
Expand All @@ -121,7 +121,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "1ba92be6",
"id": "8",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -141,7 +141,7 @@
},
{
"cell_type": "markdown",
"id": "282f70e1",
"id": "9",
"metadata": {},
"source": [
"Run the model for 3000 time steps."
Expand All @@ -150,7 +150,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "55057e5e",
"id": "10",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -161,7 +161,7 @@
},
{
"cell_type": "markdown",
"id": "82ce0bad",
"id": "11",
"metadata": {},
"source": [
"# Dynamically change parameters\n",
Expand All @@ -174,7 +174,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "97b28fe7",
"id": "12",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -184,7 +184,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "64d17bdf",
"id": "13",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -195,7 +195,7 @@
},
{
"cell_type": "markdown",
"id": "bd7345df",
"id": "14",
"metadata": {},
"source": [
"## Create a vertical fault\n",
Expand All @@ -206,7 +206,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "740e6641",
"id": "15",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -217,7 +217,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "b21a4edd",
"id": "16",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -227,7 +227,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "796b0042",
"id": "17",
"metadata": {},
"outputs": [],
"source": [
Expand Down
2 changes: 2 additions & 0 deletions news/87.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

Updated the *pre-commit* hooks and fixed some newly-found lint.
8 changes: 3 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,9 @@ sequence = [
]

[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
combine_as_imports = true
line_length = 88
known_first_party = "sequence"
profile = "black"
force_single_line = true

[tool.mypy]
check_untyped_defs = true
Expand Down
1 change: 1 addition & 0 deletions sequence/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""A sequence-stratigraphic model of a 1D profile written with *Landlab*."""

from __future__ import annotations

from sequence._version import __version__
Expand Down
1 change: 1 addition & 0 deletions sequence/bathymetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This module contains *Landlab* components to read bathymetry into a
`SequenceModelGrid`.
"""

from __future__ import annotations

from os import PathLike
Expand Down
1 change: 1 addition & 0 deletions sequence/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The command line interface for *Sequence*."""

from __future__ import annotations

import inspect
Expand Down
1 change: 1 addition & 0 deletions sequence/errors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Errors used by *sequence*."""

from __future__ import annotations

from collections.abc import Iterable
Expand Down
1 change: 1 addition & 0 deletions sequence/fluvial.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This module contains *Landlab* components that add a sand fraction to a
`SequenceModelGrid`.
"""

from __future__ import annotations

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions sequence/grid.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Define the grid used for creating *Sequence* models."""

from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions sequence/input_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

This module contains utilities for reading *Sequence* input data.
"""

from __future__ import annotations

import inspect
Expand Down
3 changes: 2 additions & 1 deletion sequence/logging.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Logger used for printing Sequence log messages."""

from __future__ import annotations

import contextlib
Expand Down Expand Up @@ -47,7 +48,7 @@ def emit(self, record: logging.LogRecord) -> None:


@contextlib.contextmanager
def logging_handler() -> Generator[None, None, None]:
def logging_handler() -> Generator[None]:
"""Change, temporarily, the current logger."""
handler = LoggingHandler()
logger.addHandler(handler)
Expand Down
1 change: 1 addition & 0 deletions sequence/netcdf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Write a `SequenceModelGrid` to a NetCDF file."""

from __future__ import annotations

import contextlib
Expand Down
1 change: 1 addition & 0 deletions sequence/output_writer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Write a `SequenceModelGrid` to a file."""

from __future__ import annotations

import errno
Expand Down
1 change: 1 addition & 0 deletions sequence/plot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Plot the layers of a `SequenceModelGrid`."""

from __future__ import annotations

from functools import partial
Expand Down
1 change: 1 addition & 0 deletions sequence/processes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""All available processes to include in a *Sequence* model."""

from __future__ import annotations

from compaction.landlab import Compact
Expand Down
1 change: 1 addition & 0 deletions sequence/sea_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This module contains *Landlab* components used for adjusting
a grid's sea level.
"""

from __future__ import annotations

from collections.abc import Callable
Expand Down
Loading