From a490062f0edbaee13fb339485cd415cc292010dd Mon Sep 17 00:00:00 2001 From: Garrett Wright Date: Tue, 25 Apr 2023 15:41:35 -0400 Subject: [PATCH 1/3] Avoid future numpy deprecation, generator stack inputs --- src/aspire/source/coordinates.py | 2 +- src/aspire/source/relion.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/aspire/source/coordinates.py b/src/aspire/source/coordinates.py index 0ceae26cfa..851923136b 100644 --- a/src/aspire/source/coordinates.py +++ b/src/aspire/source/coordinates.py @@ -366,7 +366,7 @@ def _extract_ctf(self, data_block): # get unique ctfs from the data block # i'th entry of `indices` contains the index of `filter_params` with corresponding CTF params - ctf_data = np.stack(data_block[c] for c in CTF_params).astype(self.dtype).T + ctf_data = np.stack([data_block[c] for c in CTF_params]).astype(self.dtype).T filter_params, indices = np.unique( ctf_data, return_inverse=True, diff --git a/src/aspire/source/relion.py b/src/aspire/source/relion.py index d22576148c..60e41919ab 100644 --- a/src/aspire/source/relion.py +++ b/src/aspire/source/relion.py @@ -107,7 +107,7 @@ def __init__( # If these all exist in the STAR file, we may create CTF filters for the source if set(CTF_params).issubset(metadata.keys()): # partition particles according to unique CTF parameters - ctf_data = np.stack(metadata[k] for k in CTF_params).T + ctf_data = np.stack([metadata[k] for k in CTF_params]).T filter_params, filter_indices = np.unique( ctf_data, return_inverse=True, From 41be4d87cb0f8c265421b0a2be9fcb30ac3c7c10 Mon Sep 17 00:00:00 2001 From: Garrett Wright Date: Tue, 25 Apr 2023 15:45:50 -0400 Subject: [PATCH 2/3] Use caching to workaround immutable_src+ray memory leak --- gallery/experiments/experimental_abinitio_pipeline_10028.py | 5 +++++ gallery/experiments/experimental_abinitio_pipeline_10081.py | 3 +++ 2 files changed, 8 insertions(+) diff --git a/gallery/experiments/experimental_abinitio_pipeline_10028.py b/gallery/experiments/experimental_abinitio_pipeline_10028.py index b842cdbc7c..b0cc52afa7 100644 --- a/gallery/experiments/experimental_abinitio_pipeline_10028.py +++ b/gallery/experiments/experimental_abinitio_pipeline_10028.py @@ -98,6 +98,9 @@ # logger.info("Invert the global density contrast") # src = src.invert_contrast() +# Caching is used for speeding up large datasets on high memory machines. +src = src.cache() + # %% # Optional: CWF Denoising # ----------------------- @@ -119,6 +122,8 @@ cwf_denoiser = DenoiserCov2D(src) # Use denoised src for classification classification_src = cwf_denoiser.denoise() + # Cache for speedup. Avoids recomputing. + classification_src = classification_src.cache() # Peek, what do the denoised images look like... if interactive: classification_src.images[:10].show() diff --git a/gallery/experiments/experimental_abinitio_pipeline_10081.py b/gallery/experiments/experimental_abinitio_pipeline_10081.py index c9b79b59cb..a1bc9aca13 100644 --- a/gallery/experiments/experimental_abinitio_pipeline_10081.py +++ b/gallery/experiments/experimental_abinitio_pipeline_10081.py @@ -75,6 +75,9 @@ aiso_noise_estimator = AnisotropicNoiseEstimator(src) src.whiten(aiso_noise_estimator.filter) +# Caching is used for speeding up large datasets on high memory machines. +src = src.cache() + # %% # Class Averaging # ---------------------- From e64b81c5f9cf71b191df53018bd0132785b9653b Mon Sep 17 00:00:00 2001 From: Garrett Wright Date: Tue, 25 Apr 2023 15:57:18 -0400 Subject: [PATCH 3/3] Remove a flaky superfluous windows env for now --- .github/workflows/workflow.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index eb39b95ead..644fe39198 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -64,7 +64,7 @@ jobs: shell: bash -el {0} strategy: matrix: - os: [ubuntu-latest, ubuntu-20.04, macOS-latest, macOS-11, windows-2019] + os: [ubuntu-latest, ubuntu-20.04, macOS-latest, macOS-11] backend: [default, openblas] python-version: ['3.8'] include: @@ -72,6 +72,8 @@ jobs: backend: intel - os: macOS-latest backend: accelerate + - os: windows-2019 + backend: default steps: - uses: actions/checkout@v3