numpy-quaddtype 0.0.1__cp312-cp312-macosx_11_0_x86_64.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.

@@ -0,0 +1,34 @@
1
+ from ._quaddtype_main import (
2
+ QuadPrecision,
3
+ QuadPrecDType,
4
+ is_longdouble_128,
5
+ get_sleef_constant
6
+ )
7
+
8
+ __all__ = [
9
+ 'QuadPrecision', 'QuadPrecDType', 'SleefQuadPrecision', 'LongDoubleQuadPrecision',
10
+ 'SleefQuadPrecDType', 'LongDoubleQuadPrecDType', 'is_longdouble_128', 'pi', 'e',
11
+ 'log2e', 'log10e', 'ln2', 'ln10', 'max_value', 'min_value', 'epsilon'
12
+ ]
13
+
14
+ def SleefQuadPrecision(value):
15
+ return QuadPrecision(value, backend='sleef')
16
+
17
+ def LongDoubleQuadPrecision(value):
18
+ return QuadPrecision(value, backend='longdouble')
19
+
20
+ def SleefQuadPrecDType():
21
+ return QuadPrecDType(backend='sleef')
22
+
23
+ def LongDoubleQuadPrecDType():
24
+ return QuadPrecDType(backend='longdouble')
25
+
26
+ pi = get_sleef_constant("pi")
27
+ e = get_sleef_constant("e")
28
+ log2e = get_sleef_constant("log2e")
29
+ log10e = get_sleef_constant("log10e")
30
+ ln2 = get_sleef_constant("ln2")
31
+ ln10 = get_sleef_constant("ln10")
32
+ max_value = get_sleef_constant("quad_max")
33
+ min_value = get_sleef_constant("quad_min")
34
+ epsilon = get_sleef_constant("epsilon")
@@ -0,0 +1,69 @@
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
+ ```
@@ -0,0 +1,7 @@
1
+ numpy_quaddtype/__init__.py,sha256=joPVM981Omx64TPH3qKUvi6FvHtO2_gESY_Peb37jmE,1023
2
+ numpy_quaddtype/_quaddtype_main.cpython-312-darwin.so,sha256=4oDrpk09yj4kuA3YfyWUh5vlZPOeQ7-43VPLk1iegjM,220784
3
+ numpy_quaddtype/.dylibs/libsleefquad.3.8.0.dylib,sha256=t_te4KMEL5v_nxrl0b9SvoqC-6D8FKfuRVAGIFJ8AFo,1892016
4
+ numpy_quaddtype/.dylibs/libsleef.3.8.0.dylib,sha256=EGLqKt22sKI4qZghfdMfP9Dql3vRVvlqfy2qHpQYf68,2490112
5
+ numpy_quaddtype-0.0.1.dist-info/RECORD,,
6
+ numpy_quaddtype-0.0.1.dist-info/WHEEL,sha256=iPyjNi4UsT46pvWUqyCPRz-0RXKpDnDVd7BUZsu1QaU,94
7
+ numpy_quaddtype-0.0.1.dist-info/METADATA,sha256=NDKWunrpSUlJpBpdFdsY2zutEOlUefYz-dV-PB9r1D4,1892
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: meson
3
+ Root-Is-Purelib: false
4
+ Tag: cp312-cp312-macosx_11_0_x86_64