pylibsparseir 0.5.2__cp311-cp311-macosx_15_0_arm64.whl → 0.6.0__cp311-cp311-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 pylibsparseir might be problematic. Click here for more details.

pylibsparseir/core.py CHANGED
@@ -75,8 +75,9 @@ try:
75
75
  _lib.spir_register_dgemm(ptr)
76
76
  _lib.spir_register_zgemm.argtypes = [ctypes.c_void_p]
77
77
  _lib.spir_register_zgemm(ptr_z)
78
- print(f"[core.py] Registered SciPy BLAS dgemm @ {hex(ptr)}")
79
- print(f"[core.py] Registered SciPy BLAS zgemm @ {hex(ptr_z)}")
78
+ if os.environ.get("SPARSEIR_DEBUG", "").lower() in ("1", "true", "yes", "on"):
79
+ print(f"[core.py] Registered SciPy BLAS dgemm @ {hex(ptr)}")
80
+ print(f"[core.py] Registered SciPy BLAS zgemm @ {hex(ptr_z)}")
80
81
  except Exception as e:
81
82
  raise RuntimeError(f"Failed to load SparseIR library: {e}")
82
83
 
@@ -172,11 +173,11 @@ def _setup_prototypes():
172
173
  ]
173
174
  _lib.spir_funcs_batch_eval_matsu.restype = c_int
174
175
 
175
- _lib.spir_funcs_get_n_roots.argtypes = [spir_funcs, POINTER(c_int)]
176
- _lib.spir_funcs_get_n_roots.restype = c_int
176
+ _lib.spir_funcs_get_n_knots.argtypes = [spir_funcs, POINTER(c_int)]
177
+ _lib.spir_funcs_get_n_knots.restype = c_int
177
178
 
178
- _lib.spir_funcs_get_roots.argtypes = [spir_funcs, POINTER(c_double)]
179
- _lib.spir_funcs_get_roots.restype = c_int
179
+ _lib.spir_funcs_get_knots.argtypes = [spir_funcs, POINTER(c_double)]
180
+ _lib.spir_funcs_get_knots.restype = c_int
180
181
 
181
182
  # Default sampling points
182
183
  _lib.spir_basis_get_n_default_taus.argtypes = [spir_basis, POINTER(c_int)]
@@ -524,24 +525,24 @@ def funcs_eval_single_complex128(funcs, x):
524
525
  return out
525
526
 
526
527
 
527
- def funcs_get_n_roots(funcs):
528
- """Get the number of roots of the basis functions."""
529
- n_roots = c_int()
530
- status = _lib.spir_funcs_get_n_roots(funcs, byref(n_roots))
528
+ def funcs_get_n_knots(funcs):
529
+ """Get the number of knots of the underlying piecewise Legendre polynomial."""
530
+ n_knots = c_int()
531
+ status = _lib.spir_funcs_get_n_knots(funcs, byref(n_knots))
531
532
  if status != COMPUTATION_SUCCESS:
532
- raise RuntimeError(f"Failed to get number of roots: {status}")
533
- return n_roots.value
533
+ raise RuntimeError(f"Failed to get number of knots: {status}")
534
+ return n_knots.value
534
535
 
535
536
 
536
- def funcs_get_roots(funcs):
537
- """Get the roots of the basis functions."""
538
- n_roots = funcs_get_n_roots(funcs)
539
- roots = np.zeros(n_roots, dtype=np.float64)
540
- status = _lib.spir_funcs_get_roots(
541
- funcs, roots.ctypes.data_as(POINTER(c_double)))
537
+ def funcs_get_knots(funcs):
538
+ """Get the knots of the underlying piecewise Legendre polynomial."""
539
+ n_knots = funcs_get_n_knots(funcs)
540
+ knots = np.zeros(n_knots, dtype=np.float64)
541
+ status = _lib.spir_funcs_get_knots(
542
+ funcs, knots.ctypes.data_as(POINTER(c_double)))
542
543
  if status != COMPUTATION_SUCCESS:
543
- raise RuntimeError(f"Failed to get roots: {status}")
544
- return roots
544
+ raise RuntimeError(f"Failed to get knots: {status}")
545
+ return knots
545
546
 
546
547
 
547
548
  def basis_get_default_tau_sampling_points(basis):
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pylibsparseir
3
- Version: 0.5.2
3
+ Version: 0.6.0
4
4
  Summary: Python bindings for the libsparseir library
5
5
  Maintainer: SpM-lab
6
6
  License: MIT License
@@ -41,7 +41,7 @@ Project-URL: Documentation, https://github.com/SpM-lab/libsparseir
41
41
  Project-URL: Repository, https://github.com/SpM-lab/libsparseir
42
42
  Project-URL: Issues, https://github.com/SpM-lab/libsparseir/issues
43
43
  Requires-Python: >=3.10
44
- Requires-Dist: numpy>=2.0.0
44
+ Requires-Dist: numpy>=1.26.4
45
45
  Requires-Dist: scipy
46
46
  Description-Content-Type: text/markdown
47
47
 
@@ -54,26 +54,17 @@ This is a low-level binding for the [libsparseir](https://github.com/SpM-lab/lib
54
54
  - Python >= 3.10
55
55
  - CMake (for building the C++ library)
56
56
  - C++11 compatible compiler
57
- - numpy
57
+ - numpy >= 1.26.4
58
+ - scipy
58
59
 
59
- ### Optional Dependencies
60
+ ### BLAS Support
60
61
 
61
- - **OpenBLAS** (recommended for better performance)
62
- - macOS: `brew install openblas`
63
- - Ubuntu/Debian: `sudo apt install libopenblas-dev`
64
- - CentOS/RHEL: `sudo yum install openblas-devel`
62
+ This package automatically uses SciPy's BLAS backend for optimal performance. No additional BLAS installation is required - SciPy will provide the necessary BLAS functionality.
65
63
 
66
64
  ## Build
67
65
 
68
66
  ### Install Dependencies and Build
69
67
 
70
- **Option 1: Automatic build (recommended)**
71
- ```bash
72
- # Build will automatically run prepare_build.py if needed
73
- uv build
74
- ```
75
-
76
- **Option 2: Manual preparation**
77
68
  ```bash
78
69
  # First, prepare the build by copying necessary files from parent directory
79
70
  python3 prepare_build.py
@@ -84,7 +75,7 @@ uv build
84
75
 
85
76
  This will:
86
77
  - Copy source files (`src/`, `include/`, `cmake/`) from the parent libsparseir directory
87
- - Build the C++ libsparseir library using CMake with BLAS support
78
+ - Build the C++ libsparseir library using CMake with automatic BLAS support via SciPy
88
79
  - Create both source distribution (sdist) and wheel packages
89
80
 
90
81
  ### Development Build
@@ -107,17 +98,9 @@ uv build
107
98
 
108
99
  See `.github-workflows-example.yml` for a complete GitHub Actions example.
109
100
 
110
- ### Build with OpenBLAS Support
111
-
112
- OpenBLAS support is enabled by default in the build configuration. The build system will automatically detect OpenBLAS if it's installed in standard locations.
101
+ ### BLAS Configuration
113
102
 
114
- If OpenBLAS is installed in a custom location, you may need to set additional environment variables:
115
-
116
- ```bash
117
- export CMAKE_PREFIX_PATH="/path/to/openblas"
118
- python3 prepare_build.py
119
- uv build
120
- ```
103
+ The package automatically uses SciPy's BLAS backend, which provides optimized BLAS operations without requiring separate BLAS installation. The build system is configured to use SciPy's BLAS functions directly.
121
104
 
122
105
  ### Clean Build Artifacts
123
106
 
@@ -143,8 +126,8 @@ The build process works as follows:
143
126
  - CMake configuration (`../cmake/` → `cmake/`)
144
127
 
145
128
  2. **Package Building**: `uv build` or `uv sync` uses scikit-build-core to:
146
- - Configure CMake with BLAS support enabled
147
- - Compile the C++ library with dynamic BLAS symbol lookup (for NumPy compatibility)
129
+ - Configure CMake with automatic BLAS support via SciPy
130
+ - Compile the C++ library with dynamic BLAS symbol lookup (for SciPy compatibility)
148
131
  - Package everything into distributable wheels and source distributions
149
132
 
150
133
  3. **Installation**: The built package includes the compiled shared library and Python bindings
@@ -154,20 +137,62 @@ The build process works as follows:
154
137
  - Proper inclusion in source distributions (sdist)
155
138
  - Clean separation between the main C++ library and Python bindings
156
139
 
140
+ ### Conda Build
141
+
142
+ This package can also be built and distributed via conda-forge. The conda recipe is located in `conda-recipe/` and supports multiple platforms and Python versions.
143
+
144
+ **Building conda packages locally:**
145
+
146
+ ```bash
147
+ # Install conda-build
148
+ conda install conda-build
149
+
150
+ # Build the conda package
151
+ cd python
152
+ conda build conda-recipe
153
+
154
+ # Build for specific platforms
155
+ conda build conda-recipe --platform linux-64
156
+ conda build conda-recipe --platform osx-64
157
+ conda build conda-recipe --platform osx-arm64
158
+ ```
159
+
160
+ **Supported platforms:**
161
+ - Linux x86_64
162
+ - macOS Intel (x86_64)
163
+ - macOS Apple Silicon (ARM64)
164
+
165
+ **Supported Python versions:**
166
+ - Python 3.11, 3.12, 3.13
167
+
168
+ **Supported NumPy versions:**
169
+ - NumPy 2.1, 2.2, 2.3
170
+
171
+ The conda build automatically:
172
+ - Uses SciPy's BLAS backend for optimal performance
173
+ - Cleans up old shared libraries before building
174
+ - Builds platform-specific packages with proper dependencies
175
+
157
176
  ## Performance Notes
158
177
 
159
178
  ### BLAS Support
160
179
 
161
- This package supports BLAS libraries for improved linear algebra performance:
180
+ This package automatically uses SciPy's optimized BLAS backend for improved linear algebra performance:
162
181
 
163
- - **With OpenBLAS**: Significant performance improvements for matrix operations
164
- - **Without BLAS**: Uses Eigen's built-in implementations (still efficient, but slower for large matrices)
182
+ - **Automatic BLAS**: Uses SciPy's BLAS functions for optimal performance
183
+ - **No additional setup**: SciPy provides all necessary BLAS functionality
165
184
 
166
- The build system will automatically detect and use OpenBLAS if available. You can verify BLAS support by checking the build output for messages like:
185
+ The build system automatically configures BLAS support through SciPy. You can verify BLAS support by checking the build output for messages like:
186
+
187
+ ```bash
188
+ export SPARSEIR_DEBUG=1
189
+ python -c "import pylibsparseir"
190
+ ```
167
191
 
192
+ This will show:
168
193
  ```
169
194
  BLAS support enabled
170
- Found OpenBLAS at: /opt/homebrew/opt/openblas
195
+ Registered SciPy BLAS dgemm @ 0x...
171
196
  ```
172
197
 
173
198
  ### Troubleshooting
@@ -179,37 +204,10 @@ python3 prepare_build.py
179
204
  uv build
180
205
  ```
181
206
 
182
- **Build fails with "Could NOT find BLAS":**
183
- ```bash
184
- # Install OpenBLAS first
185
- brew install openblas # macOS
186
- sudo apt install libopenblas-dev # Ubuntu
187
-
188
- # Then build with proper CMake path
189
- export CMAKE_PREFIX_PATH="/path/to/openblas"
190
- python3 prepare_build.py
191
- uv build
192
- ```
193
-
194
- **OpenBLAS not detected automatically:**
195
- ```bash
196
- # Set CMake prefix path manually
197
- export CMAKE_PREFIX_PATH="/usr/local/opt/openblas" # or your OpenBLAS path
198
- python3 prepare_build.py
199
- uv build
200
- ```
201
-
202
207
  **Clean rebuild:**
203
208
  ```bash
204
209
  # Remove all copied files and build artifacts
205
210
  uv run clean
206
211
  python3 prepare_build.py
207
212
  uv build
208
- ```
209
-
210
- **Verify BLAS support in built package:**
211
- ```python
212
- import pylibsparseir
213
- # Check build logs for "BLAS support enabled" message
214
- # BLAS symbols are resolved dynamically through NumPy at runtime
215
- ```
213
+ ```
@@ -1,7 +1,3 @@
1
- pylibsparseir-0.5.2.dist-info/RECORD,,
2
- pylibsparseir-0.5.2.dist-info/WHEEL,sha256=-ylPWUC2cC7NYNHUkbdBeNBtyTuCiH8S-BJMK_I67nc,141
3
- pylibsparseir-0.5.2.dist-info/METADATA,sha256=auvozGzYiwfpxOp5dIgTQdNydlt4nhx8yFOQO4pQR2U,7013
4
- pylibsparseir-0.5.2.dist-info/licenses/LICENSE,sha256=f7O_CoSPJW9fmszTOBcCtKDB2QMfPsrYyL41nyE3I-o,1064
5
1
  include/eigen3/signature_of_eigen3_matrix_library,sha256=U9kYED1-STMjAmZuzRnGn0E_lKwG8DfyDhPc8hYFVL8,216
6
2
  include/eigen3/unsupported/Eigen/MatrixFunctions,sha256=UQx5KHuhuG6rCCydWU38vO5rX-NAu8Xpvmey3lxRhwo,17919
7
3
  include/eigen3/unsupported/Eigen/AdolcForward,sha256=gok9u0CklJDOhhpEjl8CnD1rRRAoYw6SESu5GKp9nWA,4422
@@ -532,13 +528,17 @@ include/eigen3/Eigen/src/Eigenvalues/RealQZ.h,sha256=872Nd9lFrTCQwhtLWCyAtnZeG1m
532
528
  include/eigen3/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h,sha256=uxKK8knBdzSTGVJCn8qt07J_SqGDtNfT7e2z4wq1Jeg,5575
533
529
  include/eigen3/Eigen/src/PaStiXSupport/PaStiXSupport.h,sha256=guI9MhWY5GTjrYXHWWRI6mXbUfaB23ooNEgTM35fLvA,22249
534
530
  include/eigen3/Eigen/src/KLUSupport/KLUSupport.h,sha256=txjmMFEbp2X2xCmPMDheZGtR-wA_AnQWSCSnn7sAVRQ,11555
531
+ pylibsparseir-0.6.0.dist-info/RECORD,,
532
+ pylibsparseir-0.6.0.dist-info/WHEEL,sha256=-ylPWUC2cC7NYNHUkbdBeNBtyTuCiH8S-BJMK_I67nc,141
533
+ pylibsparseir-0.6.0.dist-info/METADATA,sha256=epgkYSzpsjchO2n7WefJoPFsmq78eNziaaNoGhIAL78,7032
534
+ pylibsparseir-0.6.0.dist-info/licenses/LICENSE,sha256=f7O_CoSPJW9fmszTOBcCtKDB2QMfPsrYyL41nyE3I-o,1064
535
535
  pylibsparseir/ctypes_wrapper.py,sha256=G6_eraRUh9ON_2e_v4U_hc34HXirlotoawQDOkS0my0,798
536
536
  pylibsparseir/clean_build_artifacts.py,sha256=vYQVocm55yvC5zhACXGRRp03GOj8X1CyryOe1J5KvQ0,2054
537
537
  pylibsparseir/constants.py,sha256=Ek3JnmgiDWy3LB8f_9QA7Gh0ReaEC-W2MlCBJG3cBYg,864
538
538
  pylibsparseir/__init__.py,sha256=c1D9nFVHJUxUqUPsVmZyWwf09LSYAacsLMpCockTrBw,954
539
- pylibsparseir/core.py,sha256=IjHkP9gG17Plfy1lAcGvs2wKAEceTW2d3nEEWsA_PIs,25741
540
- pylibsparseir/libsparseir.dylib,sha256=5XPGOFHSe6fjUUPMCxtov4lR8LYoZ02oR_Du-h6xS94,1141024
541
- share/pkgconfig/eigen3.pc,sha256=x_Hc-v_BgocTBpXBo1Atjs2nbx8JWb2HjaFyLwko5QI,282
539
+ pylibsparseir/core.py,sha256=je_E9ED_shU_jF6ADo2z2Ze_qpo4qoACJ8rngRBrWtw,25882
540
+ pylibsparseir/libsparseir.dylib,sha256=2UsnALhni--3hlcX68utZIT39bgSZrmfWjO2uibwH7c,1140816
541
+ share/pkgconfig/eigen3.pc,sha256=2i-SW6g4tLb9OrTxwZwAdNZyO4ytiYwfJQaFdD1Ukv0,282
542
542
  share/eigen3/cmake/Eigen3Config.cmake,sha256=x0pY00N82bHVUD1ieWKjI_i5qPiEv65l-CBuY1YKRaQ,1339
543
543
  share/eigen3/cmake/Eigen3ConfigVersion.cmake,sha256=kmx0uYAIqWGE5dwo0MIlPyZuKUyNvtbBNmg53QMw5kU,2759
544
544
  share/eigen3/cmake/UseEigen3.cmake,sha256=1VpGAFMK_5H1HlGbGPlyv9lepMl0JF_PDi5TkumFvZU,177
share/pkgconfig/eigen3.pc CHANGED
@@ -1,4 +1,4 @@
1
- prefix=/var/folders/q0/wmf37v850txck86cpnvwm_zw0000gn/T/tmperabpju5/wheel/platlib
1
+ prefix=/var/folders/q0/wmf37v850txck86cpnvwm_zw0000gn/T/tmp_bysp6ij/wheel/platlib
2
2
  exec_prefix=${prefix}
3
3
 
4
4
  Name: Eigen3