Skip to content

Commit

Permalink
Fix D400
Browse files Browse the repository at this point in the history
  • Loading branch information
visr committed Nov 26, 2024
1 parent c58f0a6 commit 7565ffd
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 22 deletions.
2 changes: 1 addition & 1 deletion python/ribasim_api/tests/test_bmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def test_get_value_ptr_allocation(libribasim, user_demand, tmp_path):

def test_err_unknown_var(libribasim, basic, tmp_path):
"""
Unknown or invalid variable address
Unknown or invalid variable address.
Should trigger Python Exception, print the kernel error, and not crash the library.
"""
Expand Down
2 changes: 1 addition & 1 deletion python/ribasim_testmodels/ribasim_testmodels/backwater.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


def backwater_model():
"""Backwater curve as an integration test for ManningResistance"""
"""Backwater curve as an integration test for ManningResistance."""
node_type = np.full(102, "ManningResistance")
node_type[1::2] = "Basin"
node_type[0] = "FlowBoundary"
Expand Down
2 changes: 1 addition & 1 deletion python/ribasim_testmodels/ribasim_testmodels/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def basic_arrow_model() -> ribasim.Model:


def basic_transient_model() -> ribasim.Model:
"""Update the basic model with transient forcing"""
"""Update the basic model with transient forcing."""
model = basic_model()
time = pd.date_range(model.starttime, model.endtime)
day_of_year = time.day_of_year.to_numpy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def pump_discrete_control_model() -> Model:


def flow_condition_model() -> Model:
"""Set up a basic model that involves discrete control based on a flow condition"""
"""Set up a basic model that involves discrete control based on a flow condition."""
model = Model(
starttime="2020-01-01",
endtime="2021-01-01",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


def local_pidcontrolled_cascade_model():
"""Demonstrating model for the cascade polder project from our partner"""
"""Demonstrating model for the cascade polder project from our partner."""
model = Model(starttime="2020-01-01", endtime="2021-01-01", crs="EPSG:28992")

# Set up basins
Expand Down
2 changes: 1 addition & 1 deletion python/ribasim_testmodels/ribasim_testmodels/equations.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def misc_nodes_model() -> Model:


def pid_control_equation_model() -> Model:
"""Set up a model with pid control for an analytical solution test"""
"""Set up a model with pid control for an analytical solution test."""
model = Model(
starttime="2020-01-01", endtime="2020-01-01 00:05:00", crs="EPSG:28992"
)
Expand Down
2 changes: 1 addition & 1 deletion python/ribasim_testmodels/ribasim_testmodels/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


def flow_boundary_time_model() -> Model:
"""Set up a minimal model with time-varying flow boundary"""
"""Set up a minimal model with time-varying flow boundary."""
model = Model(
starttime="2020-01-01",
endtime="2021-01-01",
Expand Down
2 changes: 1 addition & 1 deletion python/ribasim_testmodels/ribasim_testmodels/trivial.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


def trivial_model() -> Model:
"""Trivial model with just a basin, tabulated rating curve and terminal node"""
"""Trivial model with just a basin, tabulated rating curve and terminal node."""
model = Model(
starttime="2020-01-01",
endtime="2021-01-01",
Expand Down
2 changes: 1 addition & 1 deletion ribasim_qgis/scripts/qgis_testrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@


def __get_test_function(test_module_name):
"""Load the test module and return the test function"""
"""Load the test module and return the test function."""
print(f"QGIS Test Runner - Trying to import {test_module_name}")
try:
test_module = importlib.import_module(test_module_name)
Expand Down
12 changes: 3 additions & 9 deletions ribasim_qgis/widgets/dataset_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,7 @@ def add_node_layer(self, element: Input) -> QTreeWidgetItem:
return item

def remove_geopackage_layers(self) -> None:
"""
Remove layers from:
* The dataset tree widget
* The QGIS layer panel
* The geopackage
"""
"""Remove layers from the dataset tree widget, QGIS layer panel and the GeoPackage."""
# Collect the selected items
selection = self.selectedItems()

Expand Down Expand Up @@ -168,7 +162,7 @@ def __init__(self, parent: QWidget):

@property
def path(self) -> Path:
"""Returns currently active path to Ribasim model (.toml)"""
"""Returns currently active path to Ribasim model (.toml)."""
return Path(self.dataset_line_edit.text())

def connect_nodes(self) -> None:
Expand Down Expand Up @@ -239,7 +233,7 @@ def add_relationship(from_layer, to_layer_id, name, fk="node_id") -> None:
from_layer.setEditorWidgetSetup(field_index, setup)

def load_geopackage(self) -> None:
"""Load the layers of a GeoPackage into the Layers Panel"""
"""Load the layers of a GeoPackage into the Layers Panel."""
self.dataset_tree.clear()
geo_path = get_database_path_from_model_file(self.path)
nodes = load_nodes_from_geopackage(geo_path)
Expand Down
4 changes: 2 additions & 2 deletions ribasim_qgis/widgets/ribasim_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def edge_layer(self) -> QgsVectorLayer | None:

@property
def crs(self) -> QgsCoordinateReferenceSystem:
"""Returns coordinate reference system of current mapview"""
"""Returns coordinate reference system of current mapview."""
map_canvas = self.iface.mapCanvas()
assert map_canvas is not None
map_settings = map_canvas.mapSettings()
Expand Down Expand Up @@ -138,7 +138,7 @@ def add_layer(
labels: QgsAbstractVectorLayerLabeling | None = None,
) -> QgsMapLayer | None:
"""
Add a layer to the Layers Panel
Add a layer to the Layers Panel.
Parameters
----------
Expand Down
2 changes: 0 additions & 2 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ target-version = "py39"
# See https://docs.astral.sh/ruff/rules/
select = ["C4", "D2", "D3", "D4", "E", "F", "I", "NPY", "PD", "UP"]
ignore = [
"D206",
"D400",
"D404",
"E402",
"E501",
Expand Down

0 comments on commit 7565ffd

Please sign in to comment.