numpy-quaddtype 0.0.1__cp310-cp310-win_amd64.whl → 0.1.0__cp310-cp310-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.

@@ -1,25 +1,32 @@
1
1
  """""" # start delvewheel patch
2
- def _delvewheel_patch_1_10_1():
2
+ def _delvewheel_patch_1_11_1():
3
3
  import os
4
4
  if os.path.isdir(libs_dir := os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'numpy_quaddtype.libs'))):
5
5
  os.add_dll_directory(libs_dir)
6
6
 
7
7
 
8
- _delvewheel_patch_1_10_1()
9
- del _delvewheel_patch_1_10_1
8
+ _delvewheel_patch_1_11_1()
9
+ del _delvewheel_patch_1_11_1
10
10
  # end delvewheel patch
11
11
 
12
12
  from ._quaddtype_main import (
13
13
  QuadPrecision,
14
14
  QuadPrecDType,
15
15
  is_longdouble_128,
16
- get_sleef_constant
16
+ get_sleef_constant,
17
+ set_num_threads,
18
+ get_num_threads,
19
+ get_quadblas_version
17
20
  )
18
21
 
19
22
  __all__ = [
20
23
  'QuadPrecision', 'QuadPrecDType', 'SleefQuadPrecision', 'LongDoubleQuadPrecision',
21
- 'SleefQuadPrecDType', 'LongDoubleQuadPrecDType', 'is_longdouble_128', 'pi', 'e',
22
- 'log2e', 'log10e', 'ln2', 'ln10', 'max_value', 'min_value', 'epsilon'
24
+ 'SleefQuadPrecDType', 'LongDoubleQuadPrecDType', 'is_longdouble_128',
25
+ # Constants
26
+ 'pi', 'e', 'log2e', 'log10e', 'ln2', 'ln10', 'max_value', 'epsilon',
27
+ 'smallest_normal', 'smallest_subnormal', 'bits', 'precision', 'resolution',
28
+ # QuadBLAS related functions
29
+ 'set_num_threads', 'get_num_threads', 'get_quadblas_version'
23
30
  ]
24
31
 
25
32
  def SleefQuadPrecision(value):
@@ -40,6 +47,10 @@ log2e = get_sleef_constant("log2e")
40
47
  log10e = get_sleef_constant("log10e")
41
48
  ln2 = get_sleef_constant("ln2")
42
49
  ln10 = get_sleef_constant("ln10")
43
- max_value = get_sleef_constant("quad_max")
44
- min_value = get_sleef_constant("quad_min")
50
+ max_value = get_sleef_constant("max_value")
45
51
  epsilon = get_sleef_constant("epsilon")
52
+ smallest_normal = get_sleef_constant("smallest_normal")
53
+ smallest_subnormal = get_sleef_constant("smallest_subnormal")
54
+ bits = get_sleef_constant("bits")
55
+ precision = get_sleef_constant("precision")
56
+ resolution = get_sleef_constant("resolution")
@@ -0,0 +1,2 @@
1
+ Version: 1.11.1
2
+ Arguments: ['C:\\hostedtoolcache\\windows\\Python\\3.13.7\\x64\\Scripts\\delvewheel', 'repair', '-w', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-hguza28w\\cp310-win_amd64\\repaired_wheel', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-hguza28w\\cp310-win_amd64\\built_wheel\\numpy_quaddtype-0.1.0-cp310-cp310-win_amd64.whl', '--add-path', 'C:\\sleef\\bin']
@@ -0,0 +1,170 @@
1
+ Metadata-Version: 2.1
2
+ Name: numpy_quaddtype
3
+ Version: 0.1.0
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
+ Requires-Dist: pytest-run-parallel; extra == "test"
11
+ Description-Content-Type: text/markdown
12
+
13
+ # Numpy-QuadDType
14
+
15
+ A cross-platform Quad (128-bit) float Data-Type for NumPy.
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ pip install numpy
21
+ pip install numpy-quaddtype
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ```python
27
+ import numpy as np
28
+ from numpy_quaddtype import QuadPrecDType, QuadPrecision
29
+
30
+ # using sleef backend (default)
31
+ np.array([1,2,3], dtype=QuadPrecDType())
32
+ np.array([1,2,3], dtype=QuadPrecDType("sleef"))
33
+
34
+ # using longdouble backend
35
+ np.array([1,2,3], dtype=QuadPrecDType("longdouble"))
36
+ ```
37
+
38
+ ## Installation from source
39
+
40
+ The code needs the quad precision pieces of the sleef library, which is not available on most systems by default, so we have to generate that first. Choose the appropriate section below based on your operating system.
41
+
42
+ ### Linux/Unix/macOS
43
+
44
+ The below assumes one has the required pieces to build sleef (cmake and libmpfr-dev), and that one is in the package directory locally.
45
+
46
+ ```bash
47
+ git clone --branch 3.8 https://github.com/shibatch/sleef.git
48
+ cd sleef
49
+ cmake -S . -B build -DSLEEF_BUILD_QUAD:BOOL=ON -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON
50
+ cmake --build build/ --clean-first -j
51
+ cd ..
52
+ ```
53
+
54
+ Building the `numpy-quaddtype` package from locally installed sleef:
55
+
56
+ ```bash
57
+ export SLEEF_DIR=$PWD/sleef/build
58
+ export LIBRARY_PATH=$SLEEF_DIR/lib
59
+ export C_INCLUDE_PATH=$SLEEF_DIR/include
60
+ export CPLUS_INCLUDE_PATH=$SLEEF_DIR/include
61
+
62
+ # setup the virtual env
63
+ python3 -m venv temp
64
+ source temp/bin/activate
65
+
66
+ # Install the package
67
+ pip install meson-python numpy pytest
68
+
69
+ export LDFLAGS="-Wl,-rpath,$SLEEF_DIR/lib -fopenmp -latomic -lpthread"
70
+ export CFLAGS="-fPIC"
71
+ export CXXFLAGS="-fPIC"
72
+
73
+ # To build without QBLAS (default for MSVC)
74
+ # export CFLAGS="-fPIC -DDISABLE_QUADBLAS"
75
+ # export CXXFLAGS="-fPIC -DDISABLE_QUADBLAS"
76
+
77
+ python -m pip install . -v --no-build-isolation -Cbuilddir=build -C'compile-args=-v'
78
+
79
+ # Run the tests
80
+ cd ..
81
+ python -m pytest
82
+ ```
83
+
84
+ ### Windows
85
+
86
+ #### Prerequisites
87
+
88
+ - **Visual Studio 2017 or later** (with MSVC compiler)
89
+ - **CMake** (≥3.15)
90
+ - **Python 3.10+**
91
+ - **Git**
92
+
93
+ #### Step-by-Step Installation
94
+
95
+ 1. **Setup Development Environment**
96
+
97
+ Open a **Developer Command Prompt for VS** or **Developer PowerShell for VS** to ensure MSVC is properly configured.
98
+
99
+ 2. **Clone and Build SLEEF**
100
+
101
+ ```powershell
102
+ # Clone SLEEF library
103
+ git clone --branch 3.8 https://github.com/shibatch/sleef.git
104
+ cd sleef
105
+
106
+ # Configure with CMake for Windows
107
+ cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -DSLEEF_BUILD_QUAD:BOOL=ON -DSLEEF_BUILD_SHARED_LIBS:BOOL=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON
108
+
109
+ # Build and install SLEEF
110
+ cmake --build build --config Release
111
+ cmake --install build --prefix "C:/sleef" --config Release
112
+
113
+ cd ..
114
+ ```
115
+
116
+ 3. **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 meson-python numpy pytest ninja meson
126
+ ```
127
+
128
+ 4. **Set Environment Variables**
129
+
130
+ ```powershell
131
+ # Set up paths and compiler flags
132
+ $env:INCLUDE = "C:/sleef/include;$env:INCLUDE"
133
+ $env:LIB = "C:/sleef/lib;$env:LIB"
134
+ $env:PATH = "C:/sleef/bin;$env:PATH"
135
+
136
+ # Note: QBLAS is disabled on Windows due to MSVC compatibility issues
137
+ $env:CFLAGS = "/IC:/sleef/include /DDISABLE_QUADBLAS"
138
+ $env:CXXFLAGS = "/IC:/sleef/include /DDISABLE_QUADBLAS"
139
+ $env:LDFLAGS = "C:/sleef/lib/sleef.lib C:/sleef/lib/sleefquad.lib"
140
+ ```
141
+
142
+ 5. **Build and Install numpy-quaddtype**
143
+
144
+ ```powershell
145
+ # Ensure submodules are initialized
146
+ git submodule update --init --recursive
147
+
148
+ # Build and install the package
149
+ python -m pip install . -v --no-build-isolation -Cbuilddir=build -C'compile-args=-v'
150
+ ```
151
+
152
+ 6. **Test Installation**
153
+
154
+ ```powershell
155
+ # Run tests
156
+ pytest -s tests/
157
+ ```
158
+
159
+ 1. **QBLAS Disabled**: QuadBLAS optimization is automatically disabled on Windows builds due to MSVC compatibility issues. This is handled by the `-DDISABLE_QUADBLAS` compiler flag.
160
+
161
+ 2. **Visual Studio Version**: The instructions assume Visual Studio 2022. For other versions, adjust the generator string:
162
+ - VS 2019: `"Visual Studio 16 2019"`
163
+ - VS 2017: `"Visual Studio 15 2017"`
164
+
165
+ 3. **Architecture**: The instructions are for x64. For x86 builds, change `-A x64` to `-A Win32`.
166
+
167
+ 4. **Alternative SLEEF Location**: If you prefer to install SLEEF elsewhere, update all path references accordingly.
168
+
169
+ #### Windows Troubleshooting
170
+ - **Link errors**: Verify that `sleef.lib` and `sleefquad.lib` exist in `C:/sleef/lib/`
@@ -0,0 +1,8 @@
1
+ numpy_quaddtype/_quaddtype_main.cp310-win_amd64.lib,sha256=mDseHdxx74P3eBMk_AF9S9t0tHgE6VruPZpTLicawFE,2156
2
+ numpy_quaddtype/_quaddtype_main.cp310-win_amd64.pyd,sha256=68rfzUvAdz-lguxozR_U7W4EAJR26dC6CH2xpO3FQa8,146944
3
+ numpy_quaddtype/__init__.py,sha256=1wSrRSwIW8PTcW_YLmvwZsNgCIsZvDqcu5WucYIoSHc,1856
4
+ numpy_quaddtype-0.1.0.dist-info/DELVEWHEEL,sha256=izRxTm147xpGDsNuNtNP4u99YGjj3WygUGdNJH3Apx4,396
5
+ numpy_quaddtype-0.1.0.dist-info/METADATA,sha256=vE3pMJIWXPPflvYHU_ln5McTvzkTqxTsB5xHMXK648A,4889
6
+ numpy_quaddtype-0.1.0.dist-info/RECORD,,
7
+ numpy_quaddtype-0.1.0.dist-info/WHEEL,sha256=1nIT8bOU3dBEtO1OHNUw1PB7s17JH9tAQ93SLqU9JNM,85
8
+ numpy_quaddtype.libs/sleefquad-d5670be147816406bcf0cbc42fa078ee.dll,sha256=1WcL4UeBZAa88MvEL6B47poVhLbdgUWaOSVcgeD1vwo,6423040
@@ -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\\cp310-win_amd64\\repaired_wheel', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-86ny83wo\\cp310-win_amd64\\built_wheel\\numpy_quaddtype-0.0.1-cp310-cp310-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.cp310-win_amd64.lib,sha256=otxaLoXS-x0tBkTTdeYpxiVHooeBLZUwIKojRswU8Ow,2156
2
- numpy_quaddtype/_quaddtype_main.cp310-win_amd64.pyd,sha256=-e9tNwARi5zacLAqv1_8wNIw9OZL6HesCz5VGDc_sQk,124416
3
- numpy_quaddtype/__init__.py,sha256=G4-QdckxPWGHafVhGeDjBR5Wx3jO7GcHzD2fOTusg2M,1395
4
- numpy_quaddtype-0.0.1.dist-info/DELVEWHEEL,sha256=yv6E52668jZMPxsDFIXUzwzjPhbN0e-HIO-6eq-6JAw,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=1nIT8bOU3dBEtO1OHNUw1PB7s17JH9tAQ93SLqU9JNM,85
8
- numpy_quaddtype.libs/sleefquad-f9b0d0d7565cf730ea51fea43e8c6b04.dll,sha256=Vf6bagraEzLtf4anfVNmwHp6N1rxS-GbkMK3kvFqDUA,6423040