more-transformations 1.0.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 (103) hide show
  1. more_transformations-1.0.0/.git_archival.txt +3 -0
  2. more_transformations-1.0.0/.gitattributes +1 -0
  3. more_transformations-1.0.0/.github/branch-rules.json +119 -0
  4. more_transformations-1.0.0/.github/scripts/ci.sh +12 -0
  5. more_transformations-1.0.0/.github/scripts/compile_kernels.py +48 -0
  6. more_transformations-1.0.0/.github/workflows/ci.yml +115 -0
  7. more_transformations-1.0.0/.github/workflows/docs.yml +48 -0
  8. more_transformations-1.0.0/.github/workflows/publish.yml +46 -0
  9. more_transformations-1.0.0/.gitignore +29 -0
  10. more_transformations-1.0.0/CHANGELOG.md +264 -0
  11. more_transformations-1.0.0/CITATION.cff +12 -0
  12. more_transformations-1.0.0/CONTRIBUTING.md +32 -0
  13. more_transformations-1.0.0/LICENSE +201 -0
  14. more_transformations-1.0.0/PKG-INFO +370 -0
  15. more_transformations-1.0.0/README.md +340 -0
  16. more_transformations-1.0.0/assets/marble.png +0 -0
  17. more_transformations-1.0.0/assets/ntnu.png +0 -0
  18. more_transformations-1.0.0/docs/api.rst +51 -0
  19. more_transformations-1.0.0/docs/casadi.rst +77 -0
  20. more_transformations-1.0.0/docs/conf.py +34 -0
  21. more_transformations-1.0.0/docs/conventions.rst +269 -0
  22. more_transformations-1.0.0/docs/index.rst +44 -0
  23. more_transformations-1.0.0/docs/kernels.rst +26 -0
  24. more_transformations-1.0.0/docs/migration.rst +871 -0
  25. more_transformations-1.0.0/more_transformations/__init__.py +94 -0
  26. more_transformations-1.0.0/more_transformations/_shapes.py +184 -0
  27. more_transformations-1.0.0/more_transformations/_triads.py +35 -0
  28. more_transformations-1.0.0/more_transformations/_units.py +29 -0
  29. more_transformations-1.0.0/more_transformations/_version.py +24 -0
  30. more_transformations-1.0.0/more_transformations/angles.py +764 -0
  31. more_transformations-1.0.0/more_transformations/attitude_determination.py +504 -0
  32. more_transformations-1.0.0/more_transformations/casadi/__init__.py +65 -0
  33. more_transformations-1.0.0/more_transformations/casadi/angles.py +552 -0
  34. more_transformations-1.0.0/more_transformations/casadi/attitude_determination.py +229 -0
  35. more_transformations-1.0.0/more_transformations/casadi/ecef.py +778 -0
  36. more_transformations-1.0.0/more_transformations/casadi/euler.py +768 -0
  37. more_transformations-1.0.0/more_transformations/casadi/flat_earth.py +239 -0
  38. more_transformations-1.0.0/more_transformations/casadi/frames.py +806 -0
  39. more_transformations-1.0.0/more_transformations/casadi/geodesic.py +287 -0
  40. more_transformations-1.0.0/more_transformations/casadi/linalg.py +143 -0
  41. more_transformations-1.0.0/more_transformations/casadi/parameters.py +624 -0
  42. more_transformations-1.0.0/more_transformations/casadi/pose.py +401 -0
  43. more_transformations-1.0.0/more_transformations/casadi/quaternion.py +1198 -0
  44. more_transformations-1.0.0/more_transformations/casadi/rigid_body.py +174 -0
  45. more_transformations-1.0.0/more_transformations/casadi/rotations.py +459 -0
  46. more_transformations-1.0.0/more_transformations/casadi/utils.py +353 -0
  47. more_transformations-1.0.0/more_transformations/casadi/utm.py +269 -0
  48. more_transformations-1.0.0/more_transformations/constants.py +70 -0
  49. more_transformations-1.0.0/more_transformations/data/README +65 -0
  50. more_transformations-1.0.0/more_transformations/data/WMM2010.COF +93 -0
  51. more_transformations-1.0.0/more_transformations/data/WMM2015v2.COF +93 -0
  52. more_transformations-1.0.0/more_transformations/data/WMM2020.COF +93 -0
  53. more_transformations-1.0.0/more_transformations/data/WMM2025.COF +93 -0
  54. more_transformations-1.0.0/more_transformations/data/WMMHR2025.COF +9047 -0
  55. more_transformations-1.0.0/more_transformations/data/egm96_15.npz +0 -0
  56. more_transformations-1.0.0/more_transformations/ecef.py +883 -0
  57. more_transformations-1.0.0/more_transformations/euler.py +903 -0
  58. more_transformations-1.0.0/more_transformations/flat_earth.py +243 -0
  59. more_transformations-1.0.0/more_transformations/frames.py +1015 -0
  60. more_transformations-1.0.0/more_transformations/geodesic.py +963 -0
  61. more_transformations-1.0.0/more_transformations/geoid.py +166 -0
  62. more_transformations-1.0.0/more_transformations/kernels/__init__.py +102 -0
  63. more_transformations-1.0.0/more_transformations/kernels/_compile_ready.py +36 -0
  64. more_transformations-1.0.0/more_transformations/kernels/_numba.py +23 -0
  65. more_transformations-1.0.0/more_transformations/kernels/angles.py +139 -0
  66. more_transformations-1.0.0/more_transformations/kernels/ecef.py +70 -0
  67. more_transformations-1.0.0/more_transformations/kernels/euler.py +320 -0
  68. more_transformations-1.0.0/more_transformations/kernels/rotations.py +131 -0
  69. more_transformations-1.0.0/more_transformations/linalg.py +359 -0
  70. more_transformations-1.0.0/more_transformations/magnetic.py +451 -0
  71. more_transformations-1.0.0/more_transformations/pose.py +521 -0
  72. more_transformations-1.0.0/more_transformations/py.typed +0 -0
  73. more_transformations-1.0.0/more_transformations/quaternion.py +1443 -0
  74. more_transformations-1.0.0/more_transformations/rigid_body.py +207 -0
  75. more_transformations-1.0.0/more_transformations/rotations.py +517 -0
  76. more_transformations-1.0.0/more_transformations/utm.py +350 -0
  77. more_transformations-1.0.0/more_transformations.egg-info/PKG-INFO +370 -0
  78. more_transformations-1.0.0/more_transformations.egg-info/SOURCES.txt +101 -0
  79. more_transformations-1.0.0/more_transformations.egg-info/dependency_links.txt +1 -0
  80. more_transformations-1.0.0/more_transformations.egg-info/entry_points.txt +2 -0
  81. more_transformations-1.0.0/more_transformations.egg-info/requires.txt +15 -0
  82. more_transformations-1.0.0/more_transformations.egg-info/scm_file_list.json +96 -0
  83. more_transformations-1.0.0/more_transformations.egg-info/scm_version.json +8 -0
  84. more_transformations-1.0.0/more_transformations.egg-info/top_level.txt +1 -0
  85. more_transformations-1.0.0/package.json +8 -0
  86. more_transformations-1.0.0/plugins.json +5 -0
  87. more_transformations-1.0.0/pyproject.toml +79 -0
  88. more_transformations-1.0.0/setup.cfg +4 -0
  89. more_transformations-1.0.0/tests/test_angles.py +170 -0
  90. more_transformations-1.0.0/tests/test_api.py +188 -0
  91. more_transformations-1.0.0/tests/test_attitude_determination.py +107 -0
  92. more_transformations-1.0.0/tests/test_ecef.py +161 -0
  93. more_transformations-1.0.0/tests/test_euler.py +132 -0
  94. more_transformations-1.0.0/tests/test_frames.py +167 -0
  95. more_transformations-1.0.0/tests/test_geodesic.py +140 -0
  96. more_transformations-1.0.0/tests/test_geoid.py +217 -0
  97. more_transformations-1.0.0/tests/test_kernels.py +54 -0
  98. more_transformations-1.0.0/tests/test_linalg.py +77 -0
  99. more_transformations-1.0.0/tests/test_magnetic.py +106 -0
  100. more_transformations-1.0.0/tests/test_quaternion.py +211 -0
  101. more_transformations-1.0.0/tests/test_rigid_body.py +90 -0
  102. more_transformations-1.0.0/tests/test_rotations.py +67 -0
  103. more_transformations-1.0.0/tests/test_utm.py +98 -0
@@ -0,0 +1,3 @@
1
+ node: $Format:%H$
2
+ node-date: $Format:%cI$
3
+ describe-name: $Format:%(describe:tags=true,match=v[0-9]*)$
@@ -0,0 +1 @@
1
+ .git_archival.txt export-subst
@@ -0,0 +1,119 @@
1
+ [
2
+ {
3
+ "name": "Protect main",
4
+ "target": "branch",
5
+ "enforcement": "active",
6
+ "bypass_actors": [
7
+ {
8
+ "actor_id": 26251219,
9
+ "actor_type": "User",
10
+ "bypass_mode": "always"
11
+ }
12
+ ],
13
+ "conditions": {
14
+ "ref_name": {
15
+ "include": [
16
+ "refs/heads/main"
17
+ ],
18
+ "exclude": []
19
+ }
20
+ },
21
+ "rules": [
22
+ {
23
+ "type": "creation"
24
+ },
25
+ {
26
+ "type": "update"
27
+ },
28
+ {
29
+ "type": "deletion"
30
+ },
31
+ {
32
+ "type": "non_fast_forward"
33
+ },
34
+ {
35
+ "type": "required_linear_history"
36
+ },
37
+ {
38
+ "type": "pull_request",
39
+ "parameters": {
40
+ "required_approving_review_count": 1,
41
+ "dismiss_stale_reviews_on_push": true,
42
+ "require_code_owner_review": false,
43
+ "require_last_push_approval": false,
44
+ "required_review_thread_resolution": true,
45
+ "allowed_merge_methods": [
46
+ "squash"
47
+ ]
48
+ }
49
+ },
50
+ {
51
+ "type": "required_status_checks",
52
+ "parameters": {
53
+ "required_status_checks": [
54
+ {
55
+ "context": "Library tests",
56
+ "integration_id": 15368
57
+ }
58
+ ],
59
+ "strict_required_status_checks_policy": true,
60
+ "do_not_enforce_on_create": true
61
+ }
62
+ }
63
+ ]
64
+ },
65
+ {
66
+ "name": "Protect develop",
67
+ "target": "branch",
68
+ "enforcement": "active",
69
+ "bypass_actors": [],
70
+ "conditions": {
71
+ "ref_name": {
72
+ "include": [
73
+ "refs/heads/develop"
74
+ ],
75
+ "exclude": []
76
+ }
77
+ },
78
+ "rules": [
79
+ {
80
+ "type": "creation"
81
+ },
82
+ {
83
+ "type": "deletion"
84
+ },
85
+ {
86
+ "type": "non_fast_forward"
87
+ },
88
+ {
89
+ "type": "required_linear_history"
90
+ },
91
+ {
92
+ "type": "pull_request",
93
+ "parameters": {
94
+ "required_approving_review_count": 1,
95
+ "dismiss_stale_reviews_on_push": true,
96
+ "require_code_owner_review": false,
97
+ "require_last_push_approval": false,
98
+ "required_review_thread_resolution": true,
99
+ "allowed_merge_methods": [
100
+ "squash"
101
+ ]
102
+ }
103
+ },
104
+ {
105
+ "type": "required_status_checks",
106
+ "parameters": {
107
+ "required_status_checks": [
108
+ {
109
+ "context": "Library tests",
110
+ "integration_id": 15368
111
+ }
112
+ ],
113
+ "strict_required_status_checks_policy": true,
114
+ "do_not_enforce_on_create": true
115
+ }
116
+ }
117
+ ]
118
+ }
119
+ ]
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env bash
2
+ # Run from the GitHub Actions workspace; dependencies are checked out by ci.yml.
3
+ set -eo pipefail
4
+ source /opt/ros/lyrical/setup.bash
5
+
6
+ for package in rpp_common rpp_plugin_registrator rpp_orchestrator rpp_py rpp_cli rpp_testing; do
7
+ python -m pip install --no-deps -e "rpp_dev/src/$package"
8
+ done
9
+ python -m pip install "casadi>=3.5.5" numpy matplotlib
10
+ python -m pip install --no-deps -e libraries/more_transformations
11
+
12
+ python -m pytest libraries/more_transformations/tests
@@ -0,0 +1,48 @@
1
+ """Compile every kernel with numba.njit and compare it with the plain call, bit for bit.
2
+
3
+ Run against an installed package: python compile_kernels.py
4
+ """
5
+
6
+ import inspect
7
+ import sys
8
+
9
+ import numpy as np
10
+ from numba import njit
11
+
12
+ import more_transformations.kernels as kernels
13
+
14
+
15
+ def example_args(fn):
16
+ args = []
17
+ for name in inspect.signature(fn).parameters:
18
+ args.append(np.zeros((3, 3)) if name == "out" else 0.3)
19
+ return args
20
+
21
+
22
+ def same(a, b):
23
+ if a is None or b is None:
24
+ return a is b
25
+ return np.array_equal(np.asarray(a), np.asarray(b), equal_nan=True)
26
+
27
+
28
+ def main():
29
+ failed = []
30
+ count = 0
31
+ for name in kernels.__all__:
32
+ fn = getattr(kernels, name)
33
+ plain_args, jit_args = example_args(fn), example_args(fn)
34
+ expected = fn(*plain_args)
35
+ got = njit(fn)(*jit_args)
36
+ count += 1
37
+ if not same(expected, got) or not all(
38
+ same(p, j) for p, j in zip(plain_args, jit_args, strict=True)
39
+ ):
40
+ failed.append(name)
41
+ print(f"compiled {count} kernels, {len(failed)} differ")
42
+ if failed:
43
+ print("differ:", ", ".join(failed))
44
+ sys.exit(1)
45
+
46
+
47
+ if __name__ == "__main__":
48
+ main()
@@ -0,0 +1,115 @@
1
+ name: Library CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, develop]
6
+ pull_request:
7
+ branches: [main, develop]
8
+ types: [opened, synchronize, reopened, ready_for_review, edited]
9
+ workflow_dispatch:
10
+
11
+ permissions:
12
+ contents: read
13
+ packages: read
14
+
15
+ concurrency:
16
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
17
+ cancel-in-progress: true
18
+
19
+ jobs:
20
+ test:
21
+ name: Library tests
22
+ runs-on: ubuntu-26.04
23
+ timeout-minutes: 30
24
+ container:
25
+ image: ghcr.io/coe-marble/rpp-test-container:lyrical-ubuntu26.04-capnp1.1.0-v1
26
+ defaults:
27
+ run:
28
+ shell: bash
29
+ env:
30
+ ROS_DISTRO: lyrical
31
+ QT_QPA_PLATFORM: offscreen
32
+ steps:
33
+ - name: Check out repository under test
34
+ uses: actions/checkout@v4
35
+ with:
36
+ path: libraries/more_transformations
37
+ fetch-depth: 0 # tags, for the version (setuptools-scm)
38
+ persist-credentials: false
39
+ - name: Check out RPP integration dependencies
40
+ uses: actions/checkout@v4
41
+ with:
42
+ repository: coe-marble/rpp_dev
43
+ ref: ${{ github.event.pull_request.base.ref || github.ref_name }}
44
+ path: rpp_dev
45
+ submodules: recursive
46
+ token: ${{ secrets.RPP_CI_TOKEN || github.token }}
47
+ persist-credentials: false
48
+ - name: Run library CI
49
+ run: bash libraries/more_transformations/.github/scripts/ci.sh
50
+
51
+ package:
52
+ name: Package (Python ${{ matrix.python }})
53
+ runs-on: ubuntu-latest
54
+ timeout-minutes: 30
55
+ strategy:
56
+ fail-fast: false
57
+ matrix:
58
+ python: ["3.10", "3.12", "3.14"]
59
+ steps:
60
+ - uses: actions/checkout@v4
61
+ with:
62
+ fetch-depth: 0 # tags, for the version (setuptools-scm)
63
+ persist-credentials: false
64
+ - uses: actions/setup-python@v5
65
+ with:
66
+ python-version: ${{ matrix.python }}
67
+ - name: Build the sdist and the wheel
68
+ run: |
69
+ python -m pip install build twine
70
+ python -m build --outdir dist .
71
+ python -m twine check --strict dist/*
72
+ - name: Install the wheel into a clean environment
73
+ run: |
74
+ python -m venv "$RUNNER_TEMP/venv"
75
+ wheel=$(ls "$PWD"/dist/*.whl)
76
+ "$RUNNER_TEMP/venv/bin/pip" install "$wheel" pytest
77
+ - name: Run the tests against the installed package
78
+ run: |
79
+ # Copy the tests out of the checkout so that the installed package is
80
+ # the one imported, not the source tree.
81
+ cp -r tests "$RUNNER_TEMP/tests"
82
+ cd "$RUNNER_TEMP"
83
+ "$RUNNER_TEMP/venv/bin/python" -m pytest -p no:cacheprovider tests
84
+ - name: Run the doctests of the installed package
85
+ run: |
86
+ cd "$RUNNER_TEMP"
87
+ "$RUNNER_TEMP/venv/bin/python" -m pytest -p no:cacheprovider --doctest-modules --pyargs more_transformations
88
+ - name: Compile every kernel with numba
89
+ run: |
90
+ cd "$RUNNER_TEMP"
91
+ "$RUNNER_TEMP/venv/bin/python" "$GITHUB_WORKSPACE/.github/scripts/compile_kernels.py"
92
+
93
+ typing:
94
+ name: Type check (${{ matrix.numpy }})
95
+ runs-on: ubuntu-latest
96
+ timeout-minutes: 15
97
+ strategy:
98
+ fail-fast: false
99
+ matrix:
100
+ # the lowest supported NumPy and the newest one
101
+ numpy: ["numpy==1.26.4", "numpy"]
102
+ steps:
103
+ - uses: actions/checkout@v4
104
+ with:
105
+ fetch-depth: 0 # tags, for the version (setuptools-scm)
106
+ persist-credentials: false
107
+ - uses: actions/setup-python@v5
108
+ with:
109
+ python-version: "3.12"
110
+ - name: Install the package, mypy and NumPy
111
+ run: python -m pip install ".[dev]" "${{ matrix.numpy }}"
112
+ - name: Show the NumPy version
113
+ run: python -c "import numpy; print(numpy.__version__)"
114
+ - name: Run mypy with the configuration of pyproject.toml
115
+ run: python -m mypy more_transformations
@@ -0,0 +1,48 @@
1
+ # Documentation site.
2
+ # Switched off until 1.0: the build runs on every push to develop, but the
3
+ # deployment to GitHub Pages runs only for a v* tag and only once the
4
+ # repository is public.
5
+ name: Documentation
6
+
7
+ on:
8
+ push:
9
+ branches: [develop]
10
+ tags: ["v*"]
11
+ workflow_dispatch:
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ jobs:
17
+ build:
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+ with:
22
+ fetch-depth: 0
23
+ persist-credentials: false
24
+ - uses: actions/setup-python@v5
25
+ with:
26
+ python-version: "3.12"
27
+ - name: Build the site
28
+ run: |
29
+ python -m pip install ".[docs]"
30
+ python -m sphinx -b html -W --keep-going docs docs/_build/html
31
+ - uses: actions/upload-pages-artifact@v3
32
+ with:
33
+ path: docs/_build/html
34
+
35
+ deploy:
36
+ # Off until 1.0: needs a public repository and a v* tag.
37
+ if: github.event.repository.private == false && startsWith(github.ref, 'refs/tags/v')
38
+ needs: build
39
+ runs-on: ubuntu-latest
40
+ permissions:
41
+ pages: write
42
+ id-token: write
43
+ environment:
44
+ name: github-pages
45
+ url: ${{ steps.deployment.outputs.page_url }}
46
+ steps:
47
+ - id: deployment
48
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,46 @@
1
+ # Release to PyPI.
2
+ # Switched off until 1.0: it runs only for a v* tag and only once the
3
+ # repository is public. It uses trusted publishing; there are no tokens.
4
+ name: Publish
5
+
6
+ on:
7
+ push:
8
+ tags: ["v*"]
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ build:
15
+ if: github.event.repository.private == false
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ with:
20
+ fetch-depth: 0
21
+ persist-credentials: false
22
+ - uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.12"
25
+ - run: |
26
+ python -m pip install build twine
27
+ python -m build --outdir dist .
28
+ python -m twine check --strict dist/*
29
+ - uses: actions/upload-artifact@v4
30
+ with:
31
+ name: dist
32
+ path: dist/
33
+
34
+ publish:
35
+ if: github.event.repository.private == false
36
+ needs: build
37
+ runs-on: ubuntu-latest
38
+ environment: pypi
39
+ permissions:
40
+ id-token: write
41
+ steps:
42
+ - uses: actions/download-artifact@v4
43
+ with:
44
+ name: dist
45
+ path: dist/
46
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,29 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ .eggs/
6
+ .venv/
7
+ venv/
8
+
9
+ # Build
10
+ build/
11
+ dist/
12
+ more_transformations/_version.py
13
+
14
+ # Tests and tools
15
+ .pytest_cache/
16
+ .mypy_cache/
17
+ .ruff_cache/
18
+ .coverage
19
+ htmlcov/
20
+
21
+ # Documentation
22
+ docs/_build/
23
+ docs/generated/
24
+ docs/generated_casadi/
25
+
26
+ # Editors
27
+ .idea/
28
+ .vscode/
29
+ *.swp