numpy-quaddtype 0.2.0__cp310-cp310-macosx_15_0_arm64.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.

Binary file
@@ -0,0 +1,45 @@
1
+ from ._quaddtype_main import (
2
+ QuadPrecision,
3
+ QuadPrecDType,
4
+ is_longdouble_128,
5
+ get_sleef_constant,
6
+ set_num_threads,
7
+ get_num_threads,
8
+ get_quadblas_version
9
+ )
10
+
11
+ __all__ = [
12
+ 'QuadPrecision', 'QuadPrecDType', 'SleefQuadPrecision', 'LongDoubleQuadPrecision',
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'
19
+ ]
20
+
21
+ def SleefQuadPrecision(value):
22
+ return QuadPrecision(value, backend='sleef')
23
+
24
+ def LongDoubleQuadPrecision(value):
25
+ return QuadPrecision(value, backend='longdouble')
26
+
27
+ def SleefQuadPrecDType():
28
+ return QuadPrecDType(backend='sleef')
29
+
30
+ def LongDoubleQuadPrecDType():
31
+ return QuadPrecDType(backend='longdouble')
32
+
33
+ pi = get_sleef_constant("pi")
34
+ e = get_sleef_constant("e")
35
+ log2e = get_sleef_constant("log2e")
36
+ log10e = get_sleef_constant("log10e")
37
+ ln2 = get_sleef_constant("ln2")
38
+ ln10 = get_sleef_constant("ln10")
39
+ max_value = get_sleef_constant("max_value")
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")
@@ -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/__init__.py,sha256=njWfTVMx1d6awqZvqo4WJW6jojpW3FHKoaJTuifDQKg,1474
2
+ numpy_quaddtype/_quaddtype_main.cpython-310-darwin.so,sha256=LjnkfY4nm03DPCfBZ_vBbJo9NKWBb7nRGHm7rv-UOU8,969776
3
+ numpy_quaddtype/.dylibs/libomp.dylib,sha256=TetJcKAnscIzkrv0AiLUTjJFKbqUQcEAh-fX8gY5sR8,743584
4
+ numpy_quaddtype-0.2.0.dist-info/RECORD,,
5
+ numpy_quaddtype-0.2.0.dist-info/LICENSE,sha256=R89YvpdHKGUqld_OR6jHwcDC34rEF7bEHy8FHu6wX7E,1538
6
+ numpy_quaddtype-0.2.0.dist-info/WHEEL,sha256=4r7Y2xP6X16bhJnOmdsMK_LtO55O5S8bodEUs8nDQZw,122
7
+ numpy_quaddtype-0.2.0.dist-info/METADATA,sha256=zI0Gb9y2n49dukTAgVAmQNZlZ7o5AS5vnwinHkiXiJU,4653
@@ -0,0 +1,6 @@
1
+ Wheel-Version: 1.0
2
+ Generator: meson
3
+ Root-Is-Purelib: false
4
+ Tag: cp310-cp310-macosx_15_0_arm64
5
+ Generator: delocate 0.13.0
6
+