Skip to content

Commit 4fdf77d

Browse files
authored
Merge pull request #455 from ComputationalCryoEM/develop
Develop ~~> Master
2 parents 28ebc69 + 2f32bb2 commit 4fdf77d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+5996
-115
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.7.0
2+
current_version = 0.8.0
33
commit = True
44
tag = True
55

.codecov.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
1+
# We take the defaults except for treating as informational only.
2+
# This provides feedback without erroring the entire CI pipeline.
3+
4+
coverage:
5+
status:
6+
project:
7+
default:
8+
informational: true
9+
patch:
10+
default:
11+
informational: true
112
ignore:
2-
- "*/tests/*
13+
- "*/tests/*"

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![Github Actions Status](https://github.com/ComputationalCryoEM/ASPIRE-Python/actions/workflows/workflow.yml/badge.svg)](https://github.com/ComputationalCryoEM/ASPIRE-Python/actions/workflows/workflow.yml)
55
[![codecov](https://codecov.io/gh/ComputationalCryoEM/ASPIRE-Python/branch/master/graph/badge.svg?token=3XFC4VONX0)](https://codecov.io/gh/ComputationalCryoEM/ASPIRE-Python)
66

7-
# ASPIRE - Algorithms for Single Particle Reconstruction - v0.7.0
7+
# ASPIRE - Algorithms for Single Particle Reconstruction - v0.8.0
88

99
This is the Python version to supersede the [Matlab ASPIRE](https://github.com/PrincetonUniversity/aspire).
1010

@@ -41,26 +41,26 @@ After cloning this repo, the simplest option is to use Anaconda 64-bit for your
4141
```
4242
cd /path/to/git/clone/folder
4343
44-
# Create's the conda environment and installs base dependencies.
44+
# Creates the conda environment and installs base dependencies.
4545
conda env create -f environment.yml --name aspire_dev
4646
4747
# Enable the environment
4848
conda activate aspire_dev
4949
50-
# Install the aspire package in a locally editable way:
51-
pip install -e .
50+
# Install the aspire package in a locally editable way,
51+
# and additionally installs the developer tools extras:
52+
pip install -e ".[dev]"
53+
5254
```
5355

5456
If you prefer not to use Anaconda, or want to manage environments yourself, you should be able to use `pip` with Python >= 3.6.
5557
Please see the full documentation for details.
5658

57-
You may optionally install additional packages:
59+
You may optionally install additional packages for GPU extensions:
5860

5961
```
60-
# Additional GPU packages (reqires CUDA)
62+
# Additional GPU packages (requires CUDA)
6163
pip install -e ".[gpu]"
62-
# Additional developer tools
63-
pip install -e ".[dev]"
6464
```
6565

6666
### Make sure everything works

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
# built documents.
6565
#
6666
# The full version, including alpha/beta/rc tags.
67-
release = version = "0.7.0"
67+
release = version = "0.8.0"
6868

6969
# The language for content autogenerated by Sphinx. Refer to documentation
7070
# for a list of supported languages.

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Aspire v0.7.0
1+
Aspire v0.8.0
22
==============
33

44
Algorithms for Single Particle Reconstruction

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def read(fname):
99

1010
setup(
1111
name="aspire",
12-
version="0.7.0",
12+
version="0.8.0",
1313
data_files=[
1414
("", ["src/aspire/config.ini"]),
1515
("", ["src/aspire/logging.conf"]),
@@ -24,14 +24,15 @@ def read(fname):
2424
author_email="[email protected]",
2525
install_requires=[
2626
"click",
27-
"finufft",
27+
"finufft==2.0.0",
2828
"importlib_resources>=1.0.2",
2929
"joblib",
3030
"matplotlib",
3131
"mrcfile",
3232
"numpy==1.16",
3333
"pandas==0.25.3",
3434
"pyfftw",
35+
"PyWavelets",
3536
"pillow",
3637
"scipy==1.4.0",
3738
"scikit-learn",

src/aspire/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from aspire.exceptions import handle_exception
1111

1212
# version in maj.min.bld format
13-
__version__ = "0.7.0"
13+
__version__ = "0.8.0"
1414

1515
# Implements some code that writes out exceptions to 'aspire.err.log'.
1616
config = Config(read_text(aspire, "config.ini"))

src/aspire/apple/picking.py

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import logging
22
import os
3+
import warnings
34
from concurrent import futures
45

56
import mrcfile
@@ -104,8 +105,34 @@ def read_mrc(self):
104105
Micrograph image.
105106
"""
106107

107-
with mrcfile.open(self.filename, mode="r+", permissive=True) as mrc:
108-
im = mrc.data.astype("float")
108+
# mrcfile tends to yield many warnings about EMPIAR datasets being corrupt
109+
# These warnings generally seem benign, and the message could be clearer
110+
# The following code handles the warnings via ASPIRE's logger
111+
with warnings.catch_warnings(record=True) as ws:
112+
# Cause all warnings to always be triggered in this context
113+
warnings.simplefilter("always")
114+
115+
# Try to open the mrcfile
116+
with mrcfile.open(self.filename, mode="r", permissive=True) as mrc:
117+
im = mrc.data.astype("float")
118+
119+
# Log each mrcfile warning to debug log, noting the associated file
120+
for w in ws:
121+
logger.debug(
122+
"In APPLE.picking mrcfile.open reports corruption for"
123+
f" {self.filename} warning: {w.message}"
124+
)
125+
126+
# Log a single warning to user
127+
# Give context and note assocated filename
128+
if len(ws) > 0:
129+
logger.warning(
130+
f"APPLE.picking mrcfile reporting {len(ws)} corruptions."
131+
" Most likely this is a problem with the header contents."
132+
" Details written to debug log."
133+
f" APPLE will attempt to continue processing {self.filename}"
134+
)
135+
109136
self.original_im = im
110137

111138
# Discard outer pixels
@@ -121,7 +148,9 @@ def read_mrc(self):
121148
size = tuple((np.array(im.shape) / config.apple.mrc_shrink_factor).astype(int))
122149

123150
# Note, float64 required for signal.correlate call accuracy.
124-
im = np.array(Image.fromarray(im).resize(size, Image.BICUBIC), dtype=np.float64)
151+
im = np.asarray(Image.fromarray(im).resize(size, Image.BICUBIC)).astype(
152+
np.float64, copy=False
153+
)
125154

126155
im = signal.correlate(
127156
im,

src/aspire/basis/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1+
# We'll tell isort not to sort these base classes
2+
# isort: off
3+
14
from .basis import Basis
5+
from .steerable import SteerableBasis2D
6+
7+
# isort: on
8+
29
from .dirac import DiracBasis
310
from .fb_2d import FBBasis2D
411
from .fb_3d import FBBasis3D
512
from .ffb_2d import FFBBasis2D
613
from .ffb_3d import FFBBasis3D
714
from .fpswf_2d import FPSWFBasis2D
815
from .fpswf_3d import FPSWFBasis3D
16+
from .fspca import FSPCABasis
917
from .polar_2d import PolarBasis2D
1018
from .pswf_2d import PSWFBasis2D
1119
from .pswf_3d import PSWFBasis3D

src/aspire/basis/basis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def _getfbzeros(self):
8080
(z, np.zeros(max_num_zeros - len(z), dtype=self.dtype))
8181
)
8282

83-
self.r0 = m_reshape(np.hstack(zeros), (-1, self.ell_max + 1))
83+
self.r0 = m_reshape(np.hstack(zeros), (-1, self.ell_max + 1)).astype(self.dtype)
8484

8585
def _build(self):
8686
"""

0 commit comments

Comments
 (0)