Skip to content

Commit 19a938d

Browse files
authored
Merge pull request #357 from ComputationalCryoEM/develop
Merge Develop
2 parents 85bf13c + bc2ba44 commit 19a938d

File tree

15 files changed

+76
-48
lines changed

15 files changed

+76
-48
lines changed

.bumpversion.cfg

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
[bumpversion]
2-
current_version = 0.6.0
2+
current_version = 0.6.1
33
commit = True
44
tag = True
55

66
[bumpversion:file:setup.py]
7-
search = version='{current_version}'
8-
replace = version='{new_version}'
7+
search = version="{current_version}"
8+
replace = version="{new_version}"
99

1010
[bumpversion:file:README.md]
1111
search = v{current_version}
1212
replace = v{new_version}
1313

1414
[bumpversion:file:src/aspire/__init__.py]
15-
search = __version__ = '{current_version}'
16-
replace = __version__ = '{new_version}'
15+
search = __version__ = "{current_version}"
16+
replace = __version__ = "{new_version}"
1717

1818
[bumpversion:file:docs/source/conf.py]
19-
search = release = version = '{current_version}'
20-
replace = release = version = '{new_version}'
19+
search = release = version = "{current_version}"
20+
replace = release = version = "{new_version}"
2121

2222
[bumpversion:file:docs/source/index.rst]
2323
search = v{current_version}

MANIFEST.in

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@ recursive-include docs *.bib
1616
recursive-include docs *.py
1717
recursive-include docs *.rst
1818
recursive-include docs Makefile
19-
recursive-include tests *.mrc
20-
recursive-include tests *.mrcs
21-
recursive-include tests *.npy
22-
recursive-include tests *.py
23-
recursive-include tests *.star
24-
recursive-include tutorials *.dontrun
25-
recursive-include tutorials *.ipynb
26-
recursive-include tutorials *.mat
27-
recursive-include tutorials *.mrc
28-
recursive-include tutorials *.npy
29-
recursive-include tutorials *.py
3019
prune docs/source
20+
prune tests
21+
prune tutorials

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![Travis Build Status](https://travis-ci.org/ComputationalCryoEM/ASPIRE-Python.svg?branch=master)](https://travis-ci.org/ComputationalCryoEM/ASPIRE-Python)
55
[![Coverage Status](https://coveralls.io/repos/github/ComputationalCryoEM/ASPIRE-Python/badge.svg?branch=master)](https://coveralls.io/github/ComputationalCryoEM/ASPIRE-Python?branch=master)
66

7-
# ASPIRE - Algorithms for Single Particle Reconstruction - v0.6.0
7+
# ASPIRE - Algorithms for Single Particle Reconstruction - v0.6.1
88

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

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
# built documents.
6363
#
6464
# The full version, including alpha/beta/rc tags.
65-
release = version = "0.6.0"
65+
release = version = "0.6.1"
6666

6767
# The language for content autogenerated by Sphinx. Refer to documentation
6868
# 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.6.0
1+
Aspire v0.6.1
22
==============
33

44
Algorithms for Single Particle Reconstruction

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def read(fname):
99

1010
setup(
1111
name="aspire",
12-
version="0.6.0",
12+
version="0.6.1",
1313
data_files=[
1414
("", ["src/aspire/config.ini"]),
1515
("", ["src/aspire/logging.conf"]),

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.6.0"
13+
__version__ = "0.6.1"
1414

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

src/aspire/basis/basis_utils.py

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import numpy as np
99
from numpy import diff, exp, log, pi
1010
from numpy.polynomial.legendre import leggauss
11-
from scipy.special import jn, jv, lpmv
11+
from scipy.special import jn, jv, lpmv, sph_harm
1212

1313
from aspire.utils import ensure
1414
from aspire.utils.coor_trans import grid_2d, grid_3d
@@ -126,26 +126,14 @@ def real_sph_harmonic(j, m, theta, phi):
126126
:return: The real spherical harmonics evaluated at the points (theta, phi).
127127
"""
128128
abs_m = abs(m)
129-
y = lpmv(abs_m, j, np.cos(theta))
130-
131-
# Beware of using just np.prod in the denominator here
132-
# Unless we use float64, values in the denominator > 13! will be incorrect
133-
try:
134-
y = (
135-
np.sqrt(
136-
(2 * j + 1)
137-
/ (4 * pi)
138-
/ np.prod(range(j - abs_m + 1, j + abs_m + 1), dtype=np.float64)
139-
)
140-
* y
141-
)
142-
except RuntimeWarning:
143-
logger.error("debug")
144129

130+
y = sph_harm(abs_m, j, phi, theta)
145131
if m < 0:
146-
y = np.sqrt(2) * np.sin(abs_m * phi) * y
132+
y = np.sqrt(2) * np.imag(y)
147133
elif m > 0:
148-
y = np.sqrt(2) * np.cos(abs_m * phi) * y
134+
y = np.sqrt(2) * np.real(y)
135+
else:
136+
y = np.real(y)
149137

150138
return y
151139

src/aspire/denoising/denoised_src.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ def _images(self, start=0, num=np.inf, indices=None, batch_size=512):
4040
start = indices.min()
4141
end = indices.max()
4242

43-
im = np.empty((self.L, self.L, len(indices)))
43+
nimgs = len(indices)
44+
im = np.empty((nimgs, self.L, self.L))
4445

45-
logger.info(f"Loading {len(indices)} images complete")
46-
for istart in range(start, end, batch_size):
46+
logger.info(f"Loading {nimgs} images complete")
47+
for istart in range(start, end + 1, batch_size):
4748
imgs_denoised = self.denoiser.images(istart, batch_size)
48-
im = imgs_denoised.data
49+
iend = min(istart + batch_size, end + 1)
50+
im[istart:iend] = imgs_denoised.data
4951

5052
return Image(im)

src/aspire/denoising/denoiser_cov2d.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,7 @@ def denoise(self, covar_opt=None, batch_size=512):
130130

131131
# Initialize the rotationally invariant covariance matrix of 2D images
132132
# A fixed batch size is used to go through each image
133-
self.cov2d = BatchedRotCov2D(
134-
self.src, self.basis, batch_size=batch_size, dtype=self.dtype
135-
)
133+
self.cov2d = BatchedRotCov2D(self.src, self.basis, batch_size=batch_size)
136134

137135
default_opt = {
138136
"shrinker": "frobenius_norm",

0 commit comments

Comments
 (0)