Skip to content

Commit

Permalink
check if Keras present
Browse files Browse the repository at this point in the history
  • Loading branch information
sfmig committed Feb 6, 2024
1 parent 2b0b01b commit daaeca5
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions cellfinder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,17 @@
except PackageNotFoundError as e:
raise PackageNotFoundError("cellfinder package not installed") from e

# If tensorflow is not present, tools cannot be used.
# If Keras is not present with a backend, tools cannot be used.
# Throw an error in this case to prevent invocation of functions.
# try:
# TF_VERSION = version("tensorflow") # replace by keras?
# except PackageNotFoundError as e:
# try:
# TF_VERSION = version("tensorflow-macos")
# except PackageNotFoundError as e:
# raise PackageNotFoundError(
# f"cellfinder tools cannot be invoked without tensorflow. "
# f"Please install tensorflow into your environment to use cellfinder tools. "
# f"For more information, please see "
# f"https://github.com/brainglobe/brainglobe-meta#readme."
# ) from e
try:
KERAS_VERSION = version("keras") # replace by keras?
except PackageNotFoundError as e:
raise PackageNotFoundError(
f"cellfinder tools cannot be invoked without Keras. "
f"Please install tensorflow into your environment to use cellfinder tools. "
f"For more information, please see "
f"https://github.com/brainglobe/brainglobe-meta#readme."
) from e

__author__ = "Adam Tyson, Christian Niedworok, Charly Rousseau"
__license__ = "BSD-3-Clause"

0 comments on commit daaeca5

Please sign in to comment.