planarcurve 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. planarcurve-0.1.0/.codecrate.toml +26 -0
  2. planarcurve-0.1.0/.github/workflows/ci.yml +63 -0
  3. planarcurve-0.1.0/.github/workflows/release.yml +31 -0
  4. planarcurve-0.1.0/.gitignore +222 -0
  5. planarcurve-0.1.0/.ledger/ledger.toml +24 -0
  6. planarcurve-0.1.0/.ledger/releaseledger/.ledger-project.toml +6 -0
  7. planarcurve-0.1.0/.ledger/releaseledger/config.toml +57 -0
  8. planarcurve-0.1.0/.ledger/releaseledger/data/.ledger-project.toml +6 -0
  9. planarcurve-0.1.0/.ledger/taskledger/.ledger-project.toml +6 -0
  10. planarcurve-0.1.0/.ledger/taskledger/config.toml +7 -0
  11. planarcurve-0.1.0/.pre-commit-config.yaml +64 -0
  12. planarcurve-0.1.0/LICENSE +201 -0
  13. planarcurve-0.1.0/MVP_NOTES.md +15 -0
  14. planarcurve-0.1.0/PKG-INFO +371 -0
  15. planarcurve-0.1.0/PLANARCURVE_REVIEW_FOR_CODING_AGENT.md +1703 -0
  16. planarcurve-0.1.0/PLANARCURVE_REVIEW_FOR_CODING_AGENT.md:Zone.Identifier +0 -0
  17. planarcurve-0.1.0/README.md +126 -0
  18. planarcurve-0.1.0/examples/README.md +13 -0
  19. planarcurve-0.1.0/examples/curvature_gallery.py +52 -0
  20. planarcurve-0.1.0/examples/curvature_gallery.svg +1 -0
  21. planarcurve-0.1.0/examples/fit_polyline_to_spline.py +68 -0
  22. planarcurve-0.1.0/examples/fit_shared_trajectory.py +78 -0
  23. planarcurve-0.1.0/examples/spline_to_bezier.out +7 -0
  24. planarcurve-0.1.0/examples/spline_to_bezier.py +21 -0
  25. planarcurve-0.1.0/examples/svg_pipeline.out +16 -0
  26. planarcurve-0.1.0/examples/svg_pipeline.py +20 -0
  27. planarcurve-0.1.0/planarcurve/__init__.py +52 -0
  28. planarcurve-0.1.0/planarcurve/_version.py +24 -0
  29. planarcurve-0.1.0/planarcurve/bezier.py +211 -0
  30. planarcurve-0.1.0/planarcurve/curvature.py +82 -0
  31. planarcurve-0.1.0/planarcurve/fitting/__init__.py +3 -0
  32. planarcurve-0.1.0/planarcurve/fitting/parameters.py +110 -0
  33. planarcurve-0.1.0/planarcurve/fitting/policy.py +17 -0
  34. planarcurve-0.1.0/planarcurve/fitting/spline.py +217 -0
  35. planarcurve-0.1.0/planarcurve/fitting/trajectory.py +575 -0
  36. planarcurve-0.1.0/planarcurve/polyline.py +177 -0
  37. planarcurve-0.1.0/planarcurve/py.typed +0 -0
  38. planarcurve-0.1.0/planarcurve/spline.py +221 -0
  39. planarcurve-0.1.0/planarcurve/svg.py +298 -0
  40. planarcurve-0.1.0/planarcurve/trajectory.py +388 -0
  41. planarcurve-0.1.0/planarcurve/transforms.py +136 -0
  42. planarcurve-0.1.0/planarcurve/types.py +75 -0
  43. planarcurve-0.1.0/planarcurve.egg-info/PKG-INFO +371 -0
  44. planarcurve-0.1.0/planarcurve.egg-info/SOURCES.txt +59 -0
  45. planarcurve-0.1.0/planarcurve.egg-info/dependency_links.txt +1 -0
  46. planarcurve-0.1.0/planarcurve.egg-info/requires.txt +22 -0
  47. planarcurve-0.1.0/planarcurve.egg-info/scm_file_list.json +55 -0
  48. planarcurve-0.1.0/planarcurve.egg-info/scm_version.json +8 -0
  49. planarcurve-0.1.0/planarcurve.egg-info/top_level.txt +1 -0
  50. planarcurve-0.1.0/pyproject.toml +80 -0
  51. planarcurve-0.1.0/setup.cfg +4 -0
  52. planarcurve-0.1.0/tests/test_curvature.py +156 -0
  53. planarcurve-0.1.0/tests/test_examples.py +30 -0
  54. planarcurve-0.1.0/tests/test_fitting_parameters.py +57 -0
  55. planarcurve-0.1.0/tests/test_fitting_spline.py +108 -0
  56. planarcurve-0.1.0/tests/test_fitting_trajectory.py +110 -0
  57. planarcurve-0.1.0/tests/test_polyline_bezier.py +136 -0
  58. planarcurve-0.1.0/tests/test_spline.py +94 -0
  59. planarcurve-0.1.0/tests/test_svg.py +48 -0
  60. planarcurve-0.1.0/tests/test_transforms.py +41 -0
  61. planarcurve-0.1.0/tools/parity_with_inkgrammar.py +56 -0
@@ -0,0 +1,26 @@
1
+ [codecrate]
2
+ output = "context_planarcurve.md"
3
+ keep_docstrings = true
4
+ dedupe = true
5
+ metadata = false
6
+ respect_gitignore = true
7
+ exclude = ["*/.venv/*", "context_planarcurve.*"]
8
+ gitignore_allow = ["planarcurve/_version.py"]
9
+ include = [
10
+ "**/*.py",
11
+ "**/*.toml",
12
+ "**/*.md",
13
+ "**/*.json",
14
+ "**/*.txt",
15
+ "**/*.csv",
16
+ "**/*.tsv",
17
+ "**/*.yaml",
18
+ "**/*.yml",
19
+ "**/*.ssmd",
20
+ "LICENSE",
21
+ "planarcurve/py.typed",
22
+ ]
23
+ split_max_chars = 0
24
+ layout = "full"
25
+ profile = "portable-agent"
26
+ emit_standalone_unpacker = true
@@ -0,0 +1,63 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ full:
9
+ runs-on: ubuntu-latest
10
+ strategy:
11
+ matrix:
12
+ python-version: ["3.10", "3.13"]
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ with:
16
+ fetch-depth: 0
17
+ - uses: actions/setup-python@v5
18
+ with:
19
+ python-version: ${{ matrix.python-version }}
20
+ - run: python -m pip install -e ".[dev]"
21
+ - run: ruff check .
22
+ - run: python -m pytest
23
+ - run: python -m build
24
+ - run: python -m twine check dist/*
25
+
26
+ core-only:
27
+ runs-on: ubuntu-latest
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ with:
31
+ fetch-depth: 0
32
+ - uses: actions/setup-python@v5
33
+ with:
34
+ python-version: "3.13"
35
+ - run: python -m pip install .
36
+ - run: python -m pip install pytest
37
+ - run: >-
38
+ python -c 'import sys; import planarcurve; import planarcurve.polyline;
39
+ import planarcurve.transforms; assert "scipy" not in sys.modules;
40
+ assert "fontTools" not in sys.modules'
41
+ - run: python -m pytest tests/test_curvature.py tests/test_polyline_bezier.py tests/test_transforms.py
42
+
43
+ wheel-smoke:
44
+ runs-on: ubuntu-latest
45
+ steps:
46
+ - uses: actions/checkout@v4
47
+ with:
48
+ fetch-depth: 0
49
+ - uses: actions/setup-python@v5
50
+ with:
51
+ python-version: "3.13"
52
+ - run: python -m pip install build
53
+ - run: python -m build --wheel
54
+ - run: python -m venv /tmp/planarcurve-wheel
55
+ - run: /tmp/planarcurve-wheel/bin/python -m pip install dist/*.whl
56
+ - run: >-
57
+ /tmp/planarcurve-wheel/bin/python -c 'from importlib.resources import files;
58
+ import sys; import planarcurve; from planarcurve.trajectory import
59
+ HeadingRateProfile, Trajectory2D, trajectory_total_turn;
60
+ assert files("planarcurve").joinpath("py.typed").is_file();
61
+ assert trajectory_total_turn(Trajectory2D(1.0, 0.0,
62
+ HeadingRateProfile(90.0, 90.0, interpolation="linear"))) == 90.0;
63
+ assert "scipy" not in sys.modules and "fontTools" not in sys.modules'
@@ -0,0 +1,31 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ contents: read
10
+ id-token: write
11
+
12
+ jobs:
13
+ pypi:
14
+ runs-on: ubuntu-latest
15
+ environment:
16
+ name: pypi
17
+ url: https://pypi.org/p/planarcurve
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ with:
21
+ fetch-depth: 0
22
+ - uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.13"
25
+ - run: python -m pip install -e ".[dev]"
26
+ - run: ruff check .
27
+ - run: pytest
28
+ - run: python -m build
29
+ - uses: pypa/gh-action-pypi-publish@release/v1
30
+ with:
31
+ password: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,222 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ *.lcov
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ cover/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ # Pipfile.lock
97
+
98
+ # uv
99
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
100
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
101
+ # commonly ignored for libraries.
102
+ # uv.lock
103
+
104
+ # poetry
105
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
106
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
107
+ # commonly ignored for libraries.
108
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
109
+ # poetry.lock
110
+ # poetry.toml
111
+
112
+ # pdm
113
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
114
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
115
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
116
+ # pdm.lock
117
+ # pdm.toml
118
+ .pdm-python
119
+ .pdm-build/
120
+
121
+ # pixi
122
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
123
+ # pixi.lock
124
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
125
+ # in the .venv directory. It is recommended not to include this directory in version control.
126
+ .pixi/*
127
+ !.pixi/config.toml
128
+
129
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
130
+ __pypackages__/
131
+
132
+ # Celery stuff
133
+ celerybeat-schedule*
134
+ celerybeat.pid
135
+
136
+ # Redis
137
+ *.rdb
138
+ *.aof
139
+ *.pid
140
+
141
+ # RabbitMQ
142
+ mnesia/
143
+ rabbitmq/
144
+ rabbitmq-data/
145
+
146
+ # ActiveMQ
147
+ activemq-data/
148
+
149
+ # SageMath parsed files
150
+ *.sage.py
151
+
152
+ # Environments
153
+ .env
154
+ .envrc
155
+ .venv
156
+ env/
157
+ venv/
158
+ ENV/
159
+ env.bak/
160
+ venv.bak/
161
+
162
+ # Spyder project settings
163
+ .spyderproject
164
+ .spyproject
165
+
166
+ # Rope project settings
167
+ .ropeproject
168
+
169
+ # mkdocs/Zensical documentation
170
+ /site
171
+
172
+ # mypy
173
+ .mypy_cache/
174
+ .dmypy.json
175
+ dmypy.json
176
+
177
+ # Pyre type checker
178
+ .pyre/
179
+
180
+ # pytype static type analyzer
181
+ .pytype/
182
+
183
+ # Cython debug symbols
184
+ cython_debug/
185
+
186
+ # PyCharm
187
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
188
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
189
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
190
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
191
+ # .idea/
192
+
193
+ # Abstra
194
+ # Abstra is an AI-powered process automation framework.
195
+ # Ignore directories containing user credentials, local state, and settings.
196
+ # Learn more at https://abstra.io/docs
197
+ .abstra/
198
+
199
+ # Visual Studio Code
200
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore that
201
+ # can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
202
+ # and can be added to the global gitignore or merged into this file. However, if you prefer, you
203
+ # could uncomment the following to ignore the entire vscode folder
204
+ # .vscode/
205
+ # Temporary file for partial code execution
206
+ tempCodeRunnerFile.py
207
+
208
+ # Ruff stuff:
209
+ .ruff_cache/
210
+
211
+ # PyPI configuration file
212
+ .pypirc
213
+
214
+ # Marimo
215
+ marimo/_static/
216
+ marimo/_lsp/
217
+ __marimo__/
218
+
219
+ # Streamlit
220
+ .streamlit/secrets.toml
221
+ planarcurve/_version.py
222
+ context_planarcurve*.*
@@ -0,0 +1,24 @@
1
+ schema_version = 3
2
+
3
+ [project]
4
+ uuid = "cf75fb83-84a0-484a-993b-40df66781f42"
5
+ name = "planarcurve"
6
+
7
+ [ledgers.taskledger.mounts.data]
8
+ storage = "external"
9
+ root = "../ledger"
10
+
11
+ [ledgers.taskledger.mounts.runtime]
12
+ storage = "user-data"
13
+
14
+ [ledgers.taskledger.mounts.logs]
15
+ storage = "user-data"
16
+
17
+ [ledgers.taskledger.mounts.indexes]
18
+ storage = "cache"
19
+
20
+ [ledgers.releaseledger.mounts.data]
21
+ storage = "project"
22
+
23
+ [ledgers.releaseledger.mounts.indexes]
24
+ storage = "cache"
@@ -0,0 +1,6 @@
1
+ schema_version = 1
2
+ layout_version = 3
3
+ project_uuid = "cf75fb83-84a0-484a-993b-40df66781f42"
4
+ tool = "releaseledger"
5
+ mount = "config"
6
+ storage = "project"
@@ -0,0 +1,57 @@
1
+ config_version = 2
2
+ # Branch-scoped release state. This block is safe to commit.
3
+ ledger_ref = "main"
4
+ ledger_parent_ref = ""
5
+ ledger_branch_guard = "off"
6
+ # Cross-ledger identity. Local record IDs stay unchanged.
7
+
8
+ [ledger]
9
+ code = "rl"
10
+ # Release defaults.
11
+
12
+ [release]
13
+ default_changelog = "CHANGELOG.md"
14
+ default_status = "planned"
15
+ allow_dirty_worktree = true
16
+ # Changelog build defaults.
17
+
18
+ [changelog]
19
+ output = "docs/changelog.md"
20
+ header = ""
21
+ body = """## {% if release.date %}[{{ release.version }}] - {{ release.date }}{% else %}[{{ release.version }}] - Unreleased{% endif %}
22
+
23
+ {% for group in groups %}
24
+ ### {{ group.title }}
25
+ {% for entry in group.entries %}
26
+ - {% if entry.breaking %}**BREAKING:** {% endif %}{{ entry.summary }}
27
+ {% endfor %}
28
+
29
+ {% endfor %}
30
+ """
31
+ footer = "<!-- generated by releaseledger -->"
32
+ trim = true
33
+ render_always = false
34
+ postprocessors = []
35
+ standard = ""
36
+ group_mode = "extended"
37
+ link_references = false
38
+ repository_url = ""
39
+ tag_prefix = "v"
40
+ compare_url_template = ""
41
+ release_url_template = ""
42
+ preamble = ""
43
+ semver = false
44
+ unreleased = true
45
+ # Git-first release evidence.
46
+
47
+ [git]
48
+ enabled = true
49
+ tag_creation = "local"
50
+ default_base = "previous_release_tag"
51
+ default_head = "HEAD"
52
+ previous_tag_patterns = ["v{version}", "{version}"]
53
+ include_merges = "nontrivial"
54
+ require_clean_worktree = false
55
+ max_commits = 500
56
+ max_diff_chars_per_commit = 12000
57
+ candidate_status = "draft"
@@ -0,0 +1,6 @@
1
+ schema_version = 1
2
+ layout_version = 3
3
+ project_uuid = "cf75fb83-84a0-484a-993b-40df66781f42"
4
+ tool = "releaseledger"
5
+ mount = "data"
6
+ storage = "project"
@@ -0,0 +1,6 @@
1
+ schema_version = 1
2
+ layout_version = 3
3
+ project_uuid = "cf75fb83-84a0-484a-993b-40df66781f42"
4
+ tool = "taskledger"
5
+ mount = "config"
6
+ storage = "project"
@@ -0,0 +1,7 @@
1
+ # Project-local Taskledger configuration.
2
+ # Storage topology belongs to Ledgercore; branch state belongs to data/state.toml.
3
+ config_version = 3
4
+
5
+ [ledger]
6
+ code = 'tl'
7
+ name = 'taskledger'
@@ -0,0 +1,64 @@
1
+ exclude: |
2
+ # NOT INSTALLABLE ADDONS
3
+ # END NOT INSTALLABLE ADDONS
4
+ # Files and folders generated by bots, to avoid loops
5
+ ^setup/|/static/description/index\.html$|
6
+ # We don't want to mess with tool-generated files
7
+ .svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|
8
+ # Maybe reactivate this when all README files include prettier ignore tags?
9
+ ^README\.md$|
10
+ # Repos using Sphinx to generate docs don't need prettying
11
+ ^docs/_templates/.*\.html$|
12
+ # Don't bother non-technical authors with formatting issues in docs
13
+ readme/.*\.(rst|md)$|
14
+ # Ignore build and dist directories in addons
15
+ /build/|/dist/|/dev/|/notnebooks/
16
+ # You don't usually want a bot to modify your legal texts
17
+ (LICENSE.*|COPYING.*)|
18
+ default_language_version:
19
+ python: python3
20
+ repos:
21
+ - repo: local
22
+ hooks:
23
+ - id: ruff-check
24
+ name: ruff check
25
+ entry: ruff check --exit-non-zero-on-fix --force-exclude
26
+ language: system
27
+ types_or: [python, pyi]
28
+ - id: ruff-format
29
+ name: ruff format
30
+ entry: ruff format --force-exclude
31
+ language: system
32
+ types_or: [python, pyi]
33
+ - repo: https://github.com/asottile/pyupgrade
34
+ rev: v3.21.2
35
+ hooks:
36
+ - id: pyupgrade
37
+ args: [--py310-plus]
38
+ - repo: https://github.com/pre-commit/pre-commit-hooks
39
+ rev: v6.0.0
40
+ hooks:
41
+ - id: check-toml
42
+ - id: check-yaml
43
+ - id: end-of-file-fixer
44
+ - id: trailing-whitespace
45
+ - id: check-symlinks
46
+ - id: check-xml
47
+ - id: mixed-line-ending
48
+ args: ["--fix=lf"]
49
+ - id: debug-statements
50
+ - id: check-case-conflict
51
+ - id: check-docstring-first
52
+ - id: check-executables-have-shebangs
53
+ - id: check-merge-conflict
54
+ - repo: https://github.com/pre-commit/mirrors-prettier
55
+ rev: v4.0.0-alpha.8
56
+ hooks:
57
+ - id: prettier
58
+ name: prettier (with plugin-xml)
59
+ additional_dependencies:
60
+ - "prettier@2.7.1"
61
+ - "@prettier/plugin-xml@2.2.0"
62
+ args:
63
+ - --plugin=@prettier/plugin-xml
64
+ files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$