Skip to content

Commit

Permalink
Move less important code below imagej_init
Browse files Browse the repository at this point in the history
  • Loading branch information
gselzer committed Aug 15, 2022
1 parent 03aa89a commit 1f8a7c7
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/napari_imagej/setup_imagej.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,6 @@ def log_debug(msg: str):
_logger.debug(debug_msg)


def get_mode() -> str:
"""
Returns the mode ImageJ will be run in
"""
return "headless" if sys.platform == "darwin" else "interactive"


def running_headless() -> bool:
return get_mode() == "headless"


def imagej_init():
# Initialize ImageJ
log_debug("Initializing ImageJ2")
Expand Down Expand Up @@ -77,6 +66,17 @@ def _disable_jvm_shutdown_on_gui_quit(ij_instance):
raise NotImplementedError("Cannot yet block quitting of ImageJ2")


def get_mode() -> str:
"""
Returns the mode ImageJ will be run in
"""
return "headless" if sys.platform == "darwin" else "interactive"


def running_headless() -> bool:
return get_mode() == "headless"


# There is a good debate to be had whether to multithread or multiprocess.
# From what I (Gabe) have read, it seems that threading is preferrable for
# network / IO bottlenecking, while multiprocessing is preferrable for CPU
Expand Down

0 comments on commit 1f8a7c7

Please sign in to comment.