Skip to content

Commit

Permalink
move parallel_bilby to an optional dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
hoyc1 committed Mar 5, 2024
1 parent 7ec4dd6 commit 6cc90de
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 26 deletions.
23 changes: 0 additions & 23 deletions bilby_lisa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,3 @@
from ._version import version as __version__
except ModuleNotFoundError: # development mode
__version__ = "unknown"

import bilby
import bilby_pipe
import parallel_bilby

# check the bilby, bilby_pipe and parallel_bilby installations
error_str = (
"`bilby_lisa` currently requires a non-released version of `{}` "
"(you have {} installed currently). Please read the README.md file "
"in the source repository for full installation instructions"
)
if "f027394" not in bilby.__version__:
raise ImportError(
error_str.format('bilby', bilby.__version__)
)
if "581eb9a" not in bilby_pipe.__version__:
raise ImportError(
error_str.format('bilby_pipe', bilby_pipe.__version__)
)
if "e4e2f7b" not in parallel_bilby.__version__:
raise ImportError(
error_str.format('parallel_bilby', parallel_bilby.__version__)
)
13 changes: 12 additions & 1 deletion bilby_lisa/bilby_pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,17 @@ def bilby_pipe_main():
"""A modified, top-level interface for bilby_pipe which first checks the
`bilby_lisa` installation
"""
from .utils import get_version_info
from .utils import get_version_info, version_error_string
import bilby
import bilby_pipe

get_version_info()
if "f027394" not in bilby.__version__:
raise ImportError(
version_error_string.format('bilby', bilby.__version__)
)
if "581eb9a" not in bilby_pipe.__version__:
raise ImportError(
version_error_string.format('bilby_pipe', bilby_pipe.__version__)
)
main()
10 changes: 9 additions & 1 deletion bilby_lisa/parallel_bilby.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ def parallel_bilby_generation_main():
"""A modified, top-level interface for parallel_bilby_generation which
first checks the `bilby_lisa` installation
"""
from .utils import get_version_info
from .utils import get_version_info, version_error_string
import parallel_bilby

get_version_info()
if "e4e2f7b" not in parallel_bilby.__version__:
raise ImportError(
version_error_string.format(
'parallel_bilby', parallel_bilby.__version__
)
)
main()
5 changes: 5 additions & 0 deletions bilby_lisa/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
from bilby_pipe.utils import logger

__author__ = ["Charlie Hoy <[email protected]>"]
version_error_string = (
"`bilby_lisa` currently requires a non-released version of `{}` "
"(you have {} installed currently). Please read the README.md file "
"in the source repository for full installation instructions"
)


def get_warning():
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ requires-python = ">=3.9"
dependencies = [
"bilby",
"bilby_pipe",
"parallel_bilby"
]
dynamic = ["version"]

[project.optional-dependencies]
parallel = [
"parallel_bilby"
]
docs = [
"Sphinx >=1.2.2",
"sphinx-immaterial",
Expand Down

0 comments on commit 6cc90de

Please sign in to comment.