From d3263d641ac7c8b22f510b4f01ca2930e3050a14 Mon Sep 17 00:00:00 2001 From: Frank Tackitt Date: Thu, 10 Feb 2022 13:34:33 -0700 Subject: [PATCH] Split tests into two modules, one for shapely --- .github/workflows/main.yml | 2 +- poetry.lock | 267 +++++++---------- preprocess_cancellation.py | 4 +- pyproject.toml | 4 +- test_preprocessor.py | 405 +++++--------------------- test_preprocessor_with_shapely.py | 464 ++++++++++++++++++++++++++++++ tools/plot_defines.py | 4 +- 7 files changed, 639 insertions(+), 511 deletions(-) create mode 100644 test_preprocessor_with_shapely.py diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e3a7382..a41a878 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: python-version: '3.9.x' - run: | pip install -U pip poetry - poetry install + poetry install -E shapely env: POETRY_VIRTUALENVS_CREATE: false diff --git a/poetry.lock b/poetry.lock index 538055f..0822701 100644 --- a/poetry.lock +++ b/poetry.lock @@ -6,14 +6,6 @@ category = "dev" optional = false python-versions = "*" -[[package]] -name = "appdirs" -version = "1.4.4" -description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." -category = "dev" -optional = false -python-versions = "*" - [[package]] name = "atomicwrites" version = "1.4.0" @@ -24,40 +16,41 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" [[package]] name = "attrs" -version = "21.2.0" +version = "21.4.0" description = "Classes Without Boilerplate" category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" [package.extras] -dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit"] +dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit", "cloudpickle"] docs = ["furo", "sphinx", "zope.interface", "sphinx-notfound-page"] -tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface"] -tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins"] +tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "cloudpickle"] +tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "cloudpickle"] [[package]] name = "black" -version = "20.8b1" +version = "22.1.0" description = "The uncompromising code formatter." category = "dev" optional = false -python-versions = ">=3.6" +python-versions = ">=3.6.2" [package.dependencies] -appdirs = "*" -click = ">=7.1.2" +click = ">=8.0.0" dataclasses = {version = ">=0.6", markers = "python_version < \"3.7\""} mypy-extensions = ">=0.4.3" -pathspec = ">=0.6,<1" -regex = ">=2020.1.8" -toml = ">=0.10.1" -typed-ast = ">=1.4.0" -typing-extensions = ">=3.7.4" +pathspec = ">=0.9.0" +platformdirs = ">=2" +tomli = ">=1.1.0" +typed-ast = {version = ">=1.4.2", markers = "python_version < \"3.8\" and implementation_name == \"cpython\""} +typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""} [package.extras] colorama = ["colorama (>=0.4.3)"] -d = ["aiohttp (>=3.3.2)", "aiohttp-cors"] +d = ["aiohttp (>=3.7.4)"] +jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] +uvloop = ["uvloop (>=0.15.2)"] [[package]] name = "click" @@ -119,7 +112,7 @@ python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" [[package]] name = "importlib-metadata" -version = "4.8.2" +version = "4.8.3" description = "Read metadata from Python packages" category = "dev" optional = false @@ -245,6 +238,18 @@ category = "dev" optional = false python-versions = ">=3.6" +[[package]] +name = "platformdirs" +version = "2.4.0" +description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.extras] +docs = ["Sphinx (>=4)", "furo (>=2021.7.5b38)", "proselint (>=0.10.2)", "sphinx-autodoc-typehints (>=1.12)"] +test = ["appdirs (==1.4.4)", "pytest (>=6)", "pytest-cov (>=2.7)", "pytest-mock (>=3.6)"] + [[package]] name = "pluggy" version = "1.0.0" @@ -290,7 +295,7 @@ hook_testing = ["pytest (>=2.7.3)", "execnet (>=1.5.0)", "psutil"] [[package]] name = "pyinstaller-hooks-contrib" -version = "2021.4" +version = "2022.0" description = "Community maintained hooks for PyInstaller" category = "dev" optional = false @@ -298,7 +303,7 @@ python-versions = "*" [[package]] name = "pyparsing" -version = "3.0.6" +version = "3.0.7" description = "Python parsing module" category = "dev" optional = false @@ -309,7 +314,7 @@ diagrams = ["jinja2", "railroad-diagrams"] [[package]] name = "pytest" -version = "6.2.5" +version = "7.0.0" description = "pytest: simple powerful testing with Python" category = "dev" optional = false @@ -324,10 +329,10 @@ iniconfig = "*" packaging = "*" pluggy = ">=0.12,<2.0" py = ">=1.8.2" -toml = "*" +tomli = ">=1.0.0" [package.extras] -testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] +testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "xmlschema"] [[package]] name = "pytest-cov" @@ -363,20 +368,12 @@ category = "dev" optional = false python-versions = "*" -[[package]] -name = "regex" -version = "2021.11.10" -description = "Alternative regular expression module, to replace re." -category = "dev" -optional = false -python-versions = "*" - [[package]] name = "shapely" version = "1.8.0" description = "Geometric objects, predicates, and operations" category = "main" -optional = true +optional = false python-versions = ">=3.6" [package.extras] @@ -392,17 +389,9 @@ category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" -[[package]] -name = "toml" -version = "0.10.2" -description = "Python Library for Tom's Obvious, Minimal Language" -category = "dev" -optional = false -python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" - [[package]] name = "tomli" -version = "1.2.2" +version = "1.2.3" description = "A lil' TOML parser" category = "dev" optional = false @@ -410,7 +399,7 @@ python-versions = ">=3.6" [[package]] name = "typed-ast" -version = "1.5.1" +version = "1.5.2" description = "a fork of Python 2 and 3 ast modules with type comment support" category = "dev" optional = false @@ -441,29 +430,46 @@ shapely = ["shapely"] [metadata] lock-version = "1.1" -python-versions = ">= 3.6.0" -content-hash = "bbffb2eae0611033ca012eb79a9daf8337b887023afbda934e4ff7fc9ab0af3f" +python-versions = ">= 3.6.2" +content-hash = "ade99690c17726aa512e53eeecbfe5a53410189827a94f6c3f7347b4f5316f37" [metadata.files] altgraph = [ {file = "altgraph-0.17.2-py2.py3-none-any.whl", hash = "sha256:743628f2ac6a7c26f5d9223c91ed8ecbba535f506f4b6f558885a8a56a105857"}, {file = "altgraph-0.17.2.tar.gz", hash = "sha256:ebf2269361b47d97b3b88e696439f6e4cbc607c17c51feb1754f90fb79839158"}, ] -appdirs = [ - {file = "appdirs-1.4.4-py2.py3-none-any.whl", hash = "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128"}, - {file = "appdirs-1.4.4.tar.gz", hash = "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41"}, -] atomicwrites = [ {file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"}, {file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"}, ] attrs = [ - {file = "attrs-21.2.0-py2.py3-none-any.whl", hash = "sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1"}, - {file = "attrs-21.2.0.tar.gz", hash = "sha256:ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb"}, + {file = "attrs-21.4.0-py2.py3-none-any.whl", hash = "sha256:2d27e3784d7a565d36ab851fe94887c5eccd6a463168875832a1be79c82828b4"}, + {file = "attrs-21.4.0.tar.gz", hash = "sha256:626ba8234211db98e869df76230a137c4c40a12d72445c45d5f5b716f076e2fd"}, ] black = [ - {file = "black-20.8b1-py3-none-any.whl", hash = "sha256:70b62ef1527c950db59062cda342ea224d772abdf6adc58b86a45421bab20a6b"}, - {file = "black-20.8b1.tar.gz", hash = "sha256:1c02557aa099101b9d21496f8a914e9ed2222ef70336404eeeac8edba836fbea"}, + {file = "black-22.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:1297c63b9e1b96a3d0da2d85d11cd9bf8664251fd69ddac068b98dc4f34f73b6"}, + {file = "black-22.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2ff96450d3ad9ea499fc4c60e425a1439c2120cbbc1ab959ff20f7c76ec7e866"}, + {file = "black-22.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0e21e1f1efa65a50e3960edd068b6ae6d64ad6235bd8bfea116a03b21836af71"}, + {file = "black-22.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e2f69158a7d120fd641d1fa9a921d898e20d52e44a74a6fbbcc570a62a6bc8ab"}, + {file = "black-22.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:228b5ae2c8e3d6227e4bde5920d2fc66cc3400fde7bcc74f480cb07ef0b570d5"}, + {file = "black-22.1.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:b1a5ed73ab4c482208d20434f700d514f66ffe2840f63a6252ecc43a9bc77e8a"}, + {file = "black-22.1.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:35944b7100af4a985abfcaa860b06af15590deb1f392f06c8683b4381e8eeaf0"}, + {file = "black-22.1.0-cp36-cp36m-win_amd64.whl", hash = "sha256:7835fee5238fc0a0baf6c9268fb816b5f5cd9b8793423a75e8cd663c48d073ba"}, + {file = "black-22.1.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:dae63f2dbf82882fa3b2a3c49c32bffe144970a573cd68d247af6560fc493ae1"}, + {file = "black-22.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5fa1db02410b1924b6749c245ab38d30621564e658297484952f3d8a39fce7e8"}, + {file = "black-22.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:c8226f50b8c34a14608b848dc23a46e5d08397d009446353dad45e04af0c8e28"}, + {file = "black-22.1.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:2d6f331c02f0f40aa51a22e479c8209d37fcd520c77721c034517d44eecf5912"}, + {file = "black-22.1.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:742ce9af3086e5bd07e58c8feb09dbb2b047b7f566eb5f5bc63fd455814979f3"}, + {file = "black-22.1.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:fdb8754b453fb15fad3f72cd9cad3e16776f0964d67cf30ebcbf10327a3777a3"}, + {file = "black-22.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f5660feab44c2e3cb24b2419b998846cbb01c23c7fe645fee45087efa3da2d61"}, + {file = "black-22.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:6f2f01381f91c1efb1451998bd65a129b3ed6f64f79663a55fe0e9b74a5f81fd"}, + {file = "black-22.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:efbadd9b52c060a8fc3b9658744091cb33c31f830b3f074422ed27bad2b18e8f"}, + {file = "black-22.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:8871fcb4b447206904932b54b567923e5be802b9b19b744fdff092bd2f3118d0"}, + {file = "black-22.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ccad888050f5393f0d6029deea2a33e5ae371fd182a697313bdbd835d3edaf9c"}, + {file = "black-22.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:07e5c049442d7ca1a2fc273c79d1aecbbf1bc858f62e8184abe1ad175c4f7cc2"}, + {file = "black-22.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:373922fc66676133ddc3e754e4509196a8c392fec3f5ca4486673e685a421321"}, + {file = "black-22.1.0-py3-none-any.whl", hash = "sha256:3524739d76b6b3ed1132422bf9d82123cd1705086723bc3e235ca39fd21c667d"}, + {file = "black-22.1.0.tar.gz", hash = "sha256:a7c0192d35635f6fc1174be575cb7915e92e5dd629ee79fdaf0dcfa41a80afb5"}, ] click = [ {file = "click-8.0.3-py3-none-any.whl", hash = "sha256:353f466495adaeb40b6b5f592f9f91cb22372351c84caeb068132442a4518ef3"}, @@ -534,8 +540,8 @@ future = [ {file = "future-0.18.2.tar.gz", hash = "sha256:b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d"}, ] importlib-metadata = [ - {file = "importlib_metadata-4.8.2-py3-none-any.whl", hash = "sha256:53ccfd5c134223e497627b9815d5030edf77d2ed573922f7a0b8f8bb81a1c100"}, - {file = "importlib_metadata-4.8.2.tar.gz", hash = "sha256:75bdec14c397f528724c1bfd9709d660b33a4d2e77387a3358f20b848bb5e5fb"}, + {file = "importlib_metadata-4.8.3-py3-none-any.whl", hash = "sha256:65a9576a5b2d58ca44d133c42a241905cc45e34d2c06fd5ba2bafa221e5d7b5e"}, + {file = "importlib_metadata-4.8.3.tar.gz", hash = "sha256:766abffff765960fcc18003801f7044eb6755ffae4521c8e8ce8e83b9c9b0668"}, ] iniconfig = [ {file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"}, @@ -709,6 +715,10 @@ pillow = [ {file = "Pillow-8.4.0-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:244cf3b97802c34c41905d22810846802a3329ddcb93ccc432870243211c79fc"}, {file = "Pillow-8.4.0.tar.gz", hash = "sha256:b8e2f83c56e141920c39464b852de3719dfbfb6e3c99a2d8da0edf4fb33176ed"}, ] +platformdirs = [ + {file = "platformdirs-2.4.0-py3-none-any.whl", hash = "sha256:8868bbe3c3c80d42f20156f22e7131d2fb321f5bc86a2a345375c6481a67021d"}, + {file = "platformdirs-2.4.0.tar.gz", hash = "sha256:367a5e80b3d04d2428ffa76d33f124cf11e8fff2acdaa9b43d545f5c7d661ef2"}, +] pluggy = [ {file = "pluggy-1.0.0-py2.py3-none-any.whl", hash = "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"}, {file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"}, @@ -727,16 +737,16 @@ pyinstaller = [ {file = "pyinstaller-4.5.1.tar.gz", hash = "sha256:30733baaf8971902286a0ddf77e5499ac5f7bf8e7c39163e83d4f8c696ef265e"}, ] pyinstaller-hooks-contrib = [ - {file = "pyinstaller-hooks-contrib-2021.4.tar.gz", hash = "sha256:775b52200b39e12c95cc24f809eb050a97110fee819d178ebfde214f0f51e5f4"}, - {file = "pyinstaller_hooks_contrib-2021.4-py2.py3-none-any.whl", hash = "sha256:60a57e4057fa2183bbaa81f10401a27eb7dd701ef8a11b287bb6345b571f94e7"}, + {file = "pyinstaller-hooks-contrib-2022.0.tar.gz", hash = "sha256:61b667f51b2525377fae30793f38fd9752a08032c72b209effabf707c840cc38"}, + {file = "pyinstaller_hooks_contrib-2022.0-py2.py3-none-any.whl", hash = "sha256:29f0bd8fbb2ff6f2df60a0c147e5b5ad65ae5c1a982d90641a5f712de03fa161"}, ] pyparsing = [ - {file = "pyparsing-3.0.6-py3-none-any.whl", hash = "sha256:04ff808a5b90911829c55c4e26f75fa5ca8a2f5f36aa3a51f68e27033341d3e4"}, - {file = "pyparsing-3.0.6.tar.gz", hash = "sha256:d9bdec0013ef1eb5a84ab39a3b3868911598afa494f5faa038647101504e2b81"}, + {file = "pyparsing-3.0.7-py3-none-any.whl", hash = "sha256:a6c06a88f252e6c322f65faf8f418b16213b51bdfaece0524c1c1bc30c63c484"}, + {file = "pyparsing-3.0.7.tar.gz", hash = "sha256:18ee9022775d270c55187733956460083db60b37d0d0fb357445f3094eed3eea"}, ] pytest = [ - {file = "pytest-6.2.5-py3-none-any.whl", hash = "sha256:7310f8d27bc79ced999e760ca304d69f6ba6c6649c0b60fb0e04a4a77cacc134"}, - {file = "pytest-6.2.5.tar.gz", hash = "sha256:131b36680866a76e6781d13f101efb86cf674ebb9762eb70d3082b6f29889e89"}, + {file = "pytest-7.0.0-py3-none-any.whl", hash = "sha256:42901e6bd4bd4a0e533358a86e848427a49005a3256f657c5c8f8dd35ef137a9"}, + {file = "pytest-7.0.0.tar.gz", hash = "sha256:dad48ffda394e5ad9aa3b7d7ddf339ed502e5e365b1350e0af65f4a602344b11"}, ] pytest-cov = [ {file = "pytest-cov-3.0.0.tar.gz", hash = "sha256:e7f0f5b1617d2210a2cabc266dfe2f4c75a8d32fb89eafb7ad9d06f6d076d470"}, @@ -750,82 +760,6 @@ pywin32-ctypes = [ {file = "pywin32-ctypes-0.2.0.tar.gz", hash = "sha256:24ffc3b341d457d48e8922352130cf2644024a4ff09762a2261fd34c36ee5942"}, {file = "pywin32_ctypes-0.2.0-py2.py3-none-any.whl", hash = "sha256:9dc2d991b3479cc2df15930958b674a48a227d5361d413827a4cfd0b5876fc98"}, ] -regex = [ - {file = "regex-2021.11.10-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9345b6f7ee578bad8e475129ed40123d265464c4cfead6c261fd60fc9de00bcf"}, - {file = "regex-2021.11.10-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:416c5f1a188c91e3eb41e9c8787288e707f7d2ebe66e0a6563af280d9b68478f"}, - {file = "regex-2021.11.10-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e0538c43565ee6e703d3a7c3bdfe4037a5209250e8502c98f20fea6f5fdf2965"}, - {file = "regex-2021.11.10-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7ee1227cf08b6716c85504aebc49ac827eb88fcc6e51564f010f11a406c0a667"}, - {file = "regex-2021.11.10-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6650f16365f1924d6014d2ea770bde8555b4a39dc9576abb95e3cd1ff0263b36"}, - {file = "regex-2021.11.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:30ab804ea73972049b7a2a5c62d97687d69b5a60a67adca07eb73a0ddbc9e29f"}, - {file = "regex-2021.11.10-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:68a067c11463de2a37157930d8b153005085e42bcb7ad9ca562d77ba7d1404e0"}, - {file = "regex-2021.11.10-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:162abfd74e88001d20cb73ceaffbfe601469923e875caf9118333b1a4aaafdc4"}, - {file = "regex-2021.11.10-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:b9ed0b1e5e0759d6b7f8e2f143894b2a7f3edd313f38cf44e1e15d360e11749b"}, - {file = "regex-2021.11.10-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:473e67837f786404570eae33c3b64a4b9635ae9f00145250851a1292f484c063"}, - {file = "regex-2021.11.10-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:2fee3ed82a011184807d2127f1733b4f6b2ff6ec7151d83ef3477f3b96a13d03"}, - {file = "regex-2021.11.10-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:d5fd67df77bab0d3f4ea1d7afca9ef15c2ee35dfb348c7b57ffb9782a6e4db6e"}, - {file = "regex-2021.11.10-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:5d408a642a5484b9b4d11dea15a489ea0928c7e410c7525cd892f4d04f2f617b"}, - {file = "regex-2021.11.10-cp310-cp310-win32.whl", hash = "sha256:98ba568e8ae26beb726aeea2273053c717641933836568c2a0278a84987b2a1a"}, - {file = "regex-2021.11.10-cp310-cp310-win_amd64.whl", hash = "sha256:780b48456a0f0ba4d390e8b5f7c661fdd218934388cde1a974010a965e200e12"}, - {file = "regex-2021.11.10-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:dba70f30fd81f8ce6d32ddeef37d91c8948e5d5a4c63242d16a2b2df8143aafc"}, - {file = "regex-2021.11.10-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e1f54b9b4b6c53369f40028d2dd07a8c374583417ee6ec0ea304e710a20f80a0"}, - {file = "regex-2021.11.10-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fbb9dc00e39f3e6c0ef48edee202f9520dafb233e8b51b06b8428cfcb92abd30"}, - {file = "regex-2021.11.10-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:666abff54e474d28ff42756d94544cdfd42e2ee97065857413b72e8a2d6a6345"}, - {file = "regex-2021.11.10-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5537f71b6d646f7f5f340562ec4c77b6e1c915f8baae822ea0b7e46c1f09b733"}, - {file = "regex-2021.11.10-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ed2e07c6a26ed4bea91b897ee2b0835c21716d9a469a96c3e878dc5f8c55bb23"}, - {file = "regex-2021.11.10-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:ca5f18a75e1256ce07494e245cdb146f5a9267d3c702ebf9b65c7f8bd843431e"}, - {file = "regex-2021.11.10-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:74cbeac0451f27d4f50e6e8a8f3a52ca074b5e2da9f7b505c4201a57a8ed6286"}, - {file = "regex-2021.11.10-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:3598893bde43091ee5ca0a6ad20f08a0435e93a69255eeb5f81b85e81e329264"}, - {file = "regex-2021.11.10-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:50a7ddf3d131dc5633dccdb51417e2d1910d25cbcf842115a3a5893509140a3a"}, - {file = "regex-2021.11.10-cp36-cp36m-musllinux_1_1_s390x.whl", hash = "sha256:61600a7ca4bcf78a96a68a27c2ae9389763b5b94b63943d5158f2a377e09d29a"}, - {file = "regex-2021.11.10-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:563d5f9354e15e048465061509403f68424fef37d5add3064038c2511c8f5e00"}, - {file = "regex-2021.11.10-cp36-cp36m-win32.whl", hash = "sha256:93a5051fcf5fad72de73b96f07d30bc29665697fb8ecdfbc474f3452c78adcf4"}, - {file = "regex-2021.11.10-cp36-cp36m-win_amd64.whl", hash = "sha256:b483c9d00a565633c87abd0aaf27eb5016de23fed952e054ecc19ce32f6a9e7e"}, - {file = "regex-2021.11.10-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:fff55f3ce50a3ff63ec8e2a8d3dd924f1941b250b0aac3d3d42b687eeff07a8e"}, - {file = "regex-2021.11.10-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e32d2a2b02ccbef10145df9135751abea1f9f076e67a4e261b05f24b94219e36"}, - {file = "regex-2021.11.10-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:53db2c6be8a2710b359bfd3d3aa17ba38f8aa72a82309a12ae99d3c0c3dcd74d"}, - {file = "regex-2021.11.10-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2207ae4f64ad3af399e2d30dde66f0b36ae5c3129b52885f1bffc2f05ec505c8"}, - {file = "regex-2021.11.10-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d5ca078bb666c4a9d1287a379fe617a6dccd18c3e8a7e6c7e1eb8974330c626a"}, - {file = "regex-2021.11.10-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dd33eb9bdcfbabab3459c9ee651d94c842bc8a05fabc95edf4ee0c15a072495e"}, - {file = "regex-2021.11.10-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:05b7d6d7e64efe309972adab77fc2af8907bb93217ec60aa9fe12a0dad35874f"}, - {file = "regex-2021.11.10-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:42b50fa6666b0d50c30a990527127334d6b96dd969011e843e726a64011485da"}, - {file = "regex-2021.11.10-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:6e1d2cc79e8dae442b3fa4a26c5794428b98f81389af90623ffcc650ce9f6732"}, - {file = "regex-2021.11.10-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:0416f7399e918c4b0e074a0f66e5191077ee2ca32a0f99d4c187a62beb47aa05"}, - {file = "regex-2021.11.10-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:ce298e3d0c65bd03fa65ffcc6db0e2b578e8f626d468db64fdf8457731052942"}, - {file = "regex-2021.11.10-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:dc07f021ee80510f3cd3af2cad5b6a3b3a10b057521d9e6aaeb621730d320c5a"}, - {file = "regex-2021.11.10-cp37-cp37m-win32.whl", hash = "sha256:e71255ba42567d34a13c03968736c5d39bb4a97ce98188fafb27ce981115beec"}, - {file = "regex-2021.11.10-cp37-cp37m-win_amd64.whl", hash = "sha256:07856afef5ffcc052e7eccf3213317fbb94e4a5cd8177a2caa69c980657b3cb4"}, - {file = "regex-2021.11.10-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ba05430e819e58544e840a68b03b28b6d328aff2e41579037e8bab7653b37d83"}, - {file = "regex-2021.11.10-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7f301b11b9d214f83ddaf689181051e7f48905568b0c7017c04c06dfd065e244"}, - {file = "regex-2021.11.10-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4aaa4e0705ef2b73dd8e36eeb4c868f80f8393f5f4d855e94025ce7ad8525f50"}, - {file = "regex-2021.11.10-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:788aef3549f1924d5c38263104dae7395bf020a42776d5ec5ea2b0d3d85d6646"}, - {file = "regex-2021.11.10-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f8af619e3be812a2059b212064ea7a640aff0568d972cd1b9e920837469eb3cb"}, - {file = "regex-2021.11.10-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:85bfa6a5413be0ee6c5c4a663668a2cad2cbecdee367630d097d7823041bdeec"}, - {file = "regex-2021.11.10-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f23222527b307970e383433daec128d769ff778d9b29343fb3496472dc20dabe"}, - {file = "regex-2021.11.10-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:da1a90c1ddb7531b1d5ff1e171b4ee61f6345119be7351104b67ff413843fe94"}, - {file = "regex-2021.11.10-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:f5be7805e53dafe94d295399cfbe5227f39995a997f4fd8539bf3cbdc8f47ca8"}, - {file = "regex-2021.11.10-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a955b747d620a50408b7fdf948e04359d6e762ff8a85f5775d907ceced715129"}, - {file = "regex-2021.11.10-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:139a23d1f5d30db2cc6c7fd9c6d6497872a672db22c4ae1910be22d4f4b2068a"}, - {file = "regex-2021.11.10-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:ca49e1ab99593438b204e00f3970e7a5f70d045267051dfa6b5f4304fcfa1dbf"}, - {file = "regex-2021.11.10-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:96fc32c16ea6d60d3ca7f63397bff5c75c5a562f7db6dec7d412f7c4d2e78ec0"}, - {file = "regex-2021.11.10-cp38-cp38-win32.whl", hash = "sha256:0617383e2fe465732af4509e61648b77cbe3aee68b6ac8c0b6fe934db90be5cc"}, - {file = "regex-2021.11.10-cp38-cp38-win_amd64.whl", hash = "sha256:a3feefd5e95871872673b08636f96b61ebef62971eab044f5124fb4dea39919d"}, - {file = "regex-2021.11.10-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f7f325be2804246a75a4f45c72d4ce80d2443ab815063cdf70ee8fb2ca59ee1b"}, - {file = "regex-2021.11.10-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:537ca6a3586931b16a85ac38c08cc48f10fc870a5b25e51794c74df843e9966d"}, - {file = "regex-2021.11.10-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eef2afb0fd1747f33f1ee3e209bce1ed582d1896b240ccc5e2697e3275f037c7"}, - {file = "regex-2021.11.10-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:432bd15d40ed835a51617521d60d0125867f7b88acf653e4ed994a1f8e4995dc"}, - {file = "regex-2021.11.10-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b43c2b8a330a490daaef5a47ab114935002b13b3f9dc5da56d5322ff218eeadb"}, - {file = "regex-2021.11.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:962b9a917dd7ceacbe5cd424556914cb0d636001e393b43dc886ba31d2a1e449"}, - {file = "regex-2021.11.10-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fa8c626d6441e2d04b6ee703ef2d1e17608ad44c7cb75258c09dd42bacdfc64b"}, - {file = "regex-2021.11.10-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:3c5fb32cc6077abad3bbf0323067636d93307c9fa93e072771cf9a64d1c0f3ef"}, - {file = "regex-2021.11.10-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:cd410a1cbb2d297c67d8521759ab2ee3f1d66206d2e4328502a487589a2cb21b"}, - {file = "regex-2021.11.10-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:e6096b0688e6e14af6a1b10eaad86b4ff17935c49aa774eac7c95a57a4e8c296"}, - {file = "regex-2021.11.10-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:529801a0d58809b60b3531ee804d3e3be4b412c94b5d267daa3de7fadef00f49"}, - {file = "regex-2021.11.10-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:0f594b96fe2e0821d026365f72ac7b4f0b487487fb3d4aaf10dd9d97d88a9737"}, - {file = "regex-2021.11.10-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:2409b5c9cef7054dde93a9803156b411b677affc84fca69e908b1cb2c540025d"}, - {file = "regex-2021.11.10-cp39-cp39-win32.whl", hash = "sha256:3b5df18db1fccd66de15aa59c41e4f853b5df7550723d26aa6cb7f40e5d9da5a"}, - {file = "regex-2021.11.10-cp39-cp39-win_amd64.whl", hash = "sha256:83ee89483672b11f8952b158640d0c0ff02dc43d9cb1b70c1564b49abe92ce29"}, - {file = "regex-2021.11.10.tar.gz", hash = "sha256:f341ee2df0999bfdf7a95e448075effe0db212a59387de1a70690e4acb03d4c6"}, -] shapely = [ {file = "Shapely-1.8.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1c5632cedea6d815b61eb4c264da1c3f24a8ce2ceba2f74e30fba340ca230563"}, {file = "Shapely-1.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d4ce1f18a0c9bb6b483c73bd7a0eb3a5e90676bcc29b9c27120236e662195c9d"}, @@ -853,34 +787,35 @@ six = [ {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, ] -toml = [ - {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, - {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, -] tomli = [ - {file = "tomli-1.2.2-py3-none-any.whl", hash = "sha256:f04066f68f5554911363063a30b108d2b5a5b1a010aa8b6132af78489fe3aade"}, - {file = "tomli-1.2.2.tar.gz", hash = "sha256:c6ce0015eb38820eaf32b5db832dbc26deb3dd427bd5f6556cf0acac2c214fee"}, + {file = "tomli-1.2.3-py3-none-any.whl", hash = "sha256:e3069e4be3ead9668e21cb9b074cd948f7b3113fd9c8bba083f48247aab8b11c"}, + {file = "tomli-1.2.3.tar.gz", hash = "sha256:05b6166bff487dc068d322585c7ea4ef78deed501cc124060e0f238e89a9231f"}, ] typed-ast = [ - {file = "typed_ast-1.5.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5d8314c92414ce7481eee7ad42b353943679cf6f30237b5ecbf7d835519e1212"}, - {file = "typed_ast-1.5.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:b53ae5de5500529c76225d18eeb060efbcec90ad5e030713fe8dab0fb4531631"}, - {file = "typed_ast-1.5.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:24058827d8f5d633f97223f5148a7d22628099a3d2efe06654ce872f46f07cdb"}, - {file = "typed_ast-1.5.1-cp310-cp310-win_amd64.whl", hash = "sha256:a6d495c1ef572519a7bac9534dbf6d94c40e5b6a608ef41136133377bba4aa08"}, - {file = "typed_ast-1.5.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:de4ecae89c7d8b56169473e08f6bfd2df7f95015591f43126e4ea7865928677e"}, - {file = "typed_ast-1.5.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:256115a5bc7ea9e665c6314ed6671ee2c08ca380f9d5f130bd4d2c1f5848d695"}, - {file = "typed_ast-1.5.1-cp36-cp36m-win_amd64.whl", hash = "sha256:7c42707ab981b6cf4b73490c16e9d17fcd5227039720ca14abe415d39a173a30"}, - {file = "typed_ast-1.5.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:71dcda943a471d826ea930dd449ac7e76db7be778fcd722deb63642bab32ea3f"}, - {file = "typed_ast-1.5.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:4f30a2bcd8e68adbb791ce1567fdb897357506f7ea6716f6bbdd3053ac4d9471"}, - {file = "typed_ast-1.5.1-cp37-cp37m-win_amd64.whl", hash = "sha256:ca9e8300d8ba0b66d140820cf463438c8e7b4cdc6fd710c059bfcfb1531d03fb"}, - {file = "typed_ast-1.5.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:9caaf2b440efb39ecbc45e2fabde809cbe56272719131a6318fd9bf08b58e2cb"}, - {file = "typed_ast-1.5.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:c9bcad65d66d594bffab8575f39420fe0ee96f66e23c4d927ebb4e24354ec1af"}, - {file = "typed_ast-1.5.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:591bc04e507595887160ed7aa8d6785867fb86c5793911be79ccede61ae96f4d"}, - {file = "typed_ast-1.5.1-cp38-cp38-win_amd64.whl", hash = "sha256:a80d84f535642420dd17e16ae25bb46c7f4c16ee231105e7f3eb43976a89670a"}, - {file = "typed_ast-1.5.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:38cf5c642fa808300bae1281460d4f9b7617cf864d4e383054a5ef336e344d32"}, - {file = "typed_ast-1.5.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:5b6ab14c56bc9c7e3c30228a0a0b54b915b1579613f6e463ba6f4eb1382e7fd4"}, - {file = "typed_ast-1.5.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:a2b8d7007f6280e36fa42652df47087ac7b0a7d7f09f9468f07792ba646aac2d"}, - {file = "typed_ast-1.5.1-cp39-cp39-win_amd64.whl", hash = "sha256:b6d17f37f6edd879141e64a5db17b67488cfeffeedad8c5cec0392305e9bc775"}, - {file = "typed_ast-1.5.1.tar.gz", hash = "sha256:484137cab8ecf47e137260daa20bafbba5f4e3ec7fda1c1e69ab299b75fa81c5"}, + {file = "typed_ast-1.5.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:183b183b7771a508395d2cbffd6db67d6ad52958a5fdc99f450d954003900266"}, + {file = "typed_ast-1.5.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:676d051b1da67a852c0447621fdd11c4e104827417bf216092ec3e286f7da596"}, + {file = "typed_ast-1.5.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bc2542e83ac8399752bc16e0b35e038bdb659ba237f4222616b4e83fb9654985"}, + {file = "typed_ast-1.5.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:74cac86cc586db8dfda0ce65d8bcd2bf17b58668dfcc3652762f3ef0e6677e76"}, + {file = "typed_ast-1.5.2-cp310-cp310-win_amd64.whl", hash = "sha256:18fe320f354d6f9ad3147859b6e16649a0781425268c4dde596093177660e71a"}, + {file = "typed_ast-1.5.2-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:31d8c6b2df19a777bc8826770b872a45a1f30cfefcfd729491baa5237faae837"}, + {file = "typed_ast-1.5.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:963a0ccc9a4188524e6e6d39b12c9ca24cc2d45a71cfdd04a26d883c922b4b78"}, + {file = "typed_ast-1.5.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:0eb77764ea470f14fcbb89d51bc6bbf5e7623446ac4ed06cbd9ca9495b62e36e"}, + {file = "typed_ast-1.5.2-cp36-cp36m-win_amd64.whl", hash = "sha256:294a6903a4d087db805a7656989f613371915fc45c8cc0ddc5c5a0a8ad9bea4d"}, + {file = "typed_ast-1.5.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:26a432dc219c6b6f38be20a958cbe1abffcc5492821d7e27f08606ef99e0dffd"}, + {file = "typed_ast-1.5.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c7407cfcad702f0b6c0e0f3e7ab876cd1d2c13b14ce770e412c0c4b9728a0f88"}, + {file = "typed_ast-1.5.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f30ddd110634c2d7534b2d4e0e22967e88366b0d356b24de87419cc4410c41b7"}, + {file = "typed_ast-1.5.2-cp37-cp37m-win_amd64.whl", hash = "sha256:8c08d6625bb258179b6e512f55ad20f9dfef019bbfbe3095247401e053a3ea30"}, + {file = "typed_ast-1.5.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:90904d889ab8e81a956f2c0935a523cc4e077c7847a836abee832f868d5c26a4"}, + {file = "typed_ast-1.5.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:bbebc31bf11762b63bf61aaae232becb41c5bf6b3461b80a4df7e791fabb3aca"}, + {file = "typed_ast-1.5.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c29dd9a3a9d259c9fa19d19738d021632d673f6ed9b35a739f48e5f807f264fb"}, + {file = "typed_ast-1.5.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:58ae097a325e9bb7a684572d20eb3e1809802c5c9ec7108e85da1eb6c1a3331b"}, + {file = "typed_ast-1.5.2-cp38-cp38-win_amd64.whl", hash = "sha256:da0a98d458010bf4fe535f2d1e367a2e2060e105978873c04c04212fb20543f7"}, + {file = "typed_ast-1.5.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:33b4a19ddc9fc551ebabca9765d54d04600c4a50eda13893dadf67ed81d9a098"}, + {file = "typed_ast-1.5.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1098df9a0592dd4c8c0ccfc2e98931278a6c6c53cb3a3e2cf7e9ee3b06153344"}, + {file = "typed_ast-1.5.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42c47c3b43fe3a39ddf8de1d40dbbfca60ac8530a36c9b198ea5b9efac75c09e"}, + {file = "typed_ast-1.5.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f290617f74a610849bd8f5514e34ae3d09eafd521dceaa6cf68b3f4414266d4e"}, + {file = "typed_ast-1.5.2-cp39-cp39-win_amd64.whl", hash = "sha256:df05aa5b241e2e8045f5f4367a9f6187b09c4cdf8578bb219861c4e27c443db5"}, + {file = "typed_ast-1.5.2.tar.gz", hash = "sha256:525a2d4088e70a9f75b08b3f87a51acc9cde640e19cc523c7e41aa355564ae27"}, ] typing-extensions = [ {file = "typing_extensions-4.0.1-py3-none-any.whl", hash = "sha256:7f001e5ac290a0c0401508864c7ec868be4e701886d5b573a9528ed3973d9d3b"}, diff --git a/preprocess_cancellation.py b/preprocess_cancellation.py index 3ffb9b4..270926a 100644 --- a/preprocess_cancellation.py +++ b/preprocess_cancellation.py @@ -1,9 +1,9 @@ #!/usr/bin/env python3 from __future__ import annotations + import argparse import json import logging -import time import pathlib import platform import re @@ -11,9 +11,9 @@ import statistics import sys import tempfile +import time from typing import Any, Dict, List, NamedTuple, Optional, Set, Tuple, TypeVar - logging.basicConfig(stream=sys.stderr, level=logging.INFO) logger = logging.getLogger("prepropress_cancellation") diff --git a/pyproject.toml b/pyproject.toml index 6291be5..40fa674 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,8 @@ preprocess_cancellation = 'preprocess_cancellation:_main' shapely = [ "shapely" ] [tool.poetry.dependencies] -python = ">= 3.6.0" +python = ">= 3.6.2" + shapely = { version = "*", optional = true } [tool.poetry.dev-dependencies] @@ -28,6 +29,7 @@ matplotlib = "*" pyinstaller = "*" pytest = "*" pytest-cov = "*" +shapely = "*" [tool.black] line_length = 120 diff --git a/test_preprocessor.py b/test_preprocessor.py index 10bf820..7b37130 100644 --- a/test_preprocessor.py +++ b/test_preprocessor.py @@ -1,33 +1,26 @@ -from re import sub -import subprocess +import re import pathlib +import subprocess import sys + + from preprocess_cancellation import preprocess_cura, preprocess_ideamaker, preprocess_m486, preprocess_slicer + gcode_path = pathlib.Path("./GCode") -def test_cli_shapely(): - """ - Ensure the preprocesor does not crash - """ - try: - command = [ - sys.executable, - "./preprocess_cancellation.py", - "-o", - ".testing", - *gcode_path.glob("*.gcode"), - ] - with subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as proc: - proc.wait() - assert proc.returncode == 0 - finally: - for testing_file in gcode_path.glob("*.testing.gcode"): - testing_file.unlink() +def collect_definitions(lines): + definitions = set() + for line in lines: + if line.startswith("DEFINE_OBJECT"): + definitions.add(line) + # Add just the `DEFINE_OBJECT NAME=...` as well, for quick checking without caring about coordinates + definitions.add(re.sub(r"^(DEFINE_OBJECT).*(NAME=\S+).*$", r"\1 \2", line)) + return definitions -def test_cli_without_shapely(): +def test_cli_without(): """ Ensure the preprocesor does not crash """ @@ -52,24 +45,12 @@ def test_m486(): with (gcode_path / "m486.gcode").open("r") as f: results = "".join(list(preprocess_m486(f))).split("\n") - definitions = [r for r in results if r.startswith("DEFINE_OBJECT")] - - assert ( - "DEFINE_OBJECT NAME=0 CENTER=160.285,148.625 POLYGON=[[160.513,146.681],[160.268,146.693],[159.931,146.769],[158.514,147.252],[158.179,148.01],[158.103,148.462],[158.127,148.938],[158.245,149.4],[158.392,149.726],[159.679,150.294],[160.055,150.429],[160.475,150.479],[161.126,150.446],[161.461,150.301],[161.846,149.914],[162.077,149.631],[162.233,149.348],[162.342,149.02],[162.392,148.641],[162.371,148.283],[162.222,147.623],[161.633,147.062],[161.313,146.869],[161.128,146.798],[160.938,146.734],[160.513,146.681]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=1 CENTER=150.497,155.524 POLYGON=[[148.11,153.105],[148.11,157.895],[152.9,157.895],[152.84,153.105],[148.11,153.105]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=2 CENTER=139.563,155.504 POLYGON=[[137.11,153.105],[137.11,157.895],[141.9,157.895],[141.9,153.105],[137.11,153.105]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=3 CENTER=144.533,144.510 POLYGON=[[137.11,142.105],[137.11,146.895],[151.9,146.895],[151.9,142.105],[137.11,142.105]]" - in definitions - ) + definitions = collect_definitions(results) + + assert "DEFINE_OBJECT NAME=0" in definitions + assert "DEFINE_OBJECT NAME=1" in definitions + assert "DEFINE_OBJECT NAME=2" in definitions + assert "DEFINE_OBJECT NAME=3" in definitions assert results.count(f"START_CURRENT_OBJECT NAME=0") == 25 assert results.count(f"END_CURRENT_OBJECT NAME=0") == 25 @@ -88,48 +69,36 @@ def test_superslicer(): with (gcode_path / "superslicer.gcode").open("r") as f: results = "".join(list(preprocess_slicer(f))).split("\n") - definitions = [r for r in results if r.startswith("DEFINE_OBJECT")] - - assert ( - "DEFINE_OBJECT NAME=cube_1_id_0_copy_0 CENTER=150.515,155.476 POLYGON=[[148.215,153.21],[148.215,157.79],[152.795,157.79],[152.735,153.21],[148.215,153.21]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=cube_1_id_0_copy_1 CENTER=139.578,155.479 POLYGON=[[137.215,153.21],[137.215,157.79],[141.795,157.79],[141.795,153.21],[137.215,153.21]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=union_3_id_2_copy_0 CENTER=144.198,144.526 POLYGON=[[137.215,142.21],[137.215,146.79],[151.795,146.79],[151.795,142.21],[137.215,142.21]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=cylinder_2_id_1_copy_0 CENTER=160.152,148.483 POLYGON=[[160.207,146.625],[159.764,146.745],[159.4,146.942],[158.346,147.789],[158.23,148.24],[158.205,148.581],[158.567,149.29],[158.862,149.692],[159.422,150.245],[159.661,150.425],[160.384,150.734],[161.201,150.427],[161.569,150.234],[161.88,149.983],[162.134,149.676],[162.327,149.307],[162.448,148.866],[162.447,147.931],[162.117,147.477],[161.561,146.927],[161.243,146.695],[160.207,146.625]]" - in definitions - ) + definitions = collect_definitions(results) + + assert "DEFINE_OBJECT NAME=cube_1_id_0_copy_0" in definitions + assert "DEFINE_OBJECT NAME=cube_1_id_0_copy_1" in definitions + assert "DEFINE_OBJECT NAME=union_3_id_2_copy_0" in definitions + assert "DEFINE_OBJECT NAME=cylinder_2_id_1_copy_0" in definitions + + +def test_superslicer(): + with (gcode_path / "superslicer.gcode").open("r") as f: + results = "".join(list(preprocess_slicer(f))).split("\n") + + definitions = collect_definitions(results) + + assert "DEFINE_OBJECT NAME=cube_1_id_0_copy_0" in definitions + assert "DEFINE_OBJECT NAME=cube_1_id_0_copy_1" in definitions + assert "DEFINE_OBJECT NAME=union_3_id_2_copy_0" in definitions + assert "DEFINE_OBJECT NAME=cylinder_2_id_1_copy_0" in definitions def test_prusaslicer(): with (gcode_path / "prusaslicer.gcode").open("r") as f: results = "".join(list(preprocess_slicer(f))).split("\n") - definitions = [r for r in results if r.startswith("DEFINE_OBJECT")] - - assert ( - "DEFINE_OBJECT NAME=cylinder_2_id_1_copy_0 CENTER=160.285,148.625 POLYGON=[[160.513,146.681],[160.268,146.693],[159.931,146.769],[158.514,147.252],[158.179,148.01],[158.103,148.462],[158.127,148.938],[158.245,149.4],[158.392,149.726],[159.679,150.294],[160.055,150.429],[160.475,150.479],[161.126,150.446],[161.461,150.301],[161.846,149.914],[162.077,149.631],[162.233,149.348],[162.342,149.02],[162.392,148.641],[162.371,148.283],[162.222,147.623],[161.633,147.062],[161.313,146.869],[161.128,146.798],[160.938,146.734],[160.513,146.681]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=cube_1_id_0_copy_0 CENTER=150.497,155.524 POLYGON=[[148.11,153.105],[148.11,157.895],[152.9,157.895],[152.84,153.105],[148.11,153.105]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=cube_1_id_0_copy_1 CENTER=139.563,155.504 POLYGON=[[137.11,153.105],[137.11,157.895],[141.9,157.895],[141.9,153.105],[137.11,153.105]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=union_3_id_2_copy_0 CENTER=144.533,144.510 POLYGON=[[137.11,142.105],[137.11,146.895],[151.9,146.895],[151.9,142.105],[137.11,142.105]]" - in definitions - ) + definitions = collect_definitions(results) + + assert "DEFINE_OBJECT NAME=cylinder_2_id_1_copy_0" in definitions + assert "DEFINE_OBJECT NAME=cube_1_id_0_copy_0" in definitions + assert "DEFINE_OBJECT NAME=cube_1_id_0_copy_1" in definitions + assert "DEFINE_OBJECT NAME=union_3_id_2_copy_0" in definitions assert results.count(f"START_CURRENT_OBJECT NAME=cylinder_2_id_1_copy_0") == 25 assert results.count(f"END_CURRENT_OBJECT NAME=cylinder_2_id_1_copy_0") == 25 @@ -148,24 +117,12 @@ def test_slic3r(): with (gcode_path / "slic3r.gcode").open("r") as f: results = "".join(list(preprocess_slicer(f))).split("\n") - definitions = [r for r in results if r.startswith("DEFINE_OBJECT")] - - assert ( - "DEFINE_OBJECT NAME=cube_1_stl_id_0_copy_0 CENTER=99.963,83.531 POLYGON=[[97.72,81.22],[97.72,85.78],[102.28,85.72],[102.28,81.22],[97.72,81.22]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=cube_1_stl_id_0_copy_1 CENTER=99.963,116.531 POLYGON=[[97.72,114.22],[97.72,118.78],[102.28,118.72],[102.28,114.22],[97.72,114.22]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=cylinder_2_stl_id_1_copy_0 CENTER=99.962,94.515 POLYGON=[[100.17,92.227],[99.717,92.239],[99.271,92.34],[98.963,92.471],[98.579,92.718],[98.254,93.035],[97.999,93.41],[97.822,93.828],[97.732,94.273],[97.732,94.727],[97.822,95.172],[97.999,95.59],[98.254,95.965],[98.579,96.282],[98.96,96.528],[99.383,96.694],[99.83,96.773],[100.283,96.761],[100.726,96.66],[101.139,96.474],[101.51,96.207],[101.744,95.967],[102.001,95.59],[102.178,95.172],[102.268,94.727],[102.268,94.273],[102.178,93.828],[102.001,93.41],[101.746,93.035],[101.421,92.718],[101.04,92.472],[100.617,92.306],[100.17,92.227]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=union_3_stl_id_2_copy_0 CENTER=99.894,105.502 POLYGON=[[92.72,103.22],[92.72,107.78],[107.28,107.78],[107.28,103.22],[92.72,103.22]]" - in definitions - ) + definitions = collect_definitions(results) + + assert "DEFINE_OBJECT NAME=cube_1_stl_id_0_copy_0" in definitions + assert "DEFINE_OBJECT NAME=cube_1_stl_id_0_copy_1" in definitions + assert "DEFINE_OBJECT NAME=cylinder_2_stl_id_1_copy_0" in definitions + assert "DEFINE_OBJECT NAME=union_3_stl_id_2_copy_0" in definitions assert results.count(f"START_CURRENT_OBJECT NAME=cube_1_stl_id_0_copy_0") == 16 assert results.count(f"END_CURRENT_OBJECT NAME=cube_1_stl_id_0_copy_0") == 16 @@ -184,24 +141,12 @@ def test_cura(): with (gcode_path / "cura.gcode").open("r") as f: results = "".join(list(preprocess_cura(f))).split("\n") - definitions = [r for r in results if r.startswith("DEFINE_OBJECT")] - - assert ( - "DEFINE_OBJECT NAME=cylinder_2_stl CENTER=143.465,143.521 POLYGON=[[143.448,141.201],[142.992,141.257],[142.559,141.401],[142.182,141.615],[141.888,141.858],[141.597,142.207],[141.379,142.608],[141.245,143.047],[141.2,143.507],[141.24,143.926],[141.379,144.392],[141.588,144.779],[141.898,145.151],[142.247,145.429],[142.664,145.643],[143.095,145.764],[143.552,145.799],[144.009,145.743],[144.441,145.599],[144.845,145.366],[145.166,145.086],[145.402,144.794],[145.623,144.387],[145.755,143.953],[145.8,143.494],[145.753,143.038],[145.623,142.613],[145.409,142.216],[145.101,141.848],[144.753,141.571],[144.36,141.367],[143.905,141.236],[143.448,141.201]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=cube_1_stl CENTER=150.006,143.497 POLYGON=[[147.7,141.2],[147.7,145.8],[152.3,145.8],[152.3,141.2],[147.7,141.2]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=union_3_stl CENTER=149.838,150.082 POLYGON=[[142.7,147.7],[142.7,152.3],[157.3,152.3],[157.3,147.7],[142.7,147.7]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=cube_1_stl_1 CENTER=150.038,151.520 POLYGON=[[150.719,147.305],[150.569,147.309],[148.861,148.051],[148.4,148.513],[147.7,154.17],[147.7,158.77],[152.3,158.77],[152.3,154.17],[151.494,148.693],[151.255,147.686],[150.719,147.305]]" - in definitions - ) + definitions = collect_definitions(results) + + assert "DEFINE_OBJECT NAME=cylinder_2_stl" in definitions + assert "DEFINE_OBJECT NAME=cube_1_stl" in definitions + assert "DEFINE_OBJECT NAME=union_3_stl" in definitions + assert "DEFINE_OBJECT NAME=cube_1_stl_1" in definitions assert results.count(f"START_CURRENT_OBJECT NAME=cylinder_2_stl") == 25 assert results.count(f"END_CURRENT_OBJECT NAME=cylinder_2_stl") == 25 @@ -220,25 +165,12 @@ def test_ideamaker(): with (gcode_path / "ideamaker.gcode").open("r") as f: results = "".join(list(preprocess_ideamaker(f))).split("\n") - definitions = [r for r in results if r.startswith("DEFINE_OBJECT")] - - print(definitions) - assert ( - "DEFINE_OBJECT NAME=test_bed_part1_3mf CENTER=112.037,102.475 POLYGON=[[111.998,100.194],[111.545,100.239],[111.107,100.375],[110.705,100.594],[110.356,100.887],[110.068,101.248],[109.878,101.611],[109.755,101.998],[109.701,102.49],[109.735,102.901],[109.859,103.343],[110.068,103.752],[110.35,104.107],[110.709,104.409],[111.107,104.625],[111.544,104.761],[112.002,104.806],[112.455,104.761],[112.893,104.625],[113.295,104.406],[113.644,104.113],[113.918,103.773],[114.109,103.421],[114.244,103.005],[114.299,102.51],[114.265,102.099],[114.141,101.657],[113.932,101.248],[113.65,100.893],[113.298,100.596],[112.893,100.375],[112.47,100.242],[111.998,100.194]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=test_bed_part2_3mf CENTER=89.368,102.544 POLYGON=[[81.701,100.194],[81.701,104.806],[96.301,104.806],[96.301,100.194],[81.701,100.194]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=test_bed_part0_3mf CENTER=102.996,102.460 POLYGON=[[100.701,100.194],[100.701,104.806],[105.301,104.806],[105.301,100.194],[100.701,100.194]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=test_bed_part0_1_3mf CENTER=121.037,102.446 POLYGON=[[118.699,100.194],[118.699,104.806],[123.299,104.806],[123.299,100.194],[118.699,100.194]]" - in definitions - ) + definitions = collect_definitions(results) + + assert "DEFINE_OBJECT NAME=test_bed_part1_3mf" in definitions + assert "DEFINE_OBJECT NAME=test_bed_part2_3mf" in definitions + assert "DEFINE_OBJECT NAME=test_bed_part0_3mf" in definitions + assert "DEFINE_OBJECT NAME=test_bed_part0_1_3mf" in definitions assert results.count("START_CURRENT_OBJECT NAME=test_bed_part1_3mf") == 32 assert results.count("END_CURRENT_OBJECT NAME=test_bed_part1_3mf") == 32 @@ -257,220 +189,13 @@ def test_issue_1_prusaslicer_point_collection(): with (gcode_path / "prusaslicer-issue1.gcode").open("r") as f: results = "".join(list(preprocess_slicer(f))).split("\n") - definitions = [r for r in results if r.startswith("DEFINE_OBJECT")] + definitions = collect_definitions(results) - assert ( - "DEFINE_OBJECT NAME=Shape_Cylinder_id_1_copy_0 CENTER=154.928,108.320 POLYGON=[[155.012,94.688],[153.801,94.741],[152.362,94.943],[151.141,95.238],[149.812,95.698],[148.495,96.312],[147.318,97.015],[146.278,97.78],[145.199,98.752],[144.247,99.806],[143.437,100.909],[142.759,102.049],[142.145,103.365],[141.675,104.728],[141.39,105.914],[141.189,107.337],[141.135,108.562],[141.202,109.923],[141.39,111.211],[141.672,112.387],[142.145,113.761],[142.759,115.077],[143.468,116.263],[144.227,117.295],[145.199,118.374],[146.273,119.342],[147.251,120.066],[148.496,120.814],[149.774,121.412],[151.106,121.877],[152.362,122.183],[153.787,122.384],[155.009,122.438],[156.409,122.367],[157.658,122.183],[158.999,121.852],[160.208,121.427],[161.524,120.814],[162.707,120.107],[163.742,119.346],[164.821,118.374],[165.742,117.357],[166.513,116.322],[167.261,115.077],[167.863,113.79],[168.321,112.478],[168.63,111.211],[168.827,109.831],[168.885,108.564],[168.818,107.202],[168.63,105.914],[168.348,104.738],[167.875,103.365],[167.261,102.048],[166.548,100.856],[165.793,99.831],[164.821,98.752],[163.744,97.781],[162.77,97.06],[161.737,96.427],[160.431,95.79],[159.299,95.367],[157.895,94.991],[156.46,94.764],[155.012,94.688]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Shape_Box_id_0_copy_0 CENTER=106.872,107.537 POLYGON=[[94.59,95.262],[94.59,119.812],[119.14,119.812],[119.14,95.262],[94.59,95.262]]" - in definitions - ) + assert "DEFINE_OBJECT NAME=Shape_Cylinder_id_1_copy_0" in definitions + assert "DEFINE_OBJECT NAME=Shape_Box_id_0_copy_0" in definitions assert results.count(f"START_CURRENT_OBJECT NAME=Shape_Cylinder_id_1_copy_0") == 125 assert results.count(f"END_CURRENT_OBJECT NAME=Shape_Cylinder_id_1_copy_0") == 125 assert results.count(f"START_CURRENT_OBJECT NAME=Shape_Box_id_0_copy_0") == 125 assert results.count(f"END_CURRENT_OBJECT NAME=Shape_Box_id_0_copy_0") == 125 - - -def test_issue_2_retractions_included_in_bounding_boxes(): - with (gcode_path / "regressions" / "issue_2_retractions.gcode").open("r") as f: - results = "".join(list(preprocess_slicer(f))).split("\n") - - definitions = [r for r in results if r.startswith("DEFINE_OBJECT")] - - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_0_copy_0 CENTER=262.560,254.074 POLYGON=[[248.503,217.6],[247.62,218.483],[247.62,287.417],[248.503,288.3],[276.637,288.3],[277.52,287.417],[277.52,218.483],[276.637,217.6],[248.503,217.6]]" - not in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_17 CENTER=212.125,263.634 POLYGON=[[249.038,218.607],[176.523,248.78],[175.64,249.663],[175.64,277.797],[176.523,278.68],[245.457,278.68],[246.34,277.797],[249.038,218.607]]" - not in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_7 CENTER=212.092,232.556 POLYGON=[[176.523,217.6],[175.64,218.483],[175.64,246.617],[176.523,247.5],[217.858,270.087],[245.457,247.5],[246.34,246.617],[246.34,218.483],[245.457,217.6],[176.523,217.6]]" - not in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_3 CENTER=212.085,201.377 POLYGON=[[176.523,186.42],[175.64,187.303],[175.64,215.437],[176.523,216.32],[217.858,238.907],[245.457,216.32],[246.34,215.437],[246.34,187.303],[245.457,186.42],[176.523,186.42]]" - not in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_2 CENTER=212.085,170.197 POLYGON=[[176.523,155.24],[175.64,156.123],[175.64,184.257],[176.523,185.14],[217.858,207.727],[245.457,185.14],[246.34,184.257],[246.34,156.123],[245.457,155.24],[176.523,155.24]]" - not in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_5 CENTER=212.085,139.017 POLYGON=[[176.523,124.06],[175.64,124.943],[175.64,153.077],[176.523,153.96],[217.858,176.547],[245.457,153.96],[246.34,153.077],[246.34,124.943],[245.457,124.06],[176.523,124.06]]" - not in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_12 CENTER=212.085,107.837 POLYGON=[[176.523,92.88],[175.64,93.763],[175.64,121.897],[176.523,122.78],[217.858,145.367],[245.457,122.78],[246.34,121.897],[246.34,93.763],[245.457,92.88],[176.523,92.88]]" - not in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_21 CENTER=212.086,76.657 POLYGON=[[176.523,61.7],[175.64,62.583],[175.64,90.717],[176.523,91.6],[217.858,114.187],[245.457,91.6],[246.34,90.717],[246.34,62.583],[245.457,61.7],[176.523,61.7]]" - not in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_20 CENTER=139.930,76.676 POLYGON=[[104.543,61.7],[103.66,62.583],[103.66,90.717],[104.543,91.6],[173.477,91.6],[217.858,83.007],[173.477,61.7],[104.543,61.7]]" - not in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_13 CENTER=140.185,107.747 POLYGON=[[145.878,83.007],[104.543,92.88],[103.66,93.763],[103.66,121.897],[104.543,122.78],[173.477,122.78],[174.36,121.897],[174.36,93.763],[173.477,92.88],[145.878,83.007]]" - not in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_4 CENTER=140.185,138.927 POLYGON=[[145.878,114.187],[104.543,124.06],[103.66,124.943],[103.66,153.077],[104.543,153.96],[173.477,153.96],[174.36,153.077],[174.36,124.943],[173.477,124.06],[145.878,114.187]]" - not in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_0 CENTER=140.185,170.107 POLYGON=[[145.878,145.367],[104.543,155.24],[103.66,156.123],[103.66,184.257],[104.543,185.14],[173.477,185.14],[174.36,184.257],[174.36,156.123],[173.477,155.24],[145.878,145.367]]" - not in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_1 CENTER=140.185,201.287 POLYGON=[[145.878,176.547],[104.543,186.42],[103.66,187.303],[103.66,215.437],[104.543,216.32],[173.477,216.32],[174.36,215.437],[174.36,187.303],[173.477,186.42],[145.878,176.547]]" - not in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_6 CENTER=140.189,232.467 POLYGON=[[145.878,207.727],[104.543,217.6],[103.66,218.483],[103.66,246.617],[104.543,247.5],[173.477,247.5],[174.36,246.617],[174.36,218.483],[173.477,217.6],[145.878,207.727]]" - not in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_15 CENTER=140.183,263.647 POLYGON=[[145.878,238.907],[104.543,248.78],[103.66,249.663],[103.66,277.797],[104.543,278.68],[173.477,278.68],[174.36,277.797],[174.36,249.663],[173.477,248.78],[145.878,238.907]]" - not in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_16 CENTER=67.954,263.755 POLYGON=[[32.563,248.78],[31.68,249.663],[31.68,277.797],[32.563,278.68],[101.497,278.68],[145.878,270.087],[101.497,248.78],[32.563,248.78]]" - not in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_11 CENTER=68.132,232.556 POLYGON=[[32.563,217.6],[31.68,218.483],[31.68,246.617],[32.563,247.5],[73.898,270.087],[101.497,247.5],[102.38,246.617],[102.38,218.483],[101.497,217.6],[32.563,217.6]]" - not in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_9 CENTER=68.125,201.377 POLYGON=[[32.563,186.42],[31.68,187.303],[31.68,215.437],[32.563,216.32],[73.898,238.907],[101.497,216.32],[102.38,215.437],[102.38,187.303],[101.497,186.42],[32.563,186.42]]" - not in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_8 CENTER=68.125,170.197 POLYGON=[[32.563,155.24],[31.68,156.123],[31.68,184.257],[32.563,185.14],[73.898,207.727],[101.497,185.14],[102.38,184.257],[102.38,156.123],[101.497,155.24],[32.563,155.24]]" - not in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_10 CENTER=68.125,139.017 POLYGON=[[32.563,124.06],[31.68,124.943],[31.68,153.077],[32.563,153.96],[73.898,176.547],[101.497,153.96],[102.38,153.077],[102.38,124.943],[101.497,124.06],[32.563,124.06]]" - not in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_14 CENTER=68.124,107.836 POLYGON=[[32.563,92.88],[31.68,93.763],[31.68,121.897],[32.563,122.78],[73.898,145.367],[101.497,122.78],[102.38,121.897],[102.38,93.763],[101.497,92.88],[32.563,92.88]]" - not in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_22 CENTER=284.066,138.959 POLYGON=[[73.898,114.187],[248.503,153.96],[317.437,153.96],[318.32,153.077],[318.32,124.943],[317.437,124.06],[73.898,114.187]]" - not in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_18 CENTER=284.145,170.107 POLYGON=[[289.838,145.367],[248.503,155.24],[247.62,156.123],[247.62,184.257],[248.503,185.14],[317.437,185.14],[318.32,184.257],[318.32,156.123],[317.437,155.24],[289.838,145.367]]" - not in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_19 CENTER=283.965,201.251 POLYGON=[[289.838,176.547],[248.503,186.42],[247.62,187.303],[247.62,215.437],[248.503,216.32],[317.437,216.32],[318.32,215.437],[318.32,187.303],[317.437,186.42],[289.838,176.547]]" - not in definitions - ) - - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_0_copy_0 CENTER=262.533,254.031 POLYGON=[[248.503,217.6],[247.62,218.483],[247.62,287.417],[248.503,288.3],[276.637,288.3],[277.52,287.417],[277.52,218.483],[276.637,217.6],[248.503,217.6]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_17 CENTER=212.040,263.680 POLYGON=[[176.523,248.78],[175.64,249.663],[175.64,277.797],[176.523,278.68],[245.457,278.68],[246.34,277.797],[246.34,249.663],[245.457,248.78],[176.523,248.78]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_7 CENTER=212.091,232.531 POLYGON=[[176.523,217.6],[175.64,218.483],[175.64,246.617],[176.523,247.5],[245.457,247.5],[246.34,246.617],[246.34,218.483],[245.457,217.6],[176.523,217.6]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_3 CENTER=212.087,201.352 POLYGON=[[176.523,186.42],[175.64,187.303],[175.64,215.437],[176.523,216.32],[245.457,216.32],[246.34,215.437],[246.34,187.303],[245.457,186.42],[176.523,186.42]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_2 CENTER=212.087,170.172 POLYGON=[[176.523,155.24],[175.64,156.123],[175.64,184.257],[176.523,185.14],[245.457,185.14],[246.34,184.257],[246.34,156.123],[245.457,155.24],[176.523,155.24]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_5 CENTER=212.087,138.992 POLYGON=[[176.523,124.06],[175.64,124.943],[175.64,153.077],[176.523,153.96],[245.457,153.96],[246.34,153.077],[246.34,124.943],[245.457,124.06],[176.523,124.06]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_12 CENTER=212.087,107.812 POLYGON=[[176.523,92.88],[175.64,93.763],[175.64,121.897],[176.523,122.78],[245.457,122.78],[246.34,121.897],[246.34,93.763],[245.457,92.88],[176.523,92.88]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_21 CENTER=212.087,76.632 POLYGON=[[176.523,61.7],[175.64,62.583],[175.64,90.717],[176.523,91.6],[245.457,91.6],[246.34,90.717],[246.34,62.583],[245.457,61.7],[176.523,61.7]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_20 CENTER=139.931,76.673 POLYGON=[[104.543,61.7],[103.66,62.583],[103.66,90.717],[104.543,91.6],[173.477,91.6],[174.36,90.717],[174.36,62.583],[173.477,61.7],[104.543,61.7]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_13 CENTER=140.090,107.793 POLYGON=[[104.543,92.88],[103.66,93.763],[103.66,121.897],[104.543,122.78],[173.477,122.78],[174.36,121.897],[174.36,93.763],[173.477,92.88],[104.543,92.88]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_4 CENTER=140.090,138.973 POLYGON=[[104.543,124.06],[103.66,124.943],[103.66,153.077],[104.543,153.96],[173.477,153.96],[174.36,153.077],[174.36,124.943],[173.477,124.06],[104.543,124.06]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_0 CENTER=140.090,170.153 POLYGON=[[104.543,155.24],[103.66,156.123],[103.66,184.257],[104.543,185.14],[173.477,185.14],[174.36,184.257],[174.36,156.123],[173.477,155.24],[104.543,155.24]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_1 CENTER=140.090,201.333 POLYGON=[[104.543,186.42],[103.66,187.303],[103.66,215.437],[104.543,216.32],[173.477,216.32],[174.36,215.437],[174.36,187.303],[173.477,186.42],[104.543,186.42]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_6 CENTER=140.094,232.512 POLYGON=[[104.543,217.6],[103.66,218.483],[103.66,246.617],[104.543,247.5],[173.477,247.5],[174.36,246.617],[174.36,218.483],[173.477,217.6],[104.543,217.6]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_15 CENTER=140.088,263.692 POLYGON=[[104.543,248.78],[103.66,249.663],[103.66,277.797],[104.543,278.68],[173.477,278.68],[174.36,277.797],[174.36,249.663],[173.477,248.78],[104.543,248.78]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_16 CENTER=67.953,263.754 POLYGON=[[32.563,248.78],[31.68,249.663],[31.68,277.797],[32.563,278.68],[101.497,278.68],[102.38,277.797],[102.38,249.663],[101.497,248.78],[32.563,248.78]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_11 CENTER=68.131,232.531 POLYGON=[[32.563,217.6],[31.68,218.483],[31.68,246.617],[32.563,247.5],[101.497,247.5],[102.38,246.617],[102.38,218.483],[101.497,217.6],[32.563,217.6]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_9 CENTER=68.127,201.352 POLYGON=[[32.563,186.42],[31.68,187.303],[31.68,215.437],[32.563,216.32],[101.497,216.32],[102.38,215.437],[102.38,187.303],[101.497,186.42],[32.563,186.42]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_8 CENTER=68.127,170.172 POLYGON=[[32.563,155.24],[31.68,156.123],[31.68,184.257],[32.563,185.14],[101.497,185.14],[102.38,184.257],[102.38,156.123],[101.497,155.24],[32.563,155.24]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_10 CENTER=68.127,138.992 POLYGON=[[32.563,124.06],[31.68,124.943],[31.68,153.077],[32.563,153.96],[101.497,153.96],[102.38,153.077],[102.38,124.943],[101.497,124.06],[32.563,124.06]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_14 CENTER=68.125,107.811 POLYGON=[[32.563,92.88],[31.68,93.763],[31.68,121.897],[32.563,122.78],[101.497,122.78],[102.38,121.897],[102.38,93.763],[101.497,92.88],[32.563,92.88]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_22 CENTER=284.031,138.961 POLYGON=[[248.503,124.06],[247.62,124.943],[247.62,153.077],[248.503,153.96],[317.437,153.96],[318.32,153.077],[318.32,124.943],[317.437,124.06],[248.503,124.06]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_18 CENTER=284.050,170.153 POLYGON=[[248.503,155.24],[247.62,156.123],[247.62,184.257],[248.503,185.14],[317.437,185.14],[318.32,184.257],[318.32,156.123],[317.437,155.24],[248.503,155.24]]" - in definitions - ) - assert ( - "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_19 CENTER=284.050,201.329 POLYGON=[[248.503,186.42],[247.62,187.303],[247.62,215.437],[248.503,216.32],[317.437,216.32],[318.32,215.437],[318.32,187.303],[317.437,186.42],[248.503,186.42]]" - in definitions - ) diff --git a/test_preprocessor_with_shapely.py b/test_preprocessor_with_shapely.py new file mode 100644 index 0000000..7dcf707 --- /dev/null +++ b/test_preprocessor_with_shapely.py @@ -0,0 +1,464 @@ +import re +import pathlib +import subprocess +import sys + +import pytest + +from preprocess_cancellation import preprocess_cura, preprocess_ideamaker, preprocess_m486, preprocess_slicer + +try: + import shapely +except ImportError: + pytest.skip("Requires shapely installed", allow_module_level=True) + +from test_preprocessor import collect_definitions +gcode_path = pathlib.Path("./GCode") + + +def test_cli(): + """ + Ensure the preprocesor does not crash + """ + try: + command = [ + sys.executable, + "./preprocess_cancellation.py", + "-o", + ".testing", + *gcode_path.glob("*.gcode"), + ] + with subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as proc: + proc.wait() + assert proc.returncode == 0 + finally: + for testing_file in gcode_path.glob("*.testing.gcode"): + testing_file.unlink() + + +def test_m486(): + with (gcode_path / "m486.gcode").open("r") as f: + results = "".join(list(preprocess_m486(f))).split("\n") + + definitions = collect_definitions(results) + + assert ( + "DEFINE_OBJECT NAME=0 CENTER=160.285,148.625 POLYGON=[[160.513,146.681],[160.268,146.693],[159.931,146.769],[158.514,147.252],[158.179,148.01],[158.103,148.462],[158.127,148.938],[158.245,149.4],[158.392,149.726],[159.679,150.294],[160.055,150.429],[160.475,150.479],[161.126,150.446],[161.461,150.301],[161.846,149.914],[162.077,149.631],[162.233,149.348],[162.342,149.02],[162.392,148.641],[162.371,148.283],[162.222,147.623],[161.633,147.062],[161.313,146.869],[161.128,146.798],[160.938,146.734],[160.513,146.681]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=1 CENTER=150.497,155.524 POLYGON=[[148.11,153.105],[148.11,157.895],[152.9,157.895],[152.84,153.105],[148.11,153.105]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=2 CENTER=139.563,155.504 POLYGON=[[137.11,153.105],[137.11,157.895],[141.9,157.895],[141.9,153.105],[137.11,153.105]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=3 CENTER=144.533,144.510 POLYGON=[[137.11,142.105],[137.11,146.895],[151.9,146.895],[151.9,142.105],[137.11,142.105]]" + in definitions + ) + + assert results.count(f"START_CURRENT_OBJECT NAME=0") == 25 + assert results.count(f"END_CURRENT_OBJECT NAME=0") == 25 + + assert results.count(f"START_CURRENT_OBJECT NAME=1") == 25 + assert results.count(f"END_CURRENT_OBJECT NAME=1") == 25 + + assert results.count(f"START_CURRENT_OBJECT NAME=2") == 25 + assert results.count(f"END_CURRENT_OBJECT NAME=2") == 25 + + assert results.count(f"START_CURRENT_OBJECT NAME=3") == 25 + assert results.count(f"END_CURRENT_OBJECT NAME=3") == 25 + + +def test_superslicer(): + with (gcode_path / "superslicer.gcode").open("r") as f: + results = "".join(list(preprocess_slicer(f))).split("\n") + + definitions = collect_definitions(results) + + assert ( + "DEFINE_OBJECT NAME=cube_1_id_0_copy_0 CENTER=150.515,155.476 POLYGON=[[148.215,153.21],[148.215,157.79],[152.795,157.79],[152.735,153.21],[148.215,153.21]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=cube_1_id_0_copy_1 CENTER=139.578,155.479 POLYGON=[[137.215,153.21],[137.215,157.79],[141.795,157.79],[141.795,153.21],[137.215,153.21]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=union_3_id_2_copy_0 CENTER=144.198,144.526 POLYGON=[[137.215,142.21],[137.215,146.79],[151.795,146.79],[151.795,142.21],[137.215,142.21]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=cylinder_2_id_1_copy_0 CENTER=160.152,148.483 POLYGON=[[160.207,146.625],[159.764,146.745],[159.4,146.942],[158.346,147.789],[158.23,148.24],[158.205,148.581],[158.567,149.29],[158.862,149.692],[159.422,150.245],[159.661,150.425],[160.384,150.734],[161.201,150.427],[161.569,150.234],[161.88,149.983],[162.134,149.676],[162.327,149.307],[162.448,148.866],[162.447,147.931],[162.117,147.477],[161.561,146.927],[161.243,146.695],[160.207,146.625]]" + in definitions + ) + + +def test_prusaslicer(): + with (gcode_path / "prusaslicer.gcode").open("r") as f: + results = "".join(list(preprocess_slicer(f))).split("\n") + + definitions = collect_definitions(results) + + assert ( + "DEFINE_OBJECT NAME=cylinder_2_id_1_copy_0 CENTER=160.285,148.625 POLYGON=[[160.513,146.681],[160.268,146.693],[159.931,146.769],[158.514,147.252],[158.179,148.01],[158.103,148.462],[158.127,148.938],[158.245,149.4],[158.392,149.726],[159.679,150.294],[160.055,150.429],[160.475,150.479],[161.126,150.446],[161.461,150.301],[161.846,149.914],[162.077,149.631],[162.233,149.348],[162.342,149.02],[162.392,148.641],[162.371,148.283],[162.222,147.623],[161.633,147.062],[161.313,146.869],[161.128,146.798],[160.938,146.734],[160.513,146.681]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=cube_1_id_0_copy_0 CENTER=150.497,155.524 POLYGON=[[148.11,153.105],[148.11,157.895],[152.9,157.895],[152.84,153.105],[148.11,153.105]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=cube_1_id_0_copy_1 CENTER=139.563,155.504 POLYGON=[[137.11,153.105],[137.11,157.895],[141.9,157.895],[141.9,153.105],[137.11,153.105]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=union_3_id_2_copy_0 CENTER=144.533,144.510 POLYGON=[[137.11,142.105],[137.11,146.895],[151.9,146.895],[151.9,142.105],[137.11,142.105]]" + in definitions + ) + + assert results.count(f"START_CURRENT_OBJECT NAME=cylinder_2_id_1_copy_0") == 25 + assert results.count(f"END_CURRENT_OBJECT NAME=cylinder_2_id_1_copy_0") == 25 + + assert results.count(f"START_CURRENT_OBJECT NAME=cube_1_id_0_copy_0") == 25 + assert results.count(f"END_CURRENT_OBJECT NAME=cube_1_id_0_copy_0") == 25 + + assert results.count(f"START_CURRENT_OBJECT NAME=cube_1_id_0_copy_1") == 25 + assert results.count(f"END_CURRENT_OBJECT NAME=cube_1_id_0_copy_1") == 25 + + assert results.count(f"START_CURRENT_OBJECT NAME=union_3_id_2_copy_0") == 25 + assert results.count(f"END_CURRENT_OBJECT NAME=union_3_id_2_copy_0") == 25 + + +def test_slic3r(): + with (gcode_path / "slic3r.gcode").open("r") as f: + results = "".join(list(preprocess_slicer(f))).split("\n") + + definitions = collect_definitions(results) + + assert ( + "DEFINE_OBJECT NAME=cube_1_stl_id_0_copy_0 CENTER=99.963,83.531 POLYGON=[[97.72,81.22],[97.72,85.78],[102.28,85.72],[102.28,81.22],[97.72,81.22]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=cube_1_stl_id_0_copy_1 CENTER=99.963,116.531 POLYGON=[[97.72,114.22],[97.72,118.78],[102.28,118.72],[102.28,114.22],[97.72,114.22]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=cylinder_2_stl_id_1_copy_0 CENTER=99.962,94.515 POLYGON=[[100.17,92.227],[99.717,92.239],[99.271,92.34],[98.963,92.471],[98.579,92.718],[98.254,93.035],[97.999,93.41],[97.822,93.828],[97.732,94.273],[97.732,94.727],[97.822,95.172],[97.999,95.59],[98.254,95.965],[98.579,96.282],[98.96,96.528],[99.383,96.694],[99.83,96.773],[100.283,96.761],[100.726,96.66],[101.139,96.474],[101.51,96.207],[101.744,95.967],[102.001,95.59],[102.178,95.172],[102.268,94.727],[102.268,94.273],[102.178,93.828],[102.001,93.41],[101.746,93.035],[101.421,92.718],[101.04,92.472],[100.617,92.306],[100.17,92.227]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=union_3_stl_id_2_copy_0 CENTER=99.894,105.502 POLYGON=[[92.72,103.22],[92.72,107.78],[107.28,107.78],[107.28,103.22],[92.72,103.22]]" + in definitions + ) + + assert results.count(f"START_CURRENT_OBJECT NAME=cube_1_stl_id_0_copy_0") == 16 + assert results.count(f"END_CURRENT_OBJECT NAME=cube_1_stl_id_0_copy_0") == 16 + + assert results.count(f"START_CURRENT_OBJECT NAME=cube_1_stl_id_0_copy_1") == 16 + assert results.count(f"END_CURRENT_OBJECT NAME=cube_1_stl_id_0_copy_1") == 16 + + assert results.count(f"START_CURRENT_OBJECT NAME=cylinder_2_stl_id_1_copy_0") == 16 + assert results.count(f"END_CURRENT_OBJECT NAME=cylinder_2_stl_id_1_copy_0") == 16 + + assert results.count(f"START_CURRENT_OBJECT NAME=union_3_stl_id_2_copy_0") == 16 + assert results.count(f"END_CURRENT_OBJECT NAME=union_3_stl_id_2_copy_0") == 16 + + +def test_cura(): + with (gcode_path / "cura.gcode").open("r") as f: + results = "".join(list(preprocess_cura(f))).split("\n") + + definitions = collect_definitions(results) + + assert ( + "DEFINE_OBJECT NAME=cylinder_2_stl CENTER=143.465,143.521 POLYGON=[[143.448,141.201],[142.992,141.257],[142.559,141.401],[142.182,141.615],[141.888,141.858],[141.597,142.207],[141.379,142.608],[141.245,143.047],[141.2,143.507],[141.24,143.926],[141.379,144.392],[141.588,144.779],[141.898,145.151],[142.247,145.429],[142.664,145.643],[143.095,145.764],[143.552,145.799],[144.009,145.743],[144.441,145.599],[144.845,145.366],[145.166,145.086],[145.402,144.794],[145.623,144.387],[145.755,143.953],[145.8,143.494],[145.753,143.038],[145.623,142.613],[145.409,142.216],[145.101,141.848],[144.753,141.571],[144.36,141.367],[143.905,141.236],[143.448,141.201]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=cube_1_stl CENTER=150.006,143.497 POLYGON=[[147.7,141.2],[147.7,145.8],[152.3,145.8],[152.3,141.2],[147.7,141.2]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=union_3_stl CENTER=149.838,150.082 POLYGON=[[142.7,147.7],[142.7,152.3],[157.3,152.3],[157.3,147.7],[142.7,147.7]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=cube_1_stl_1 CENTER=150.038,151.520 POLYGON=[[150.719,147.305],[150.569,147.309],[148.861,148.051],[148.4,148.513],[147.7,154.17],[147.7,158.77],[152.3,158.77],[152.3,154.17],[151.494,148.693],[151.255,147.686],[150.719,147.305]]" + in definitions + ) + + assert results.count(f"START_CURRENT_OBJECT NAME=cylinder_2_stl") == 25 + assert results.count(f"END_CURRENT_OBJECT NAME=cylinder_2_stl") == 25 + + assert results.count(f"START_CURRENT_OBJECT NAME=cube_1_stl") == 25 + assert results.count(f"END_CURRENT_OBJECT NAME=cube_1_stl") == 25 + + assert results.count(f"START_CURRENT_OBJECT NAME=union_3_stl") == 25 + assert results.count(f"END_CURRENT_OBJECT NAME=union_3_stl") == 25 + + assert results.count(f"START_CURRENT_OBJECT NAME=cube_1_stl_1") == 25 + assert results.count(f"END_CURRENT_OBJECT NAME=cube_1_stl_1") == 25 + + +def test_ideamaker(): + with (gcode_path / "ideamaker.gcode").open("r") as f: + results = "".join(list(preprocess_ideamaker(f))).split("\n") + + definitions = collect_definitions(results) + + print(definitions) + assert ( + "DEFINE_OBJECT NAME=test_bed_part1_3mf CENTER=112.037,102.475 POLYGON=[[111.998,100.194],[111.545,100.239],[111.107,100.375],[110.705,100.594],[110.356,100.887],[110.068,101.248],[109.878,101.611],[109.755,101.998],[109.701,102.49],[109.735,102.901],[109.859,103.343],[110.068,103.752],[110.35,104.107],[110.709,104.409],[111.107,104.625],[111.544,104.761],[112.002,104.806],[112.455,104.761],[112.893,104.625],[113.295,104.406],[113.644,104.113],[113.918,103.773],[114.109,103.421],[114.244,103.005],[114.299,102.51],[114.265,102.099],[114.141,101.657],[113.932,101.248],[113.65,100.893],[113.298,100.596],[112.893,100.375],[112.47,100.242],[111.998,100.194]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=test_bed_part2_3mf CENTER=89.368,102.544 POLYGON=[[81.701,100.194],[81.701,104.806],[96.301,104.806],[96.301,100.194],[81.701,100.194]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=test_bed_part0_3mf CENTER=102.996,102.460 POLYGON=[[100.701,100.194],[100.701,104.806],[105.301,104.806],[105.301,100.194],[100.701,100.194]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=test_bed_part0_1_3mf CENTER=121.037,102.446 POLYGON=[[118.699,100.194],[118.699,104.806],[123.299,104.806],[123.299,100.194],[118.699,100.194]]" + in definitions + ) + + assert results.count("START_CURRENT_OBJECT NAME=test_bed_part1_3mf") == 32 + assert results.count("END_CURRENT_OBJECT NAME=test_bed_part1_3mf") == 32 + + assert results.count("START_CURRENT_OBJECT NAME=test_bed_part2_3mf") == 32 + assert results.count("END_CURRENT_OBJECT NAME=test_bed_part2_3mf") == 32 + + assert results.count("START_CURRENT_OBJECT NAME=test_bed_part0_3mf") == 33 + assert results.count("END_CURRENT_OBJECT NAME=test_bed_part0_3mf") == 33 + + assert results.count("START_CURRENT_OBJECT NAME=test_bed_part0_1_3mf") == 33 + assert results.count("END_CURRENT_OBJECT NAME=test_bed_part0_1_3mf") == 33 + + +def test_issue_1_prusaslicer_point_collection(): + with (gcode_path / "prusaslicer-issue1.gcode").open("r") as f: + results = "".join(list(preprocess_slicer(f))).split("\n") + + definitions = collect_definitions(results) + + assert ( + "DEFINE_OBJECT NAME=Shape_Cylinder_id_1_copy_0 CENTER=154.928,108.320 POLYGON=[[155.012,94.688],[153.801,94.741],[152.362,94.943],[151.141,95.238],[149.812,95.698],[148.495,96.312],[147.318,97.015],[146.278,97.78],[145.199,98.752],[144.247,99.806],[143.437,100.909],[142.759,102.049],[142.145,103.365],[141.675,104.728],[141.39,105.914],[141.189,107.337],[141.135,108.562],[141.202,109.923],[141.39,111.211],[141.672,112.387],[142.145,113.761],[142.759,115.077],[143.468,116.263],[144.227,117.295],[145.199,118.374],[146.273,119.342],[147.251,120.066],[148.496,120.814],[149.774,121.412],[151.106,121.877],[152.362,122.183],[153.787,122.384],[155.009,122.438],[156.409,122.367],[157.658,122.183],[158.999,121.852],[160.208,121.427],[161.524,120.814],[162.707,120.107],[163.742,119.346],[164.821,118.374],[165.742,117.357],[166.513,116.322],[167.261,115.077],[167.863,113.79],[168.321,112.478],[168.63,111.211],[168.827,109.831],[168.885,108.564],[168.818,107.202],[168.63,105.914],[168.348,104.738],[167.875,103.365],[167.261,102.048],[166.548,100.856],[165.793,99.831],[164.821,98.752],[163.744,97.781],[162.77,97.06],[161.737,96.427],[160.431,95.79],[159.299,95.367],[157.895,94.991],[156.46,94.764],[155.012,94.688]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Shape_Box_id_0_copy_0 CENTER=106.872,107.537 POLYGON=[[94.59,95.262],[94.59,119.812],[119.14,119.812],[119.14,95.262],[94.59,95.262]]" + in definitions + ) + + assert results.count(f"START_CURRENT_OBJECT NAME=Shape_Cylinder_id_1_copy_0") == 125 + assert results.count(f"END_CURRENT_OBJECT NAME=Shape_Cylinder_id_1_copy_0") == 125 + + assert results.count(f"START_CURRENT_OBJECT NAME=Shape_Box_id_0_copy_0") == 125 + assert results.count(f"END_CURRENT_OBJECT NAME=Shape_Box_id_0_copy_0") == 125 + + +def test_issue_2_retractions_included_in_bounding_boxes(): + with (gcode_path / "regressions" / "issue_2_retractions.gcode").open("r") as f: + results = "".join(list(preprocess_slicer(f))).split("\n") + + definitions = collect_definitions(results) + + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_0_copy_0 CENTER=262.560,254.074 POLYGON=[[248.503,217.6],[247.62,218.483],[247.62,287.417],[248.503,288.3],[276.637,288.3],[277.52,287.417],[277.52,218.483],[276.637,217.6],[248.503,217.6]]" + not in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_17 CENTER=212.125,263.634 POLYGON=[[249.038,218.607],[176.523,248.78],[175.64,249.663],[175.64,277.797],[176.523,278.68],[245.457,278.68],[246.34,277.797],[249.038,218.607]]" + not in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_7 CENTER=212.092,232.556 POLYGON=[[176.523,217.6],[175.64,218.483],[175.64,246.617],[176.523,247.5],[217.858,270.087],[245.457,247.5],[246.34,246.617],[246.34,218.483],[245.457,217.6],[176.523,217.6]]" + not in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_3 CENTER=212.085,201.377 POLYGON=[[176.523,186.42],[175.64,187.303],[175.64,215.437],[176.523,216.32],[217.858,238.907],[245.457,216.32],[246.34,215.437],[246.34,187.303],[245.457,186.42],[176.523,186.42]]" + not in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_2 CENTER=212.085,170.197 POLYGON=[[176.523,155.24],[175.64,156.123],[175.64,184.257],[176.523,185.14],[217.858,207.727],[245.457,185.14],[246.34,184.257],[246.34,156.123],[245.457,155.24],[176.523,155.24]]" + not in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_5 CENTER=212.085,139.017 POLYGON=[[176.523,124.06],[175.64,124.943],[175.64,153.077],[176.523,153.96],[217.858,176.547],[245.457,153.96],[246.34,153.077],[246.34,124.943],[245.457,124.06],[176.523,124.06]]" + not in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_12 CENTER=212.085,107.837 POLYGON=[[176.523,92.88],[175.64,93.763],[175.64,121.897],[176.523,122.78],[217.858,145.367],[245.457,122.78],[246.34,121.897],[246.34,93.763],[245.457,92.88],[176.523,92.88]]" + not in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_21 CENTER=212.086,76.657 POLYGON=[[176.523,61.7],[175.64,62.583],[175.64,90.717],[176.523,91.6],[217.858,114.187],[245.457,91.6],[246.34,90.717],[246.34,62.583],[245.457,61.7],[176.523,61.7]]" + not in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_20 CENTER=139.930,76.676 POLYGON=[[104.543,61.7],[103.66,62.583],[103.66,90.717],[104.543,91.6],[173.477,91.6],[217.858,83.007],[173.477,61.7],[104.543,61.7]]" + not in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_13 CENTER=140.185,107.747 POLYGON=[[145.878,83.007],[104.543,92.88],[103.66,93.763],[103.66,121.897],[104.543,122.78],[173.477,122.78],[174.36,121.897],[174.36,93.763],[173.477,92.88],[145.878,83.007]]" + not in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_4 CENTER=140.185,138.927 POLYGON=[[145.878,114.187],[104.543,124.06],[103.66,124.943],[103.66,153.077],[104.543,153.96],[173.477,153.96],[174.36,153.077],[174.36,124.943],[173.477,124.06],[145.878,114.187]]" + not in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_0 CENTER=140.185,170.107 POLYGON=[[145.878,145.367],[104.543,155.24],[103.66,156.123],[103.66,184.257],[104.543,185.14],[173.477,185.14],[174.36,184.257],[174.36,156.123],[173.477,155.24],[145.878,145.367]]" + not in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_1 CENTER=140.185,201.287 POLYGON=[[145.878,176.547],[104.543,186.42],[103.66,187.303],[103.66,215.437],[104.543,216.32],[173.477,216.32],[174.36,215.437],[174.36,187.303],[173.477,186.42],[145.878,176.547]]" + not in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_6 CENTER=140.189,232.467 POLYGON=[[145.878,207.727],[104.543,217.6],[103.66,218.483],[103.66,246.617],[104.543,247.5],[173.477,247.5],[174.36,246.617],[174.36,218.483],[173.477,217.6],[145.878,207.727]]" + not in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_15 CENTER=140.183,263.647 POLYGON=[[145.878,238.907],[104.543,248.78],[103.66,249.663],[103.66,277.797],[104.543,278.68],[173.477,278.68],[174.36,277.797],[174.36,249.663],[173.477,248.78],[145.878,238.907]]" + not in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_16 CENTER=67.954,263.755 POLYGON=[[32.563,248.78],[31.68,249.663],[31.68,277.797],[32.563,278.68],[101.497,278.68],[145.878,270.087],[101.497,248.78],[32.563,248.78]]" + not in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_11 CENTER=68.132,232.556 POLYGON=[[32.563,217.6],[31.68,218.483],[31.68,246.617],[32.563,247.5],[73.898,270.087],[101.497,247.5],[102.38,246.617],[102.38,218.483],[101.497,217.6],[32.563,217.6]]" + not in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_9 CENTER=68.125,201.377 POLYGON=[[32.563,186.42],[31.68,187.303],[31.68,215.437],[32.563,216.32],[73.898,238.907],[101.497,216.32],[102.38,215.437],[102.38,187.303],[101.497,186.42],[32.563,186.42]]" + not in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_8 CENTER=68.125,170.197 POLYGON=[[32.563,155.24],[31.68,156.123],[31.68,184.257],[32.563,185.14],[73.898,207.727],[101.497,185.14],[102.38,184.257],[102.38,156.123],[101.497,155.24],[32.563,155.24]]" + not in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_10 CENTER=68.125,139.017 POLYGON=[[32.563,124.06],[31.68,124.943],[31.68,153.077],[32.563,153.96],[73.898,176.547],[101.497,153.96],[102.38,153.077],[102.38,124.943],[101.497,124.06],[32.563,124.06]]" + not in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_14 CENTER=68.124,107.836 POLYGON=[[32.563,92.88],[31.68,93.763],[31.68,121.897],[32.563,122.78],[73.898,145.367],[101.497,122.78],[102.38,121.897],[102.38,93.763],[101.497,92.88],[32.563,92.88]]" + not in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_22 CENTER=284.066,138.959 POLYGON=[[73.898,114.187],[248.503,153.96],[317.437,153.96],[318.32,153.077],[318.32,124.943],[317.437,124.06],[73.898,114.187]]" + not in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_18 CENTER=284.145,170.107 POLYGON=[[289.838,145.367],[248.503,155.24],[247.62,156.123],[247.62,184.257],[248.503,185.14],[317.437,185.14],[318.32,184.257],[318.32,156.123],[317.437,155.24],[289.838,145.367]]" + not in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_19 CENTER=283.965,201.251 POLYGON=[[289.838,176.547],[248.503,186.42],[247.62,187.303],[247.62,215.437],[248.503,216.32],[317.437,216.32],[318.32,215.437],[318.32,187.303],[317.437,186.42],[289.838,176.547]]" + not in definitions + ) + + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_0_copy_0 CENTER=262.533,254.031 POLYGON=[[248.503,217.6],[247.62,218.483],[247.62,287.417],[248.503,288.3],[276.637,288.3],[277.52,287.417],[277.52,218.483],[276.637,217.6],[248.503,217.6]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_17 CENTER=212.040,263.680 POLYGON=[[176.523,248.78],[175.64,249.663],[175.64,277.797],[176.523,278.68],[245.457,278.68],[246.34,277.797],[246.34,249.663],[245.457,248.78],[176.523,248.78]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_7 CENTER=212.091,232.531 POLYGON=[[176.523,217.6],[175.64,218.483],[175.64,246.617],[176.523,247.5],[245.457,247.5],[246.34,246.617],[246.34,218.483],[245.457,217.6],[176.523,217.6]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_3 CENTER=212.087,201.352 POLYGON=[[176.523,186.42],[175.64,187.303],[175.64,215.437],[176.523,216.32],[245.457,216.32],[246.34,215.437],[246.34,187.303],[245.457,186.42],[176.523,186.42]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_2 CENTER=212.087,170.172 POLYGON=[[176.523,155.24],[175.64,156.123],[175.64,184.257],[176.523,185.14],[245.457,185.14],[246.34,184.257],[246.34,156.123],[245.457,155.24],[176.523,155.24]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_5 CENTER=212.087,138.992 POLYGON=[[176.523,124.06],[175.64,124.943],[175.64,153.077],[176.523,153.96],[245.457,153.96],[246.34,153.077],[246.34,124.943],[245.457,124.06],[176.523,124.06]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_12 CENTER=212.087,107.812 POLYGON=[[176.523,92.88],[175.64,93.763],[175.64,121.897],[176.523,122.78],[245.457,122.78],[246.34,121.897],[246.34,93.763],[245.457,92.88],[176.523,92.88]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_21 CENTER=212.087,76.632 POLYGON=[[176.523,61.7],[175.64,62.583],[175.64,90.717],[176.523,91.6],[245.457,91.6],[246.34,90.717],[246.34,62.583],[245.457,61.7],[176.523,61.7]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_20 CENTER=139.931,76.673 POLYGON=[[104.543,61.7],[103.66,62.583],[103.66,90.717],[104.543,91.6],[173.477,91.6],[174.36,90.717],[174.36,62.583],[173.477,61.7],[104.543,61.7]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_13 CENTER=140.090,107.793 POLYGON=[[104.543,92.88],[103.66,93.763],[103.66,121.897],[104.543,122.78],[173.477,122.78],[174.36,121.897],[174.36,93.763],[173.477,92.88],[104.543,92.88]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_4 CENTER=140.090,138.973 POLYGON=[[104.543,124.06],[103.66,124.943],[103.66,153.077],[104.543,153.96],[173.477,153.96],[174.36,153.077],[174.36,124.943],[173.477,124.06],[104.543,124.06]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_0 CENTER=140.090,170.153 POLYGON=[[104.543,155.24],[103.66,156.123],[103.66,184.257],[104.543,185.14],[173.477,185.14],[174.36,184.257],[174.36,156.123],[173.477,155.24],[104.543,155.24]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_1 CENTER=140.090,201.333 POLYGON=[[104.543,186.42],[103.66,187.303],[103.66,215.437],[104.543,216.32],[173.477,216.32],[174.36,215.437],[174.36,187.303],[173.477,186.42],[104.543,186.42]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_6 CENTER=140.094,232.512 POLYGON=[[104.543,217.6],[103.66,218.483],[103.66,246.617],[104.543,247.5],[173.477,247.5],[174.36,246.617],[174.36,218.483],[173.477,217.6],[104.543,217.6]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_15 CENTER=140.088,263.692 POLYGON=[[104.543,248.78],[103.66,249.663],[103.66,277.797],[104.543,278.68],[173.477,278.68],[174.36,277.797],[174.36,249.663],[173.477,248.78],[104.543,248.78]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_16 CENTER=67.953,263.754 POLYGON=[[32.563,248.78],[31.68,249.663],[31.68,277.797],[32.563,278.68],[101.497,278.68],[102.38,277.797],[102.38,249.663],[101.497,248.78],[32.563,248.78]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_11 CENTER=68.131,232.531 POLYGON=[[32.563,217.6],[31.68,218.483],[31.68,246.617],[32.563,247.5],[101.497,247.5],[102.38,246.617],[102.38,218.483],[101.497,217.6],[32.563,217.6]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_9 CENTER=68.127,201.352 POLYGON=[[32.563,186.42],[31.68,187.303],[31.68,215.437],[32.563,216.32],[101.497,216.32],[102.38,215.437],[102.38,187.303],[101.497,186.42],[32.563,186.42]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_8 CENTER=68.127,170.172 POLYGON=[[32.563,155.24],[31.68,156.123],[31.68,184.257],[32.563,185.14],[101.497,185.14],[102.38,184.257],[102.38,156.123],[101.497,155.24],[32.563,155.24]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_10 CENTER=68.127,138.992 POLYGON=[[32.563,124.06],[31.68,124.943],[31.68,153.077],[32.563,153.96],[101.497,153.96],[102.38,153.077],[102.38,124.943],[101.497,124.06],[32.563,124.06]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_14 CENTER=68.125,107.811 POLYGON=[[32.563,92.88],[31.68,93.763],[31.68,121.897],[32.563,122.78],[101.497,122.78],[102.38,121.897],[102.38,93.763],[101.497,92.88],[32.563,92.88]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_22 CENTER=284.031,138.961 POLYGON=[[248.503,124.06],[247.62,124.943],[247.62,153.077],[248.503,153.96],[317.437,153.96],[318.32,153.077],[318.32,124.943],[317.437,124.06],[248.503,124.06]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_18 CENTER=284.050,170.153 POLYGON=[[248.503,155.24],[247.62,156.123],[247.62,184.257],[248.503,185.14],[317.437,185.14],[318.32,184.257],[318.32,156.123],[317.437,155.24],[248.503,155.24]]" + in definitions + ) + assert ( + "DEFINE_OBJECT NAME=Leaf_stl_id_1_copy_19 CENTER=284.050,201.329 POLYGON=[[248.503,186.42],[247.62,187.303],[247.62,215.437],[248.503,216.32],[317.437,216.32],[318.32,215.437],[318.32,187.303],[317.437,186.42],[248.503,186.42]]" + in definitions + ) diff --git a/tools/plot_defines.py b/tools/plot_defines.py index 5a2edc6..ff5b1bb 100644 --- a/tools/plot_defines.py +++ b/tools/plot_defines.py @@ -2,6 +2,8 @@ import sys import matplotlib.pyplot +import argparse + for filename in sys.argv[1:]: @@ -25,6 +27,6 @@ )[0] matplotlib.pyplot.plot(object["CENTER"][0], object["CENTER"][1], "-go", color=geom.get_color()) - matplotlib.pyplot.legend(loc='center left', bbox_to_anchor=(1, 0.5)) + matplotlib.pyplot.legend(loc="center left", bbox_to_anchor=(1, 0.5)) matplotlib.pyplot.tight_layout() matplotlib.pyplot.show()