Skip to content

Commit

Permalink
ruff complliance for D100. (#5678)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkknight authored Jan 8, 2024
1 parent 8aa0442 commit f966738
Show file tree
Hide file tree
Showing 24 changed files with 61 additions and 2 deletions.
1 change: 0 additions & 1 deletion .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ lint.ignore = [
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
# (D-3) Temporary, before an initial review, either fix ocurrences or move to (2).
"D100", # Missing docstring in public module
"D103", # Missing docstring in public function
"D205", # 1 blank line required between summary line and description
"D401", # First line of docstring should be in imperative mood: ...
Expand Down
3 changes: 3 additions & 0 deletions benchmarks/benchmarks/import_iris.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
#
# This file is part of Iris and is released under the BSD license.
# See LICENSE in the root of the repository for full licensing details.

"""import iris benchmarking."""

from importlib import import_module, reload

################
Expand Down
2 changes: 2 additions & 0 deletions docs/gallery_tests/test_gallery_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# This file is part of Iris and is released under the BSD license.
# See LICENSE in the root of the repository for full licensing details.

"""Test all the gallery examples."""

import importlib

import matplotlib.pyplot as plt
Expand Down
2 changes: 2 additions & 0 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
# serve to show the default.
# ----------------------------------------------------------------------------

"""sphinx config."""

import datetime
from importlib.metadata import version as get_version
import ntpath
Expand Down
3 changes: 3 additions & 0 deletions docs/src/developers_guide/documenting/docstrings_attribute.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""docstring attribute example."""


class ExampleClass:
"""Class Summary."""

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""docstring routine example."""


def sample_routine(arg1, arg2, kwarg1="foo", kwarg2=None):
"""Purpose section text goes here.
Expand Down
2 changes: 2 additions & 0 deletions docs/src/userguide/plotting_examples/1d_quickplot_simple.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Simple 1D plot using iris.quickplot.plot()."""

import matplotlib.pyplot as plt

import iris
Expand Down
2 changes: 2 additions & 0 deletions docs/src/userguide/plotting_examples/1d_simple.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Simple 1D plot using iris.plot.plot()."""

import matplotlib.pyplot as plt

import iris
Expand Down
2 changes: 2 additions & 0 deletions docs/src/userguide/plotting_examples/1d_with_legend.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Simple 1D plot using iris.plot.plot() with a legend."""

import matplotlib.pyplot as plt

import iris
Expand Down
2 changes: 2 additions & 0 deletions docs/src/userguide/plotting_examples/brewer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Plot a chart of all Brewer colour schemes."""

import matplotlib.pyplot as plt
import numpy as np

Expand Down
2 changes: 2 additions & 0 deletions docs/src/userguide/plotting_examples/cube_blockplot.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Cube block plot using using iris.plot.pcolormesh()."""

import matplotlib.pyplot as plt

import iris
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Addind a citation for a plot using iris.plot.citation()."""

import matplotlib.pyplot as plt

import iris
Expand Down
2 changes: 2 additions & 0 deletions docs/src/userguide/plotting_examples/cube_brewer_contourf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Plot a cube with a Brewer colour palette using iris.quickplot.contourf()."""

import matplotlib.cm as mpl_cm
import matplotlib.pyplot as plt

Expand Down
5 changes: 5 additions & 0 deletions docs/src/userguide/plotting_examples/cube_contour.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""Simple contour plot of a cube.
Can use iris.plot.contour() or iris.quicplot.contour().
"""
import matplotlib.pyplot as plt

import iris
Expand Down
5 changes: 5 additions & 0 deletions docs/src/userguide/plotting_examples/cube_contourf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""Simple filled contour plot of a cube.
Can use iris.plot.contour() or iris.quickplot.contour().
"""
import matplotlib.pyplot as plt

import iris
Expand Down
2 changes: 2 additions & 0 deletions docs/src/userguide/regridding_plots/interpolate_column.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Interpolate using iris.analysis.Linear()."""

import matplotlib.pyplot as plt
import numpy as np

Expand Down
2 changes: 2 additions & 0 deletions docs/src/userguide/regridding_plots/regridded_to_global.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Interpolate using iris.analysis.Linear()."""

import matplotlib.pyplot as plt

import iris
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Regrid using iris.analysis.AreaWeighted."""

import matplotlib.colors
import matplotlib.pyplot as plt
import numpy as np
Expand Down
2 changes: 2 additions & 0 deletions docs/src/userguide/regridding_plots/regridded_to_rotated.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Rotated pole."""

import matplotlib.pyplot as plt

import iris
Expand Down
2 changes: 2 additions & 0 deletions docs/src/userguide/regridding_plots/regridding_plot.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Plot regridded data."""

import matplotlib.pyplot as plt

import iris
Expand Down
3 changes: 2 additions & 1 deletion lib/iris/fileformats/pp_load_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
# This file is part of Iris and is released under the BSD license.
# See LICENSE in the root of the repository for full licensing details.


# Historically this was auto-generated from
# SciTools/iris-code-generators:tools/gen_rules.py

"""PP Load Rules."""

import calendar
from functools import wraps

Expand Down
2 changes: 2 additions & 0 deletions lib/iris/fileformats/pp_save_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# This file is part of Iris and is released under the BSD license.
# See LICENSE in the root of the repository for full licensing details.

"""PP Save Rules."""

import warnings

import cftime
Expand Down
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ ignore = [
force-sort-within-sections = true
known-first-party = ["iris"]

[tool.ruff.lint.per-file-ignores]
# All test scripts
"test_*.py" = [
# https://docs.astral.sh/ruff/rules/undocumented-public-module/
"D100", # Missing docstring in public module
]


[tool.ruff.lint.pydocstyle]
convention = "numpy"

Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Iris setup."""

import os
import sys

Expand Down

0 comments on commit f966738

Please sign in to comment.