Skip to content

Commit 8c742c2

Browse files
authored
Merge pull request #400 from smash-transport/krupczak/PCA
correct a mistake
2 parents 1aec287 + f54aa0c commit 8c742c2

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Date: 2026-XX-XX
3333
* Particle: Refactor class to use more efficient internal data structures to save memory.
3434

3535
### Fixed
36+
* PCAFlow: Fixed eigenvector selection from the sorted eigenvector array.
3637
* Failing import of `JetAnalysis` if `fastjet` is not installed or not compatible with the current numpy/python version. Now if the import fails, the user can still use all other features of SPARKX, but the `JetAnalysis` class will not be available.
3738

3839
[Link to diff from previous version](https://github.com/smash-transport/sparkx/compare/v2.2.0...v2.3.0)

src/sparkx/flow/PCAFlow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ def __compute_flow_PCA(self, bins: Union[List[float], np.ndarray]) -> None:
441441
for bin in range(number_bins):
442442
for alpha in range(self.alpha_):
443443
eval = sorted_eigenvalues[alpha]
444-
evec = sorted_eigenvectors[alpha]
444+
evec = sorted_eigenvectors[:, alpha]
445445
if (eval >= 0.0) and (
446446
self.sigma_multiplicity_total_[sub][bin] > 0.0
447447
):
@@ -472,7 +472,7 @@ def __compute_flow_PCA(self, bins: Union[List[float], np.ndarray]) -> None:
472472
for bin in range(number_bins):
473473
for alpha in range(self.alpha_):
474474
eval = sorted_eigenvalues[alpha]
475-
evec = sorted_eigenvectors[alpha]
475+
evec = sorted_eigenvectors[:, alpha]
476476
if (eval >= 0.0) and (self.bin_multiplicity_total_[bin] > 0.0):
477477
self.Flow_[bin][alpha] = (
478478
np.sqrt(eval)

0 commit comments

Comments
 (0)