flexfloat 0.1.0__py3-none-any.whl → 0.1.2__py3-none-any.whl

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.
flexfloat/types.py CHANGED
@@ -1,5 +1,5 @@
1
- """Type definitions for the flexfloat package."""
2
-
3
- from typing import TypeAlias
4
-
5
- Number: TypeAlias = int | float
1
+ """Type definitions for the flexfloat package."""
2
+
3
+ from typing import TypeAlias
4
+
5
+ Number: TypeAlias = int | float
@@ -1,82 +1,147 @@
1
- Metadata-Version: 2.4
2
- Name: flexfloat
3
- Version: 0.1.0
4
- Summary: A library for arbitrary precision floating point arithmetic
5
- Author: Ferran Sanchez Llado
6
- License: MIT
7
- Classifier: Development Status :: 3 - Alpha
8
- Classifier: Intended Audience :: Developers
9
- Classifier: Intended Audience :: Science/Research
10
- Classifier: License :: OSI Approved :: MIT License
11
- Classifier: Operating System :: OS Independent
12
- Classifier: Programming Language :: Python :: 3
13
- Classifier: Programming Language :: Python :: 3.11
14
- Classifier: Programming Language :: Python :: 3.12
15
- Classifier: Topic :: Scientific/Engineering :: Mathematics
16
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
- Requires-Python: >=3.11
18
- Description-Content-Type: text/markdown
19
- Provides-Extra: dev
20
- Requires-Dist: pytest>=7.0; extra == "dev"
21
- Requires-Dist: pytest-cov>=4.0; extra == "dev"
22
- Requires-Dist: black>=23.0; extra == "dev"
23
- Requires-Dist: isort>=5.0; extra == "dev"
24
- Requires-Dist: mypy>=1.0; extra == "dev"
25
- Requires-Dist: pylint>=3.0; extra == "dev"
26
- Requires-Dist: flake8>=6.0; extra == "dev"
27
-
28
- # FlexFloat
29
-
30
- A Python library for arbitrary precision floating point arithmetic with a flexible exponent and fixed-size fraction.
31
-
32
- ## Features
33
-
34
- - **Growable Exponents**: Handle very large or very small numbers by dynamically adjusting the exponent size
35
- - **Fixed-Size Fractions**: Maintain precision consistency with IEEE 754-compatible 52-bit fractions
36
- - **IEEE 754 Compatibility**: Follows IEEE 754 double-precision format as the baseline
37
- - **Special Value Support**: Handles NaN, positive/negative infinity, and zero values
38
- - **Arithmetic Operations**: Addition and subtraction with proper overflow/underflow handling
39
-
40
- ## Installation
41
-
42
- ```bash
43
- pip install flexfloat
44
- ```
45
-
46
- ## Development Installation
47
-
48
- ```bash
49
- pip install -e ".[dev]"
50
- ```
51
-
52
- ## Usage
53
-
54
- ```python
55
- from flexfloat import FlexFloat
56
-
57
- # Create FlexFloat instances
58
- a = FlexFloat.from_float(1.5)
59
- b = FlexFloat.from_float(2.5)
60
-
61
- # Perform arithmetic operations
62
- result = a + b
63
- print(result.to_float()) # 4.0
64
-
65
- # Handle very large numbers
66
- large_a = FlexFloat.from_float(1e308)
67
- large_b = FlexFloat.from_float(1e308)
68
- large_result = large_a + large_b
69
- # Result has grown exponent to handle overflow
70
- print(len(large_result.exponent)) # > 11 (grows beyond IEEE 754 standard)
71
- ```
72
-
73
- ## Running Tests
74
-
75
- ```bash
76
- python -m pytest tests
77
- ```
78
-
79
-
80
- ## License
81
-
82
- MIT License
1
+ Metadata-Version: 2.4
2
+ Name: flexfloat
3
+ Version: 0.1.2
4
+ Summary: A library for arbitrary precision floating point arithmetic
5
+ Author: Ferran Sanchez Llado
6
+ License: MIT
7
+ Classifier: Development Status :: 3 - Alpha
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: Intended Audience :: Science/Research
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
16
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
+ Requires-Python: >=3.11
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Provides-Extra: dev
21
+ Requires-Dist: pytest>=7.0; extra == "dev"
22
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
23
+ Requires-Dist: black>=23.0; extra == "dev"
24
+ Requires-Dist: isort>=5.0; extra == "dev"
25
+ Requires-Dist: mypy>=1.0; extra == "dev"
26
+ Requires-Dist: pylint>=3.0; extra == "dev"
27
+ Requires-Dist: flake8>=6.0; extra == "dev"
28
+ Requires-Dist: bump2version>=1.0; extra == "dev"
29
+ Requires-Dist: build>=0.10; extra == "dev"
30
+ Requires-Dist: twine>=4.0; extra == "dev"
31
+ Requires-Dist: check-manifest>=0.49; extra == "dev"
32
+ Requires-Dist: PyYAML>=6.0; extra == "dev"
33
+ Dynamic: license-file
34
+
35
+ # FlexFloat
36
+
37
+ A Python library for arbitrary precision floating point arithmetic with a flexible exponent and fixed-size fraction.
38
+
39
+ ## Features
40
+
41
+ - **Growable Exponents**: Handle very large or very small numbers by dynamically adjusting the exponent size
42
+ - **Fixed-Size Fractions**: Maintain precision consistency with IEEE 754-compatible 52-bit fractions
43
+ - **IEEE 754 Compatibility**: Follows IEEE 754 double-precision format as the baseline
44
+ - **Special Value Support**: Handles NaN, positive/negative infinity, and zero values
45
+ - **Arithmetic Operations**: Addition and subtraction with proper overflow/underflow handling
46
+
47
+ ## Installation
48
+
49
+ ```bash
50
+ pip install flexfloat
51
+ ```
52
+
53
+ ## Development Installation
54
+
55
+ ```bash
56
+ pip install -e ".[dev]"
57
+ ```
58
+
59
+ ## Usage
60
+
61
+ ```python
62
+ from flexfloat import FlexFloat
63
+
64
+ # Create FlexFloat instances
65
+ a = FlexFloat.from_float(1.5)
66
+ b = FlexFloat.from_float(2.5)
67
+
68
+ # Perform arithmetic operations
69
+ result = a + b
70
+ print(result.to_float()) # 4.0
71
+
72
+ # Handle very large numbers
73
+ large_a = FlexFloat.from_float(1e308)
74
+ large_b = FlexFloat.from_float(1e308)
75
+ large_result = large_a + large_b
76
+ # Result has grown exponent to handle overflow
77
+ print(len(large_result.exponent)) # > 11 (grows beyond IEEE 754 standard)
78
+ ```
79
+
80
+ ## Running Tests
81
+
82
+ ```bash
83
+ python -m pytest tests
84
+ ```
85
+
86
+ ## CI/CD and Release Process
87
+
88
+ This project uses automated CI/CD workflows for building, testing, and releasing:
89
+
90
+ ### Automatic Releases
91
+
92
+ When a Pull Request is merged to the `main` branch:
93
+
94
+ 1. **Version Detection**: The system analyzes commit messages and PR labels to determine the version bump type:
95
+ - `major`: Breaking changes (e.g., commit messages with "BREAKING CHANGE")
96
+ - `minor`: New features (e.g., commit messages starting with "feat:")
97
+ - `patch`: Bug fixes and other changes (default)
98
+
99
+ 2. **Version Update**: All version references are automatically updated:
100
+ - `pyproject.toml`
101
+ - `flexfloat/__init__.py`
102
+
103
+ 3. **Automated Publishing**:
104
+ - Package is built and tested
105
+ - New Git tag is created (e.g., `v0.2.0`)
106
+ - GitHub Release is created with artifacts
107
+ - Package is published to PyPI
108
+
109
+ ### Manual Releases
110
+
111
+ You can also trigger releases manually:
112
+
113
+ 1. Go to the "Actions" tab in GitHub
114
+ 2. Select "Manual Release" workflow
115
+ 3. Choose the version bump type and add release notes
116
+ 4. Run the workflow
117
+
118
+ ### Version Bump Labels
119
+
120
+ Add these labels to your PRs to control version bumping:
121
+ - `major` - For breaking changes
122
+ - `minor` - For new features
123
+ - `patch` - For bug fixes (default)
124
+
125
+ ### PyPI Setup
126
+
127
+ To enable automatic PyPI publishing, configure trusted publishing:
128
+
129
+ 1. Go to [PyPI](https://pypi.org/manage/account/publishing/)
130
+ 2. Add a trusted publisher for your GitHub repository
131
+ 3. Set the workflow name to `release.yml` or `manual-release.yml`
132
+
133
+ ### Development Workflow
134
+
135
+ 1. Create a feature branch from `main`
136
+ 2. Make your changes
137
+ 3. Create a Pull Request
138
+ 4. The CI will automatically:
139
+ - Run tests and linting
140
+ - Check version consistency
141
+ - Suggest version bump type
142
+ - Build and validate the package
143
+ 5. When merged, automatic release is triggered
144
+
145
+ ## License
146
+
147
+ MIT License
@@ -0,0 +1,10 @@
1
+ flexfloat/__init__.py,sha256=OFbzrKWdmpnX85VTA37dOj1pcNdn4IOUx45u-RUg4ls,365
2
+ flexfloat/bitarray.py,sha256=HbManwfCgoAB3YDSeBWq7QnX64L03A4i5g6UU_wOeoo,8939
3
+ flexfloat/core.py,sha256=z1W4Ma4ftAnSTICvrNiMNaGHJVVqv9tf5BmwiXSl1qU,28043
4
+ flexfloat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ flexfloat/types.py,sha256=_vRC7gQl5ua76QfKco4L3jQ4uPtEPUxPNGy4zWBFbns,113
6
+ flexfloat-0.1.2.dist-info/licenses/LICENSE,sha256=uwwkK--SUYUV3lbrv9kXJ_vDiYfHVb-t732g6c4qg7Q,1077
7
+ flexfloat-0.1.2.dist-info/METADATA,sha256=fJt-FNO9BBmdROleg1zSnsrTaAA1oYPsPyt6LOV4m7o,4441
8
+ flexfloat-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
9
+ flexfloat-0.1.2.dist-info/top_level.txt,sha256=82S8dY2UoNZh-9pwg7tUvbwB3uw2s3mfEoyUW6vCMdU,10
10
+ flexfloat-0.1.2.dist-info/RECORD,,
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Ferran Sanchez Llado
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.
@@ -1,9 +0,0 @@
1
- flexfloat/__init__.py,sha256=fvimTZm80CHm8bp11bID5twYoISERcatgx21snQxsz8,378
2
- flexfloat/bitarray.py,sha256=Ss0bZUUpfsBPJkPaGymXd2O-4e-UCanUva_encnc4MI,9172
3
- flexfloat/core.py,sha256=KK8LfRlqReZuVgyN-fQwYDsM1TlaJtYjHcafPYSPZeQ,27570
4
- flexfloat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- flexfloat/types.py,sha256=SFTYmG3BHLiCJc0LvNwOnByRLRcRXH2erINeqLyHLKs,118
6
- flexfloat-0.1.0.dist-info/METADATA,sha256=8QUYOP_vFgljckHUm02jixPFfDYkt-XZdW5Wahm8TbQ,2459
7
- flexfloat-0.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
- flexfloat-0.1.0.dist-info/top_level.txt,sha256=82S8dY2UoNZh-9pwg7tUvbwB3uw2s3mfEoyUW6vCMdU,10
9
- flexfloat-0.1.0.dist-info/RECORD,,