Skip to content

Commit

Permalink
remove lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mcflugen committed Mar 7, 2024
1 parent 2a2cb2e commit 0ed11bc
Show file tree
Hide file tree
Showing 318 changed files with 1,653 additions and 1,605 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ repos:
hooks:
- id: isort
name: isort (python)
args: [--force-single-line-imports]
types: [python]
- id: isort
name: isort (cython)
Expand Down
26 changes: 14 additions & 12 deletions landlab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,26 @@

from ._registry import registry
from ._version import __version__
from .core.errors import MissingKeyError, ParameterValueError
from .core.errors import MissingKeyError
from .core.errors import ParameterValueError
from .core.model_component import Component
from .core.model_parameter_loader import load_params
from .core.utils import ExampleData
from .field import FieldError
from .grid import (
FramedVoronoiGrid,
HexModelGrid,
ModelGrid,
NetworkModelGrid,
RadialModelGrid,
RasterModelGrid,
VoronoiDelaunayGrid,
create_grid,
)
from .grid import FramedVoronoiGrid
from .grid import HexModelGrid
from .grid import ModelGrid
from .grid import NetworkModelGrid
from .grid import RadialModelGrid
from .grid import RasterModelGrid
from .grid import VoronoiDelaunayGrid
from .grid import create_grid
from .grid.linkstatus import LinkStatus
from .grid.nodestatus import NodeStatus
from .plot import imshow_grid, imshow_grid_at_node, imshowhs_grid, imshowhs_grid_at_node
from .plot import imshow_grid
from .plot import imshow_grid_at_node
from .plot import imshowhs_grid
from .plot import imshowhs_grid_at_node

with contextlib.suppress(TypeError):
set_printoptions(legacy="1.13")
Expand Down
1 change: 0 additions & 1 deletion landlab/_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@


class ComponentRegistry:

"""A registry for instantiated landlab components."""

def __init__(self, objs=None):
Expand Down
3 changes: 2 additions & 1 deletion landlab/bmi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .bmi_bridge import TimeStepper, wrap_as_bmi
from .bmi_bridge import TimeStepper
from .bmi_bridge import wrap_as_bmi

__all__ = ["TimeStepper", "wrap_as_bmi"]
11 changes: 6 additions & 5 deletions landlab/bmi/bmi_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
exposes a Basic Modelling Interface.
"""

import inspect

import numpy as np
Expand All @@ -20,7 +21,8 @@
from ..core import load_params
from ..core.model_component import Component
from ..framework.decorators import snake_case
from ..grid import HexModelGrid, RasterModelGrid
from ..grid import HexModelGrid
from ..grid import RasterModelGrid
from ..grid.create import create_grid

BMI_LOCATION = {
Expand All @@ -45,7 +47,6 @@


class TimeStepper:

"""Step through time.
Parameters
Expand Down Expand Up @@ -358,9 +359,9 @@ def initialize(self, config_file):
self._clock = TimeStepper(**clock_params)

self._base = self._cls(grid, **params.pop(snake_case(cls.__name__), {}))
self._base.grid.at_node[
"boundary_condition_flag"
] = self._base.grid.status_at_node
self._base.grid.at_node["boundary_condition_flag"] = (
self._base.grid.status_at_node
)

def update(self):
"""Update the component one time step."""
Expand Down
31 changes: 15 additions & 16 deletions landlab/ca/boundaries/hex_lattice_tectonicizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,21 @@
@author: gtucker
"""

from numpy import (
amax,
arange,
array,
cos,
logical_and,
logical_or,
logical_xor,
pi,
sqrt,
tan,
where,
zeros,
)

from landlab import HexModelGrid, LinkStatus
from numpy import amax
from numpy import arange
from numpy import array
from numpy import cos
from numpy import logical_and
from numpy import logical_or
from numpy import logical_xor
from numpy import pi
from numpy import sqrt
from numpy import tan
from numpy import where
from numpy import zeros

from landlab import HexModelGrid
from landlab import LinkStatus
from landlab.core.utils import as_id_array

from ..cfuncs import get_next_event_new # , update_link_state_new
Expand Down
13 changes: 4 additions & 9 deletions landlab/ca/celllab_cts.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,10 @@
import pylab as plt

import landlab
from landlab.ca.cfuncs import (
PriorityQueue,
get_next_event_new,
push_transitions_to_event_queue,
run_cts_new,
)
from landlab.ca.cfuncs import PriorityQueue
from landlab.ca.cfuncs import get_next_event_new
from landlab.ca.cfuncs import push_transitions_to_event_queue
from landlab.ca.cfuncs import run_cts_new
from landlab.grid.nodestatus import NodeStatus

_NEVER = 1e50
Expand All @@ -139,7 +137,6 @@


class Transition:

"""A transition from one state to another.
Represents a transition from one state ("from_state") to another
Expand Down Expand Up @@ -206,7 +203,6 @@ def __init__(


class CAPlotter:

"""Handle display of a CellLab-CTS grid.
CAPlotter() constructor keeps a reference to the CA model, and
Expand Down Expand Up @@ -302,7 +298,6 @@ def finalize(self):


class CellLabCTSModel:

"""Link-type (or doublet-type) cellular automaton model.
A CellLabCTSModel implements a link-type (or doublet-type) cellular
Expand Down
1 change: 0 additions & 1 deletion landlab/ca/oriented_hex_cts.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@


class OrientedHexCTS(CellLabCTSModel):

"""Oriented hex-grid CellLab-CTS model.
OrientedHexCTS constructor: sets number of orientations to 3 and calls
Expand Down
1 change: 0 additions & 1 deletion landlab/ca/oriented_raster_cts.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@


class OrientedRasterCTS(CellLabCTSModel):

"""Oriented raster CellLab-CTS model.
RasterCTS constructor: sets number of orientations to 2 and calls
Expand Down
3 changes: 2 additions & 1 deletion landlab/cmd/authors.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import os
import subprocess
import textwrap
from collections import ChainMap, UserDict
from collections import ChainMap
from collections import UserDict

try:
import tomllib
Expand Down
21 changes: 11 additions & 10 deletions landlab/cmd/landlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@
import numpy as np
import rich_click as click

from landlab import (
FramedVoronoiGrid,
HexModelGrid,
ModelGrid,
RadialModelGrid,
RasterModelGrid,
VoronoiDelaunayGrid,
)

from .authors import AuthorList, AuthorsConfig, AuthorsSubprocessError, GitLog
from landlab import FramedVoronoiGrid
from landlab import HexModelGrid
from landlab import ModelGrid
from landlab import RadialModelGrid
from landlab import RasterModelGrid
from landlab import VoronoiDelaunayGrid

from .authors import AuthorList
from .authors import AuthorsConfig
from .authors import AuthorsSubprocessError
from .authors import GitLog

GRIDS = [
ModelGrid,
Expand Down
68 changes: 39 additions & 29 deletions landlab/components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,22 @@
from .depression_finder import DepressionFinderAndRouter
from .depth_dependent_diffusion import DepthDependentDiffuser
from .depth_dependent_taylor_soil_creep import DepthDependentTaylorDiffuser
from .detachment_ltd_erosion import DepthSlopeProductErosion, DetachmentLtdErosion
from .detachment_ltd_erosion import DepthSlopeProductErosion
from .detachment_ltd_erosion import DetachmentLtdErosion
from .diffusion import LinearDiffuser
from .dimensionless_discharge import DimensionlessDischarge
from .discharge_diffuser import DischargeDiffuser
from .drainage_density import DrainageDensity
from .erosion_deposition import ErosionDeposition
from .fire_generator import FireGenerator
from .flexure import Flexure, Flexure1D
from .flow_accum import FlowAccumulator, LossyFlowAccumulator
from .flow_director import (
FlowDirectorD8,
FlowDirectorDINF,
FlowDirectorMFD,
FlowDirectorSteepest,
)
from .flexure import Flexure
from .flexure import Flexure1D
from .flow_accum import FlowAccumulator
from .flow_accum import LossyFlowAccumulator
from .flow_director import FlowDirectorD8
from .flow_director import FlowDirectorDINF
from .flow_director import FlowDirectorMFD
from .flow_director import FlowDirectorSteepest
from .fracture_grid import FractureGridGenerator
from .gflex import gFlex
from .gravel_bedrock_eroder import GravelBedrockEroder
Expand All @@ -32,13 +33,20 @@
from .lake_fill import LakeMapperBarnes
from .landslides import LandslideProbability
from .lateral_erosion import LateralEroder
from .lithology import LithoLayers, Lithology
from .lithology import LithoLayers
from .lithology import Lithology
from .marine_sediment_transport import SimpleSubmarineDiffuser
from .network_sediment_transporter import NetworkSedimentTransporter
from .network_sediment_transporter.bed_parcel_initializers import (
BedParcelInitializerArea,
)
from .network_sediment_transporter.bed_parcel_initializers import (
BedParcelInitializerDepth,
)
from .network_sediment_transporter.bed_parcel_initializers import (
BedParcelInitializerDischarge,
)
from .network_sediment_transporter.bed_parcel_initializers import (
BedParcelInitializerUserD50,
)
from .network_sediment_transporter.sediment_pulser_at_links import SedimentPulserAtLinks
Expand All @@ -47,40 +55,42 @@
)
from .nonlinear_diffusion import PerronNLDiffuse
from .normal_fault import NormalFault
from .overland_flow import (
KinematicWaveRengers,
KinwaveImplicitOverlandFlow,
KinwaveOverlandFlowModel,
LinearDiffusionOverlandFlowRouter,
OverlandFlow,
OverlandFlowBates,
)
from .overland_flow import KinematicWaveRengers
from .overland_flow import KinwaveImplicitOverlandFlow
from .overland_flow import KinwaveOverlandFlowModel
from .overland_flow import LinearDiffusionOverlandFlowRouter
from .overland_flow import OverlandFlow
from .overland_flow import OverlandFlowBates
from .pet import PotentialEvapotranspiration
from .plant_competition_ca import VegCA
from .potentiality_flowrouting import PotentialityFlowRouter
from .priority_flood_flow_router import PriorityFloodFlowRouter
from .profiler import ChannelProfiler, Profiler, TrickleDownProfiler
from .profiler import ChannelProfiler
from .profiler import Profiler
from .profiler import TrickleDownProfiler
from .radiation import Radiation
from .sink_fill import SinkFiller, SinkFillerBarnes
from .soil_moisture import SoilInfiltrationGreenAmpt, SoilMoisture
from .space import Space, SpaceLargeScaleEroder
from .sink_fill import SinkFiller
from .sink_fill import SinkFillerBarnes
from .soil_moisture import SoilInfiltrationGreenAmpt
from .soil_moisture import SoilMoisture
from .space import Space
from .space import SpaceLargeScaleEroder
from .spatial_precip import SpatialPrecipitationDistribution
from .species_evolution import SpeciesEvolver
from .steepness_index import SteepnessFinder
from .stream_power import (
FastscapeEroder,
SedDepEroder,
StreamPowerEroder,
StreamPowerSmoothThresholdEroder,
)
from .stream_power import FastscapeEroder
from .stream_power import SedDepEroder
from .stream_power import StreamPowerEroder
from .stream_power import StreamPowerSmoothThresholdEroder
from .taylor_nonlinear_hillslope_flux import TaylorNonLinearDiffuser
from .tectonics import ListricKinematicExtender
from .threshold_eroder import ThresholdEroder
from .tidal_flow import TidalFlowCalculator
from .transport_length_diffusion import TransportLengthHillslopeDiffuser
from .uniform_precip import PrecipitationDistribution
from .vegetation_dynamics import Vegetation
from .weathering import ExponentialWeatherer, ExponentialWeathererIntegrated
from .weathering import ExponentialWeatherer
from .weathering import ExponentialWeathererIntegrated

COMPONENTS = [
AdvectionSolverTVD,
Expand Down
8 changes: 3 additions & 5 deletions landlab/components/advection/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
.. sectionauthor:: G Tucker
"""

from .advection_solver_tvd import (
AdvectionSolverTVD,
find_upwind_link_at_link,
upwind_to_local_grad_ratio,
)
from .advection_solver_tvd import AdvectionSolverTVD
from .advection_solver_tvd import find_upwind_link_at_link
from .advection_solver_tvd import upwind_to_local_grad_ratio

__all__ = [
"AdvectionSolverTVD",
Expand Down
6 changes: 4 additions & 2 deletions landlab/components/advection/advection_solver_tvd.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@

import numpy as np

from landlab import Component, LinkStatus
from landlab import Component
from landlab import LinkStatus
from landlab.components.advection.flux_limiters import flux_lim_vanleer
from landlab.field.errors import FieldError
from landlab.utils.return_array import return_array_at_link, return_array_at_node
from landlab.utils.return_array import return_array_at_link
from landlab.utils.return_array import return_array_at_node


def find_upwind_link_at_link(grid, u):
Expand Down

0 comments on commit 0ed11bc

Please sign in to comment.