From d8a3108694379f182e3bd8fc0384c263f233baef Mon Sep 17 00:00:00 2001 From: Hendrik Huyskens Date: Wed, 21 Feb 2024 10:03:35 +0100 Subject: [PATCH] Fix distill refactoring --- CHANGELOG.md | 4 ++ django_mapengine/__init__.py | 2 +- django_mapengine/distill.py | 5 +- poetry.lock | 120 ++++++++++++++++++++++++++++++++++- pyproject.toml | 4 +- 5 files changed, 131 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6db562e..3764ffd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and the versioning aim to respect [Semantic Versioning](http://semver.org/spec/v Here is a template for new release sections +## [0.18.1] - 2024-02-20 +### Fixed +- distill refactoring + ## [0.18.0] - 2024-02-20 ### Fixed - map image loading for maplibre version > 2.4.0 diff --git a/django_mapengine/__init__.py b/django_mapengine/__init__.py index 759a21e..17c97ac 100644 --- a/django_mapengine/__init__.py +++ b/django_mapengine/__init__.py @@ -1,3 +1,3 @@ """Map Engine init, holds version""" -__version__ = "0.18.0" +__version__ = "0.18.1" diff --git a/django_mapengine/distill.py b/django_mapengine/distill.py index 46fa916..cf27997 100644 --- a/django_mapengine/distill.py +++ b/django_mapengine/distill.py @@ -1,9 +1,12 @@ +"""Module holding helper functions for MVT destillation.""" + import range_key_dict from django.conf import settings def get_region_zooms(): + """Create range-key-dict from regions and related zoom factors.""" return range_key_dict.RangeKeyDict( {zoom: layer for layer, zoom in settings.MAP_ENGINE_ZOOM_LEVELS.items() if layer in settings.MAP_ENGINE_REGIONS} ) @@ -44,5 +47,5 @@ def get_all_statics_for_state_lod(view_name: str) -> tuple[int, int, int]: tuple[int, int, int] Holding x,y,z """ - for x, y, z in distill.get_coordinates_for_distilling(view_name): + for x, y, z in get_coordinates_for_distilling(view_name): yield z, x, y diff --git a/poetry.lock b/poetry.lock index b61f0d7..5801cb0 100644 --- a/poetry.lock +++ b/poetry.lock @@ -17,6 +17,20 @@ typing-extensions = {version = ">=4", markers = "python_version < \"3.11\""} [package.extras] tests = ["mypy (>=0.800)", "pytest", "pytest-asyncio"] +[[package]] +name = "astroid" +version = "3.0.3" +description = "An abstract syntax tree for Python with inference support." +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "astroid-3.0.3-py3-none-any.whl", hash = "sha256:92fcf218b89f449cdf9f7b39a269f8d5d617b27be68434912e11e79203963a17"}, + {file = "astroid-3.0.3.tar.gz", hash = "sha256:4148645659b08b70d72460ed1921158027a9e53ae8b7234149b1400eddacbb93"}, +] + +[package.dependencies] +typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.11\""} + [[package]] name = "black" version = "23.12.1" @@ -244,6 +258,21 @@ files = [ [package.dependencies] jinja2 = "*" +[[package]] +name = "dill" +version = "0.3.8" +description = "serialize all of Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "dill-0.3.8-py3-none-any.whl", hash = "sha256:c36ca9ffb54365bdd2f8eb3eff7d2a21237f8452b57ace88b1ac615b7e815bd7"}, + {file = "dill-0.3.8.tar.gz", hash = "sha256:3ebe3c479ad625c4553aca177444d89b486b1d84982eeacded644afc0cf797ca"}, +] + +[package.extras] +graph = ["objgraph (>=1.7.2)"] +profile = ["gprof2dot (>=2022.7.29)"] + [[package]] name = "django" version = "3.2.24" @@ -375,6 +404,22 @@ djangorestframework-gis = ">=0.14" [package.extras] dev = ["black", "coveralls", "mock", "pylint", "pytest", "pytest-cov", "sphinx", "sphinx_rtd_theme"] +[[package]] +name = "flake8" +version = "7.0.0" +description = "the modular source code checker: pep8 pyflakes and co" +optional = false +python-versions = ">=3.8.1" +files = [ + {file = "flake8-7.0.0-py2.py3-none-any.whl", hash = "sha256:a6dfbb75e03252917f2473ea9653f7cd799c3064e54d4c8140044c5c065f53c3"}, + {file = "flake8-7.0.0.tar.gz", hash = "sha256:33f96621059e65eec474169085dc92bf26e7b2d47366b70be2f67ab80dc25132"}, +] + +[package.dependencies] +mccabe = ">=0.7.0,<0.8.0" +pycodestyle = ">=2.11.0,<2.12.0" +pyflakes = ">=3.2.0,<3.3.0" + [[package]] name = "idna" version = "3.6" @@ -497,6 +542,17 @@ files = [ {file = "MarkupSafe-2.1.5.tar.gz", hash = "sha256:d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b"}, ] +[[package]] +name = "mccabe" +version = "0.7.0" +description = "McCabe checker, plugin for flake8" +optional = false +python-versions = ">=3.6" +files = [ + {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, + {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, +] + [[package]] name = "mypy-extensions" version = "1.0.0" @@ -545,6 +601,57 @@ files = [ docs = ["furo (>=2023.9.10)", "proselint (>=0.13)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1.25.2)"] test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)"] +[[package]] +name = "pycodestyle" +version = "2.11.1" +description = "Python style guide checker" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pycodestyle-2.11.1-py2.py3-none-any.whl", hash = "sha256:44fe31000b2d866f2e41841b18528a505fbd7fef9017b04eff4e2648a0fadc67"}, + {file = "pycodestyle-2.11.1.tar.gz", hash = "sha256:41ba0e7afc9752dfb53ced5489e89f8186be00e599e712660695b7a75ff2663f"}, +] + +[[package]] +name = "pyflakes" +version = "3.2.0" +description = "passive checker of Python programs" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pyflakes-3.2.0-py2.py3-none-any.whl", hash = "sha256:84b5be138a2dfbb40689ca07e2152deb896a65c3a3e24c251c5c62489568074a"}, + {file = "pyflakes-3.2.0.tar.gz", hash = "sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f"}, +] + +[[package]] +name = "pylint" +version = "3.0.3" +description = "python code static checker" +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "pylint-3.0.3-py3-none-any.whl", hash = "sha256:7a1585285aefc5165db81083c3e06363a27448f6b467b3b0f30dbd0ac1f73810"}, + {file = "pylint-3.0.3.tar.gz", hash = "sha256:58c2398b0301e049609a8429789ec6edf3aabe9b6c5fec916acd18639c16de8b"}, +] + +[package.dependencies] +astroid = ">=3.0.1,<=3.1.0-dev0" +colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} +dill = [ + {version = ">=0.2", markers = "python_version < \"3.11\""}, + {version = ">=0.3.6", markers = "python_version >= \"3.11\""}, +] +isort = ">=4.2.5,<5.13.0 || >5.13.0,<6" +mccabe = ">=0.6,<0.8" +platformdirs = ">=2.2.0" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +tomlkit = ">=0.10.1" +typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\""} + +[package.extras] +spelling = ["pyenchant (>=3.2,<4.0)"] +testutils = ["gitpython (>3)"] + [[package]] name = "pytz" version = "2024.1" @@ -614,6 +721,17 @@ files = [ {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] +[[package]] +name = "tomlkit" +version = "0.12.3" +description = "Style preserving TOML library" +optional = false +python-versions = ">=3.7" +files = [ + {file = "tomlkit-0.12.3-py3-none-any.whl", hash = "sha256:b0a645a9156dc7cb5d3a1f0d4bab66db287fcb8e0430bdd4664a095ea16414ba"}, + {file = "tomlkit-0.12.3.tar.gz", hash = "sha256:75baf5012d06501f07bee5bf8e801b9f343e7aac5a92581f20f80ce632e6b5a4"}, +] + [[package]] name = "typing-extensions" version = "4.9.0" @@ -656,4 +774,4 @@ zstd = ["zstandard (>=0.18.0)"] [metadata] lock-version = "2.0" python-versions = ">=3.9,<3.12" -content-hash = "cc5f42234e4625d3d3c86d88c01f658ddf794f794f6d18e07fc63a53d93e0230" +content-hash = "7fd7063ae4dd3cd4e98a00f4cf655a940d21111a742d8f316ce265cf920fa3e7" diff --git a/pyproject.toml b/pyproject.toml index 2987d99..9cc6678 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "django-mapengine" -version = "0.18.0" +version = "0.18.1" description = "Map engine for maplibre in django" authors = ["Hendrik Huyskens "] readme = "README.md" @@ -21,6 +21,8 @@ django-geojson = "^3.1.0" django = "^3.2.3" black = "^23.1.0" isort = "^5.12.0" +flake8 = "^7.0.0" +pylint = "^3.0.3" [build-system] requires = ["poetry-core"]