sysmlv2-units 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.
- sysmlv2_units-1.0.0/LICENSE +21 -0
- sysmlv2_units-1.0.0/PKG-INFO +82 -0
- sysmlv2_units-1.0.0/README.md +60 -0
- sysmlv2_units-1.0.0/pyproject.toml +41 -0
- sysmlv2_units-1.0.0/setup.cfg +4 -0
- sysmlv2_units-1.0.0/sysmlv2_units/__init__.py +3 -0
- sysmlv2_units-1.0.0/sysmlv2_units/units_helper.py +1103 -0
- sysmlv2_units-1.0.0/sysmlv2_units.egg-info/PKG-INFO +82 -0
- sysmlv2_units-1.0.0/sysmlv2_units.egg-info/SOURCES.txt +11 -0
- sysmlv2_units-1.0.0/sysmlv2_units.egg-info/dependency_links.txt +1 -0
- sysmlv2_units-1.0.0/sysmlv2_units.egg-info/requires.txt +10 -0
- sysmlv2_units-1.0.0/sysmlv2_units.egg-info/top_level.txt +1 -0
- sysmlv2_units-1.0.0/tests/test_units.py +513 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jasper Bussemaker
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sysmlv2-units
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: SysML v2 Python Units
|
|
5
|
+
Author-email: Jasper Bussemaker <jasper.bussemaker@dlr.de>
|
|
6
|
+
Keywords: sysmlv2,units,quantities,syside,pint
|
|
7
|
+
Classifier: Intended Audience :: Science/Research
|
|
8
|
+
Classifier: Topic :: Scientific/Engineering
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Requires-Python: >=3.12
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: syside
|
|
14
|
+
Requires-Dist: pint
|
|
15
|
+
Provides-Extra: test
|
|
16
|
+
Requires-Dist: pytest; extra == "test"
|
|
17
|
+
Provides-Extra: nb
|
|
18
|
+
Requires-Dist: jupyter; extra == "nb"
|
|
19
|
+
Requires-Dist: ipython; extra == "nb"
|
|
20
|
+
Requires-Dist: ipykernel; extra == "nb"
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
# SysML v2 Python Units
|
|
24
|
+
|
|
25
|
+
[](https://github.com/jbussemaker/SysML-v2-Python-Units/actions/workflows/tests.yml?query=workflow%3ATests)
|
|
26
|
+
[](https://pypi.org/project/sysmlv2-units)
|
|
27
|
+
[](LICENSE)
|
|
28
|
+
|
|
29
|
+
Convert units and quantities between standard [SysML v2](https://www.omg.org/sysml/sysmlv2/) and Python with
|
|
30
|
+
[Syside Automator](https://docs.sensmetry.com/automator/) and [Pint](https://pint.readthedocs.io/).
|
|
31
|
+
|
|
32
|
+
- Get/set quantity* as `attribute` value, specified using Pint `Quantity` objects
|
|
33
|
+
- Get/set unit as `attribute` value, specified using Pint `Unit` objects
|
|
34
|
+
- Supports numerical values, as well as `inf` (`*` in SysML v2) and `NaN` (set as `null` in SysML v2)
|
|
35
|
+
- Conversion functions between SysML v2 units and Pint `Unit`, and string parsing functions
|
|
36
|
+
- Derive preferred units for a quantity type, for example `kg` for an `ISQ::mass` quantity
|
|
37
|
+
- Syside Automator [`ReferencePrinter`](https://docs.sensmetry.com/python/latest/syside/ReferencePrinter.html) for
|
|
38
|
+
printing unit references using their short name
|
|
39
|
+
- Extensive caching to make units lookup fast
|
|
40
|
+
|
|
41
|
+
*: a quantity is a combination of a numerical value (the "magnitude") and units, for example: `10 kg`, `-1.0 m/s**2`.
|
|
42
|
+
|
|
43
|
+
Note: this package uses [Syside Automator](https://docs.sensmetry.com/automator/) for parsing SysML v2 models.
|
|
44
|
+
Syside Automator is commercial software, so you have to obtain a license first.
|
|
45
|
+
For academic uses you can request an [academic license](https://sensmetry.com/syside-pricing/).
|
|
46
|
+
|
|
47
|
+
## Installation
|
|
48
|
+
|
|
49
|
+
1. Install the package from PyPI:
|
|
50
|
+
```
|
|
51
|
+
pip install sysmlv2-units
|
|
52
|
+
```
|
|
53
|
+
Note: currently Syside Automator only supports Python 3.12
|
|
54
|
+
2. Make sure you [activate Syside Automator](https://docs.sensmetry.com/automator/install.html#activate-license)
|
|
55
|
+
|
|
56
|
+
## Usage
|
|
57
|
+
|
|
58
|
+
Refer to [the documentation](https://github.com/jbussemaker/SysML-v2-Python-Units/blob/main/documentation.ipynb).
|
|
59
|
+
|
|
60
|
+
## Citing
|
|
61
|
+
|
|
62
|
+
If you use this library in your work, please cite the paper that first introduces the use of these capabilities:
|
|
63
|
+
|
|
64
|
+
Bussemaker, J.H. et al., 2026, April.
|
|
65
|
+
System Architecture Optimization Using SysML v2: Language Extension and Implementation.
|
|
66
|
+
IEEE SysCon 2026, Halifax, Canada.
|
|
67
|
+
doi: [10.1109/SysCon66367.2026.11503593](https://dx.doi.org/10.1109/SysCon66367.2026.11503593)
|
|
68
|
+
|
|
69
|
+
## Contributing
|
|
70
|
+
|
|
71
|
+
The project is coordinated by: Jasper Bussemaker (*jasper.bussemaker at dlr.de*)
|
|
72
|
+
|
|
73
|
+
If you find a bug or have a feature request, please file an issue using the Github issue tracker.
|
|
74
|
+
If you require support for using the library or want to collaborate, feel free to contact me.
|
|
75
|
+
|
|
76
|
+
Contributions are appreciated too:
|
|
77
|
+
- Fork the repository
|
|
78
|
+
- Add your contributions to the fork
|
|
79
|
+
- Update/add documentation
|
|
80
|
+
- Add tests and make sure they pass (tests are run using `pytest`)
|
|
81
|
+
- Sign a Contributor License Agreement (CLA): *please contact me for the template*
|
|
82
|
+
- Issue a pull request
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# SysML v2 Python Units
|
|
2
|
+
|
|
3
|
+
[](https://github.com/jbussemaker/SysML-v2-Python-Units/actions/workflows/tests.yml?query=workflow%3ATests)
|
|
4
|
+
[](https://pypi.org/project/sysmlv2-units)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
Convert units and quantities between standard [SysML v2](https://www.omg.org/sysml/sysmlv2/) and Python with
|
|
8
|
+
[Syside Automator](https://docs.sensmetry.com/automator/) and [Pint](https://pint.readthedocs.io/).
|
|
9
|
+
|
|
10
|
+
- Get/set quantity* as `attribute` value, specified using Pint `Quantity` objects
|
|
11
|
+
- Get/set unit as `attribute` value, specified using Pint `Unit` objects
|
|
12
|
+
- Supports numerical values, as well as `inf` (`*` in SysML v2) and `NaN` (set as `null` in SysML v2)
|
|
13
|
+
- Conversion functions between SysML v2 units and Pint `Unit`, and string parsing functions
|
|
14
|
+
- Derive preferred units for a quantity type, for example `kg` for an `ISQ::mass` quantity
|
|
15
|
+
- Syside Automator [`ReferencePrinter`](https://docs.sensmetry.com/python/latest/syside/ReferencePrinter.html) for
|
|
16
|
+
printing unit references using their short name
|
|
17
|
+
- Extensive caching to make units lookup fast
|
|
18
|
+
|
|
19
|
+
*: a quantity is a combination of a numerical value (the "magnitude") and units, for example: `10 kg`, `-1.0 m/s**2`.
|
|
20
|
+
|
|
21
|
+
Note: this package uses [Syside Automator](https://docs.sensmetry.com/automator/) for parsing SysML v2 models.
|
|
22
|
+
Syside Automator is commercial software, so you have to obtain a license first.
|
|
23
|
+
For academic uses you can request an [academic license](https://sensmetry.com/syside-pricing/).
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
1. Install the package from PyPI:
|
|
28
|
+
```
|
|
29
|
+
pip install sysmlv2-units
|
|
30
|
+
```
|
|
31
|
+
Note: currently Syside Automator only supports Python 3.12
|
|
32
|
+
2. Make sure you [activate Syside Automator](https://docs.sensmetry.com/automator/install.html#activate-license)
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
Refer to [the documentation](https://github.com/jbussemaker/SysML-v2-Python-Units/blob/main/documentation.ipynb).
|
|
37
|
+
|
|
38
|
+
## Citing
|
|
39
|
+
|
|
40
|
+
If you use this library in your work, please cite the paper that first introduces the use of these capabilities:
|
|
41
|
+
|
|
42
|
+
Bussemaker, J.H. et al., 2026, April.
|
|
43
|
+
System Architecture Optimization Using SysML v2: Language Extension and Implementation.
|
|
44
|
+
IEEE SysCon 2026, Halifax, Canada.
|
|
45
|
+
doi: [10.1109/SysCon66367.2026.11503593](https://dx.doi.org/10.1109/SysCon66367.2026.11503593)
|
|
46
|
+
|
|
47
|
+
## Contributing
|
|
48
|
+
|
|
49
|
+
The project is coordinated by: Jasper Bussemaker (*jasper.bussemaker at dlr.de*)
|
|
50
|
+
|
|
51
|
+
If you find a bug or have a feature request, please file an issue using the Github issue tracker.
|
|
52
|
+
If you require support for using the library or want to collaborate, feel free to contact me.
|
|
53
|
+
|
|
54
|
+
Contributions are appreciated too:
|
|
55
|
+
- Fork the repository
|
|
56
|
+
- Add your contributions to the fork
|
|
57
|
+
- Update/add documentation
|
|
58
|
+
- Add tests and make sure they pass (tests are run using `pytest`)
|
|
59
|
+
- Sign a Contributor License Agreement (CLA): *please contact me for the template*
|
|
60
|
+
- Issue a pull request
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=80.0.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "sysmlv2-units"
|
|
7
|
+
authors = [{name = "Jasper Bussemaker", email = "jasper.bussemaker@dlr.de"}]
|
|
8
|
+
description = "SysML v2 Python Units"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license-files = ["LICENSE"]
|
|
11
|
+
keywords = ["sysmlv2", "units", "quantities", "syside", "pint"]
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Intended Audience :: Science/Research",
|
|
14
|
+
"Topic :: Scientific/Engineering",
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
]
|
|
17
|
+
dynamic = ["version"]
|
|
18
|
+
requires-python = ">=3.12"
|
|
19
|
+
dependencies = [
|
|
20
|
+
"syside",
|
|
21
|
+
"pint",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
[project.optional-dependencies]
|
|
25
|
+
test = [
|
|
26
|
+
"pytest"
|
|
27
|
+
]
|
|
28
|
+
nb = [
|
|
29
|
+
"jupyter",
|
|
30
|
+
"ipython",
|
|
31
|
+
"ipykernel",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[tool.setuptools.dynamic]
|
|
35
|
+
version = {attr = "sysmlv2_units.__version__"}
|
|
36
|
+
|
|
37
|
+
[tool.setuptools.packages.find]
|
|
38
|
+
exclude = [
|
|
39
|
+
"tests*",
|
|
40
|
+
]
|
|
41
|
+
namespaces = false
|