numpy-quaddtype 0.0.1__cp312-cp312-win_amd64.whl → 0.2.0__cp312-cp312-win_amd64.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.
Potentially problematic release.
This version of numpy-quaddtype might be problematic. Click here for more details.
- numpy_quaddtype/__init__.py +16 -16
- numpy_quaddtype/_quaddtype_main.cp312-win_amd64.lib +0 -0
- numpy_quaddtype/_quaddtype_main.cp312-win_amd64.pyd +0 -0
- numpy_quaddtype-0.2.0.dist-info/LICENSE +30 -0
- numpy_quaddtype-0.2.0.dist-info/METADATA +157 -0
- numpy_quaddtype-0.2.0.dist-info/RECORD +7 -0
- numpy_quaddtype-0.0.1.dist-info/DELVEWHEEL +0 -2
- numpy_quaddtype-0.0.1.dist-info/METADATA +0 -69
- numpy_quaddtype-0.0.1.dist-info/RECORD +0 -8
- numpy_quaddtype.libs/sleefquad-f9b0d0d7565cf730ea51fea43e8c6b04.dll +0 -0
- {numpy_quaddtype-0.0.1.dist-info → numpy_quaddtype-0.2.0.dist-info}/WHEEL +0 -0
numpy_quaddtype/__init__.py
CHANGED
|
@@ -1,25 +1,21 @@
|
|
|
1
|
-
"""""" # start delvewheel patch
|
|
2
|
-
def _delvewheel_patch_1_10_1():
|
|
3
|
-
import os
|
|
4
|
-
if os.path.isdir(libs_dir := os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'numpy_quaddtype.libs'))):
|
|
5
|
-
os.add_dll_directory(libs_dir)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
_delvewheel_patch_1_10_1()
|
|
9
|
-
del _delvewheel_patch_1_10_1
|
|
10
|
-
# end delvewheel patch
|
|
11
|
-
|
|
12
1
|
from ._quaddtype_main import (
|
|
13
2
|
QuadPrecision,
|
|
14
3
|
QuadPrecDType,
|
|
15
4
|
is_longdouble_128,
|
|
16
|
-
get_sleef_constant
|
|
5
|
+
get_sleef_constant,
|
|
6
|
+
set_num_threads,
|
|
7
|
+
get_num_threads,
|
|
8
|
+
get_quadblas_version
|
|
17
9
|
)
|
|
18
10
|
|
|
19
11
|
__all__ = [
|
|
20
12
|
'QuadPrecision', 'QuadPrecDType', 'SleefQuadPrecision', 'LongDoubleQuadPrecision',
|
|
21
|
-
'SleefQuadPrecDType', 'LongDoubleQuadPrecDType', 'is_longdouble_128',
|
|
22
|
-
|
|
13
|
+
'SleefQuadPrecDType', 'LongDoubleQuadPrecDType', 'is_longdouble_128',
|
|
14
|
+
# Constants
|
|
15
|
+
'pi', 'e', 'log2e', 'log10e', 'ln2', 'ln10', 'max_value', 'epsilon',
|
|
16
|
+
'smallest_normal', 'smallest_subnormal', 'bits', 'precision', 'resolution',
|
|
17
|
+
# QuadBLAS related functions
|
|
18
|
+
'set_num_threads', 'get_num_threads', 'get_quadblas_version'
|
|
23
19
|
]
|
|
24
20
|
|
|
25
21
|
def SleefQuadPrecision(value):
|
|
@@ -40,6 +36,10 @@ log2e = get_sleef_constant("log2e")
|
|
|
40
36
|
log10e = get_sleef_constant("log10e")
|
|
41
37
|
ln2 = get_sleef_constant("ln2")
|
|
42
38
|
ln10 = get_sleef_constant("ln10")
|
|
43
|
-
max_value = get_sleef_constant("
|
|
44
|
-
min_value = get_sleef_constant("quad_min")
|
|
39
|
+
max_value = get_sleef_constant("max_value")
|
|
45
40
|
epsilon = get_sleef_constant("epsilon")
|
|
41
|
+
smallest_normal = get_sleef_constant("smallest_normal")
|
|
42
|
+
smallest_subnormal = get_sleef_constant("smallest_subnormal")
|
|
43
|
+
bits = get_sleef_constant("bits")
|
|
44
|
+
precision = get_sleef_constant("precision")
|
|
45
|
+
resolution = get_sleef_constant("resolution")
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Copyright (c) 2022, NumPy Developers.
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
|
5
|
+
modification, are permitted provided that the following conditions are
|
|
6
|
+
met:
|
|
7
|
+
|
|
8
|
+
* Redistributions of source code must retain the above copyright
|
|
9
|
+
notice, this list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
* Redistributions in binary form must reproduce the above
|
|
12
|
+
copyright notice, this list of conditions and the following
|
|
13
|
+
disclaimer in the documentation and/or other materials provided
|
|
14
|
+
with the distribution.
|
|
15
|
+
|
|
16
|
+
* Neither the name of the NumPy Developers nor the names of any
|
|
17
|
+
contributors may be used to endorse or promote products derived
|
|
18
|
+
from this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
21
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
22
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
23
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
24
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
25
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
26
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
27
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
28
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
29
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
30
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: numpy_quaddtype
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Quad (128-bit) float dtype for numpy
|
|
5
|
+
Author-Email: Swayam Singh <singhswayam008@gmail.com>
|
|
6
|
+
License: Copyright (c) 2022, NumPy Developers.
|
|
7
|
+
All rights reserved.
|
|
8
|
+
|
|
9
|
+
Redistribution and use in source and binary forms, with or without
|
|
10
|
+
modification, are permitted provided that the following conditions are
|
|
11
|
+
met:
|
|
12
|
+
|
|
13
|
+
* Redistributions of source code must retain the above copyright
|
|
14
|
+
notice, this list of conditions and the following disclaimer.
|
|
15
|
+
|
|
16
|
+
* Redistributions in binary form must reproduce the above
|
|
17
|
+
copyright notice, this list of conditions and the following
|
|
18
|
+
disclaimer in the documentation and/or other materials provided
|
|
19
|
+
with the distribution.
|
|
20
|
+
|
|
21
|
+
* Neither the name of the NumPy Developers nor the names of any
|
|
22
|
+
contributors may be used to endorse or promote products derived
|
|
23
|
+
from this software without specific prior written permission.
|
|
24
|
+
|
|
25
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
26
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
27
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
28
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
29
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
30
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
31
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
32
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
33
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
34
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
35
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
36
|
+
|
|
37
|
+
Requires-Python: >=3.10.0
|
|
38
|
+
Requires-Dist: numpy
|
|
39
|
+
Provides-Extra: test
|
|
40
|
+
Requires-Dist: pytest; extra == "test"
|
|
41
|
+
Requires-Dist: pytest-run-parallel; extra == "test"
|
|
42
|
+
Description-Content-Type: text/markdown
|
|
43
|
+
|
|
44
|
+
# Numpy-QuadDType
|
|
45
|
+
|
|
46
|
+
A cross-platform Quad (128-bit) float Data-Type for NumPy.
|
|
47
|
+
|
|
48
|
+
## Installation
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install numpy
|
|
52
|
+
pip install numpy-quaddtype
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Usage
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
import numpy as np
|
|
59
|
+
from numpy_quaddtype import QuadPrecDType, QuadPrecision
|
|
60
|
+
|
|
61
|
+
# using sleef backend (default)
|
|
62
|
+
np.array([1,2,3], dtype=QuadPrecDType())
|
|
63
|
+
np.array([1,2,3], dtype=QuadPrecDType("sleef"))
|
|
64
|
+
|
|
65
|
+
# using longdouble backend
|
|
66
|
+
np.array([1,2,3], dtype=QuadPrecDType("longdouble"))
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Installation from source
|
|
70
|
+
|
|
71
|
+
#### Prerequisites
|
|
72
|
+
|
|
73
|
+
- **gcc/clang**
|
|
74
|
+
- **CMake** (≥3.15)
|
|
75
|
+
- **Python 3.10+**
|
|
76
|
+
- **Git**
|
|
77
|
+
|
|
78
|
+
### Linux/Unix/macOS
|
|
79
|
+
|
|
80
|
+
Building the `numpy-quaddtype` package:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# setup the virtual env
|
|
84
|
+
python3 -m venv temp
|
|
85
|
+
source temp/bin/activate
|
|
86
|
+
|
|
87
|
+
# Install the package
|
|
88
|
+
pip install numpy pytest
|
|
89
|
+
|
|
90
|
+
# To build without QBLAS (default for MSVC)
|
|
91
|
+
# export CFLAGS="-DDISABLE_QUADBLAS"
|
|
92
|
+
# export CXXFLAGS="-DDISABLE_QUADBLAS"
|
|
93
|
+
|
|
94
|
+
python -m pip install . -v
|
|
95
|
+
|
|
96
|
+
# Run the tests
|
|
97
|
+
cd ..
|
|
98
|
+
python -m pytest
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Windows
|
|
102
|
+
|
|
103
|
+
#### Prerequisites
|
|
104
|
+
|
|
105
|
+
- **Visual Studio 2017 or later** (with MSVC compiler)
|
|
106
|
+
- **CMake** (≥3.15)
|
|
107
|
+
- **Python 3.10+**
|
|
108
|
+
- **Git**
|
|
109
|
+
|
|
110
|
+
#### Step-by-Step Installation
|
|
111
|
+
|
|
112
|
+
1. **Setup Development Environment**
|
|
113
|
+
|
|
114
|
+
Open a **Developer Command Prompt for VS** or **Developer PowerShell for VS** to ensure MSVC is properly configured.
|
|
115
|
+
|
|
116
|
+
2. **Setup Python Environment**
|
|
117
|
+
|
|
118
|
+
```powershell
|
|
119
|
+
# Create and activate virtual environment
|
|
120
|
+
python -m venv numpy_quad_env
|
|
121
|
+
.\numpy_quad_env\Scripts\Activate.ps1
|
|
122
|
+
|
|
123
|
+
# Install build dependencies
|
|
124
|
+
pip install -U pip
|
|
125
|
+
pip install numpy pytest ninja meson
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
3. **Set Environment Variables**
|
|
129
|
+
|
|
130
|
+
```powershell
|
|
131
|
+
# Note: QBLAS is disabled on Windows due to MSVC compatibility issues
|
|
132
|
+
$env:CFLAGS = "/DDISABLE_QUADBLAS"
|
|
133
|
+
$env:CXXFLAGS = "/DDISABLE_QUADBLAS"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
4. **Build and Install numpy-quaddtype**
|
|
137
|
+
|
|
138
|
+
```powershell
|
|
139
|
+
# Build and install the package
|
|
140
|
+
python -m pip install . -v
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
5. **Test Installation**
|
|
144
|
+
|
|
145
|
+
```powershell
|
|
146
|
+
# Run tests
|
|
147
|
+
pytest -s tests/
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
6. **QBLAS Disabled**: QuadBLAS optimization is automatically disabled on Windows builds due to MSVC compatibility issues. This is handled by the `-DDISABLE_QUADBLAS` compiler flag.
|
|
151
|
+
|
|
152
|
+
7. **Visual Studio Version**: The instructions assume Visual Studio 2022. For other versions, adjust the generator string:
|
|
153
|
+
|
|
154
|
+
- VS 2019: `"Visual Studio 16 2019"`
|
|
155
|
+
- VS 2017: `"Visual Studio 15 2017"`
|
|
156
|
+
|
|
157
|
+
8. **Architecture**: The instructions are for x64. For x86 builds, change `-A x64` to `-A Win32`.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
numpy_quaddtype-0.2.0.dist-info/METADATA,sha256=zI0Gb9y2n49dukTAgVAmQNZlZ7o5AS5vnwinHkiXiJU,4653
|
|
2
|
+
numpy_quaddtype-0.2.0.dist-info/WHEEL,sha256=50PeAbplA6PkI0hYOYoeacB9US1R6EguyfOnsccH0WU,85
|
|
3
|
+
numpy_quaddtype-0.2.0.dist-info/LICENSE,sha256=nQvogdRSuRW36bqrc8M5o4mV-NjNIClAmAwZr970158,1568
|
|
4
|
+
numpy_quaddtype/_quaddtype_main.cp312-win_amd64.pyd,sha256=UOfs7jnAwyn22Q1g42f0FvSsQRLZ9aPnUWW_2rU33gs,913408
|
|
5
|
+
numpy_quaddtype/_quaddtype_main.cp312-win_amd64.lib,sha256=DZm3k9_Ofo-zfiDVnnPARMhgdOX_-Th2-1C882QfHjE,2156
|
|
6
|
+
numpy_quaddtype/__init__.py,sha256=XQp9mkhPrbVbM0wHkrgbJEr8tbeipKbxf47UY8XcyuQ,1519
|
|
7
|
+
numpy_quaddtype-0.2.0.dist-info/RECORD,,
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
Version: 1.10.1
|
|
2
|
-
Arguments: ['C:\\hostedtoolcache\\windows\\Python\\3.10.11\\x64\\Scripts\\delvewheel', 'repair', '-w', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-86ny83wo\\cp312-win_amd64\\repaired_wheel', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-86ny83wo\\cp312-win_amd64\\built_wheel\\numpy_quaddtype-0.0.1-cp312-cp312-win_amd64.whl', '--add-path', 'C:\\sleef\\bin']
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: numpy_quaddtype
|
|
3
|
-
Version: 0.0.1
|
|
4
|
-
Summary: Quad (128-bit) float dtype for numpy
|
|
5
|
-
Author-Email: Swayam Singh <singhswayam008@gmail.com>
|
|
6
|
-
Requires-Python: >=3.10.0
|
|
7
|
-
Requires-Dist: numpy
|
|
8
|
-
Provides-Extra: test
|
|
9
|
-
Requires-Dist: pytest; extra == "test"
|
|
10
|
-
Description-Content-Type: text/markdown
|
|
11
|
-
|
|
12
|
-
# Numpy-QuadDType
|
|
13
|
-
|
|
14
|
-
## Installation
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
pip install numpy==2.1.0
|
|
18
|
-
pip install -i https://test.pypi.org/simple/ quaddtype
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
22
|
-
|
|
23
|
-
```python
|
|
24
|
-
import numpy as np
|
|
25
|
-
from numpy_quaddtype import QuadPrecDType, QuadPrecision
|
|
26
|
-
|
|
27
|
-
# using sleef backend (default)
|
|
28
|
-
np.array([1,2,3], dtype=QuadPrecDType())
|
|
29
|
-
np.array([1,2,3], dtype=QuadPrecDType("sleef"))
|
|
30
|
-
|
|
31
|
-
# using longdouble backend
|
|
32
|
-
np.array([1,2,3], dtype=QuadPrecDType("longdouble"))
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Install from source
|
|
36
|
-
|
|
37
|
-
The code needs the quad precision pieces of the sleef library, which
|
|
38
|
-
is not available on most systems by default, so we have to generate
|
|
39
|
-
that first. The below assumes one has the required pieces to build
|
|
40
|
-
sleef (cmake and libmpfr-dev), and that one is in the package
|
|
41
|
-
directory locally.
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
git clone https://github.com/shibatch/sleef.git
|
|
45
|
-
cd sleef
|
|
46
|
-
cmake -S . -B build -DSLEEF_BUILD_QUAD:BOOL=ON -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
|
47
|
-
cmake --build build/ --clean-first -j
|
|
48
|
-
cd ..
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
In principle, one can now install this system-wide, but easier would
|
|
52
|
-
seem to use the version that was just created, as follows:
|
|
53
|
-
```
|
|
54
|
-
export SLEEF_DIR=$PWD/sleef/build
|
|
55
|
-
export LIBRARY_PATH=$SLEEF_DIR/lib
|
|
56
|
-
export C_INCLUDE_PATH=$SLEEF_DIR/include
|
|
57
|
-
export CPLUS_INCLUDE_PATH=$SLEEF_DIR/include
|
|
58
|
-
python3 -m venv temp
|
|
59
|
-
source temp/bin/activate
|
|
60
|
-
pip install meson-python numpy pytest
|
|
61
|
-
pip install -e . -v --no-build-isolation
|
|
62
|
-
export LD_LIBRARY_PATH=$SLEEF_DIR/lib
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Here, we created an editable install on purpose, so one can just work
|
|
66
|
-
from the package directory if needed, e.g., to run the tests with,
|
|
67
|
-
```
|
|
68
|
-
python -m pytest
|
|
69
|
-
```
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
numpy_quaddtype/_quaddtype_main.cp312-win_amd64.lib,sha256=9TydyIEYkzOmC-2FP6Dgugl6A4HvUsSFlAzkBie6MQE,2156
|
|
2
|
-
numpy_quaddtype/_quaddtype_main.cp312-win_amd64.pyd,sha256=ruln0zED8F9a0-nBYrt_-mV8rg7z8mI2ZDUd0fqxcck,126976
|
|
3
|
-
numpy_quaddtype/__init__.py,sha256=G4-QdckxPWGHafVhGeDjBR5Wx3jO7GcHzD2fOTusg2M,1395
|
|
4
|
-
numpy_quaddtype-0.0.1.dist-info/DELVEWHEEL,sha256=Nr9Z8LtClkryQUTo9PmR2fdm5mI1L8rl2HJpkfxsuAQ,397
|
|
5
|
-
numpy_quaddtype-0.0.1.dist-info/METADATA,sha256=NDKWunrpSUlJpBpdFdsY2zutEOlUefYz-dV-PB9r1D4,1892
|
|
6
|
-
numpy_quaddtype-0.0.1.dist-info/RECORD,,
|
|
7
|
-
numpy_quaddtype-0.0.1.dist-info/WHEEL,sha256=50PeAbplA6PkI0hYOYoeacB9US1R6EguyfOnsccH0WU,85
|
|
8
|
-
numpy_quaddtype.libs/sleefquad-f9b0d0d7565cf730ea51fea43e8c6b04.dll,sha256=Vf6bagraEzLtf4anfVNmwHp6N1rxS-GbkMK3kvFqDUA,6423040
|
|
Binary file
|
|
File without changes
|