diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b3b55196..fc3b377c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,14 +19,8 @@ repos: - id: blacken-docs additional_dependencies: [black==24.*] - - repo: https://github.com/aio-libs/sort-all - rev: "v1.3.0" - hooks: - - id: sort-all - types: [file, python] - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.7.4" + rev: "v0.8.0" hooks: - id: ruff types: [file, python] diff --git a/changelog/1008.internal.rst b/changelog/1008.contributor.rst similarity index 100% rename from changelog/1008.internal.rst rename to changelog/1008.contributor.rst diff --git a/changelog/1064.internal.rst b/changelog/1064.contributor.rst similarity index 100% rename from changelog/1064.internal.rst rename to changelog/1064.contributor.rst diff --git a/changelog/1225.contributor.rst b/changelog/1225.contributor.rst new file mode 100644 index 00000000..847c3c6c --- /dev/null +++ b/changelog/1225.contributor.rst @@ -0,0 +1,4 @@ +Dropped `sort-all `__ ``pre-commit`` hook, as +`ruff 0.8.0 `__ stabilized the +`unsorted-dunder-all `__ +(``RUF022``) preview rule. (:user:`bjlittle`) diff --git a/pyproject.toml b/pyproject.toml index fac3e714..13edf3d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -149,11 +149,6 @@ preview = false # Allow information-source (U+2139) which could be confused for "i". allowed-confusables = ["ℹ"] ignore = [ - # flake8-annotations (ANN) - # https://docs.astral.sh/ruff/rules/#flake8-annotations-ann - "ANN101", # Missing type annotation for 'self' in method. - "ANN102", # Missing type annotation for 'cls' in classmethod. - # flake8-commas (COM) # https://docs.astral.sh/ruff/rules/#flake8-commas-com "COM812", # Trailing comma missing. diff --git a/src/geovista/bridge.py b/src/geovista/bridge.py index ec2cff0b..e7223954 100644 --- a/src/geovista/bridge.py +++ b/src/geovista/bridge.py @@ -54,8 +54,8 @@ "BRIDGE_CLEAN", "NAME_CELLS", "NAME_POINTS", - "PathLike", "RIO_SIEVE_SIZE", + "PathLike", "Shape", "Transform", ] diff --git a/src/geovista/common.py b/src/geovista/common.py index 45909d38..de013491 100644 --- a/src/geovista/common.py +++ b/src/geovista/common.py @@ -46,9 +46,7 @@ "GV_REMESH_POINT_IDS", "JUPYTER_BACKEND", "LRU_CACHE_SIZE", - "MixinStrEnum", "PERIOD", - "Preference", "RADIUS", "REMESH_JOIN", "REMESH_SEAM", @@ -58,6 +56,8 @@ "WRAP_RTOL", "ZLEVEL_SCALE", "ZTRANSFORM_FACTOR", + "MixinStrEnum", + "Preference", "active_kernel", "cast_UnstructuredGrid_to_PolyData", "distance", diff --git a/src/geovista/core.py b/src/geovista/core.py index 480ebd09..e677c0d6 100644 --- a/src/geovista/core.py +++ b/src/geovista/core.py @@ -56,8 +56,8 @@ __all__ = [ "CUT_OFFSET", - "MeridianSlice", "SPLINE_N_POINTS", + "MeridianSlice", "SliceBias", "add_texture_coords", "combine", diff --git a/src/geovista/crs.py b/src/geovista/crs.py index 7015d667..747b05f0 100644 --- a/src/geovista/crs.py +++ b/src/geovista/crs.py @@ -27,9 +27,9 @@ np = lazy.load("numpy") __all__ = [ + "WGS84", "CRSLike", "PlateCarree", - "WGS84", "from_wkt", "get_central_meridian", "has_wkt", diff --git a/src/geovista/geodesic.py b/src/geovista/geodesic.py index 85697468..c5910417 100644 --- a/src/geovista/geodesic.py +++ b/src/geovista/geodesic.py @@ -46,16 +46,16 @@ "BBOX_C", "BBOX_RADIUS_RATIO", "BBOX_TOLERANCE", - "BBox", - "Corners", "ELLIPSE", - "EnclosedPreference", "GEODESIC_NPTS", "N_PANELS", "PANEL_BBOX_BY_IDX", "PANEL_IDX_BY_NAME", "PANEL_NAME_BY_IDX", "PREFERENCE", + "BBox", + "Corners", + "EnclosedPreference", "line", "npoints", "npoints_by_idx", diff --git a/src/geovista/geoplotter.py b/src/geovista/geoplotter.py index f87bcd72..9d2ac901 100644 --- a/src/geovista/geoplotter.py +++ b/src/geovista/geoplotter.py @@ -82,9 +82,9 @@ "COASTLINES_RTOL", "GRATICULE_LABEL_FONT_SIZE", "GRATICULE_SHOW_LABELS", + "OPACITY_BLACKLIST", "GeoPlotter", "GeoPlotterBase", - "OPACITY_BLACKLIST", ] ADD_POINTS_STYLE: list[str, str] = ["points", "points_gaussian"] diff --git a/src/geovista/gridlines.py b/src/geovista/gridlines.py index 41dda5f3..74b74898 100644 --- a/src/geovista/gridlines.py +++ b/src/geovista/gridlines.py @@ -41,7 +41,6 @@ __all__ = [ "GRATICULE_CLOSED_INTERVAL", "GRATICULE_ZLEVEL", - "GraticuleGrid", "LABEL_DEGREE", "LABEL_EAST", "LABEL_NORTH", @@ -59,6 +58,7 @@ "LONGITUDE_STEP", "LONGITUDE_STEP_PERIOD", "LONGITUDE_STOP", + "GraticuleGrid", "create_meridian_labels", "create_meridians", "create_parallel_labels", diff --git a/src/geovista/report.py b/src/geovista/report.py index d5ae94c8..20ca7c14 100644 --- a/src/geovista/report.py +++ b/src/geovista/report.py @@ -26,9 +26,9 @@ "NCOL", "PACKAGES_CORE", "PACKAGES_OPTIONAL", + "TEXT_WIDTH", "PackageLike", "Report", - "TEXT_WIDTH", ] # type aliases diff --git a/tests/core/test_slice_lines.py b/tests/core/test_slice_lines.py index 4ce31c80..69aaf571 100644 --- a/tests/core/test_slice_lines.py +++ b/tests/core/test_slice_lines.py @@ -177,6 +177,6 @@ def test_field_data(coastlines): metadata = dict(coastlines.field_data.items()) result = slice_lines(coastlines) assert set(result.field_data.keys()) == set(metadata.keys()) - for key in metadata: - assert id(result.field_data[key]) != id(metadata[key]) - np.testing.assert_array_equal(result.field_data[key], metadata[key]) + for key, value in metadata.items(): + assert id(result.field_data[key]) != id(value) + np.testing.assert_array_equal(result.field_data[key], value)