Skip to content

Commit

Permalink
Merge branch 'set_gpu_id' into refactor_sim
Browse files Browse the repository at this point in the history
  • Loading branch information
jmp1985 committed Oct 20, 2023
2 parents 1906118 + 0bd0312 commit 32aa2e7
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 12 deletions.
5 changes: 2 additions & 3 deletions src/parakeet/_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
import parakeet.metadata
import parakeet.sample
import parakeet.simulate
from parakeet.config import Device
from functools import singledispatch

Device = parakeet.config.Device


__all__ = ["run"]

Expand All @@ -33,7 +32,7 @@ def run(
exit_wave_file: str,
optics_file: str,
image_file: str,
device: str = None,
device: Device = None,
nproc: int = None,
gpu_id: list = None,
steps: list = None,
Expand Down
3 changes: 2 additions & 1 deletion src/parakeet/analyse/_correct.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import random
import parakeet.microscope
import parakeet.sample
from parakeet.config import Device
from functools import singledispatch


Expand All @@ -29,7 +30,7 @@ def correct(
image_file: str,
corrected_file: str,
num_defocus: int = 1,
device: str = None,
device: Device = None,
):
"""
Correct the images using 3D CTF correction
Expand Down
3 changes: 2 additions & 1 deletion src/parakeet/analyse/_reconstruct.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import random
import parakeet.microscope
import parakeet.sample
from parakeet.config import Device
from functools import singledispatch


Expand All @@ -24,7 +25,7 @@


@singledispatch
def reconstruct(config_file, image_file: str, rec_file: str, device: str = None):
def reconstruct(config_file, image_file: str, rec_file: str, device: Device = None):
"""
Reconstruct the volume
Expand Down
6 changes: 2 additions & 4 deletions src/parakeet/simulate/_cbed.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import parakeet.io
import parakeet.sample
import parakeet.simulate
from parakeet.config import Device
from parakeet.simulate.simulation import Simulation
from parakeet.simulate.engine import SimulationEngine
from parakeet.microscope import Microscope
Expand All @@ -32,9 +33,6 @@
__all__ = ["cbed"]


Device = parakeet.config.Device
Sample = parakeet.sample.Sample

# Get the logger
logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -323,7 +321,7 @@ def cbed(
config_file,
sample_file: str,
image_file: str,
device: str = None,
device: Device = None,
nproc: int = None,
gpu_id: list = None,
):
Expand Down
3 changes: 2 additions & 1 deletion src/parakeet/simulate/_exit_wave.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import parakeet.io
import parakeet.sample
import parakeet.simulate
from parakeet.config import Device
from parakeet.simulate.simulation import Simulation
from parakeet.simulate.engine import SimulationEngine
from parakeet.microscope import Microscope
Expand Down Expand Up @@ -312,7 +313,7 @@ def exit_wave(
config_file,
sample_file: str,
exit_wave_file: str,
device: str = None,
device: Device = None,
nproc: int = None,
gpu_id: list = None,
):
Expand Down
5 changes: 4 additions & 1 deletion src/parakeet/simulate/_optics.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
import parakeet.inelastic
import parakeet.io
import parakeet.sample
from parakeet.config import Device
from parakeet.microscope import Microscope
from parakeet.scan import Scan
from functools import singledispatch
from parakeet.simulate.simulation import Simulation
from parakeet.simulate.engine import SimulationEngine
Expand Down Expand Up @@ -456,7 +459,7 @@ def optics(
config_file,
exit_wave_file: str,
optics_file: str,
device: str = None,
device: Device = None,
nproc: int = None,
gpu_id: list = None,
):
Expand Down
3 changes: 2 additions & 1 deletion src/parakeet/simulate/_potential.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import parakeet.futures
import parakeet.inelastic
import parakeet.sample
from parakeet.config import Device
from parakeet.microscope import Microscope
from parakeet.scan import Scan
from parakeet.simulate.simulation import Simulation
Expand Down Expand Up @@ -221,7 +222,7 @@ def potential(
config_file,
sample_file: str,
potential_prefix: str,
device: str = None,
device: Device = None,
nproc: int = None,
gpu_id: list = None,
):
Expand Down

0 comments on commit 32aa2e7

Please sign in to comment.