Skip to content

Commit 1777aaa

Browse files
committed
review updates
1 parent e04c0ef commit 1777aaa

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

gallery/tutorials/tutorials/micrograph_source.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# %%
1818
# Overview
1919
# --------
20-
# ``MicrographSource`` is an abstract class which provides access two
20+
# ``MicrographSource`` is an abstract class which provides access to
2121
# three distinct subclasses. The first two are
2222
# ``ArrayMicrographSource`` and ``DiskMicrographSource`` which provide
2323
# access to array and disk backed micrograph data respectively.
@@ -154,7 +154,7 @@
154154
# particles.
155155

156156
n_particles_per_micrograph = 10
157-
n_micrographs = 4
157+
n_micrographs = 3
158158

159159
src = MicrographSimulation(
160160
vol,
@@ -213,7 +213,7 @@
213213
noise_adder=noise,
214214
particles_per_micrograph=n_particles_per_micrograph,
215215
micrograph_size=1024,
216-
micrograph_count=4,
216+
micrograph_count=n_micrographs,
217217
ctf_filters=ctfs,
218218
seed=1234,
219219
)

src/aspire/source/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ def save(
10001000
Note, `batch_size=1` implies single MRC extension `.mrc`,
10011001
while `batch_size>=1` implies stack MRC extension `.mrcs`.
10021002
:param save_mode: Whether to save all images in a `single` or multiple files in batch size.
1003-
Default is multiple, supple `'single'` for single mode.
1003+
Default is multiple, supply `'single'` for single mode.
10041004
:param overwrite: Option to overwrite the output MRC files.
10051005
:return: A dictionary containing "starfile"--the path to the saved starfile-- and "mrcs", a
10061006
list of the saved particle stack MRC filenames.

src/aspire/source/micrograph.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,15 +293,15 @@ def __init__(
293293
:param particles_per_micrograph: The amount of particles generated for each micrograph. Defaults to 10.
294294
:param particle_amplitudes: Optional, amplitudes to pass to `Simulation`.
295295
Default `None` uses `Simulation` defaults.
296-
When provided must be array with size `particles_per_micrograph * particles_per_micrograph`.
296+
When provided must be array with size `particles_per_micrograph * micrograph_count`.
297297
:param projection_angles: Optional, projection rotation angles to pass to `Simulation`.
298298
Default `None` uses `Simulation` defaults.
299-
When provided must have shape `(particles_per_micrograph * particles_per_micrograph, 3)`.
299+
When provided must have shape `(particles_per_micrograph * micrograph_count, 3)`.
300300
301301
:param seed: Random seed.
302302
:param noise_adder: Append instance of NoiseAdder to generation pipeline.
303303
:param ctf_filters: Optional list of `Filter` objects to apply to particles.
304-
This list should be 1, n_micrographs, or particles_per_micrograph * particles_per_micrograph.
304+
This list should be 1, n_micrographs, or particles_per_micrograph * micrograph_count.
305305
These will apply filters to all particles, per-micrograph, or per-particle respectively.
306306
Default `None` will not apply any additional filters.
307307
:param boundary: Set boundaries for particle centers, positive values move the boundary inward from the edge of the micrograph. Defaults to half of the particle size (particle_box_size // 2).
@@ -331,7 +331,7 @@ def __init__(
331331

332332
if self.particle_box_size > micrograph_size:
333333
raise ValueError(
334-
"The micrograph size must be larger or equal to the simulation's image size."
334+
"The micrograph size must be larger or equal to the `particle_box_size`."
335335
)
336336

337337
if particle_amplitudes is not None:
@@ -340,7 +340,7 @@ def __init__(
340340
and len(particle_amplitudes) != self.total_particle_count
341341
):
342342
raise RuntimeError(
343-
f"`len(particle_amplitudes)` must be an `int` or length {self.total_particle_count}."
343+
f"`particle_amplitudes` must be an `int` or length {self.total_particle_count}."
344344
)
345345
self.particle_amplitudes = particle_amplitudes
346346

tests/test_micrograph_simulation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def test_micrograph_raises_error_image_size(vol_fixture):
121121
)
122122
assert (
123123
str(e_info.value)
124-
== "The micrograph size must be larger or equal to the simulation's image size."
124+
== "The micrograph size must be larger or equal to the `particle_box_size`."
125125
)
126126

127127

@@ -306,7 +306,7 @@ def test_bad_amplitudes(vol_fixture):
306306
"""
307307
Test incorrect `particle_amplitudes` argument raises.
308308
"""
309-
with pytest.raises(RuntimeError, match=r".*len\(particle_amplitudes\).*"):
309+
with pytest.raises(RuntimeError, match=r".*particle_amplitudes.*"):
310310
_ = MicrographSimulation(
311311
volume=vol_fixture,
312312
particles_per_micrograph=1,

0 commit comments

Comments
 (0)