Skip to content

Commit 07b3060

Browse files
sirmarcelclaude
andcommitted
Remove try/except guards for comms and marathon imports
Both are hard dependencies — the guards were dead code. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bdf55a2 commit 07b3060

3 files changed

Lines changed: 10 additions & 27 deletions

File tree

src/lorem/__init__.py

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
1-
from ._version import __version__
2-
3-
try:
4-
from comms import Comms
1+
from comms import Comms
52

6-
comms = Comms("lorem")
7-
except ModuleNotFoundError:
8-
comms = None
3+
from ._version import __version__
4+
from .batching import to_batch, to_sample
5+
from .calculator import Calculator as LOREMCalculator
6+
from .models.bec import LoremBEC
7+
from .models.mlip import Lorem
8+
from .transforms import ToBatch, ToSample
99

10-
# These modules require marathon and jaxpme at import time.
11-
# When those are not installed (e.g. CI), we skip them.
12-
try:
13-
from .batching import to_batch, to_sample
14-
from .calculator import Calculator as LOREMCalculator
15-
from .models.bec import LoremBEC
16-
from .models.mlip import Lorem
17-
from .transforms import ToBatch, ToSample
18-
except ModuleNotFoundError:
19-
pass
10+
comms = Comms("lorem")
2011

2112
__all__ = [
2213
"__version__",

src/lorem/models/__init__.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
try:
2-
from .bec import LoremBEC
3-
from .mlip import Lorem
4-
except ModuleNotFoundError:
5-
pass
1+
from .bec import LoremBEC
2+
from .mlip import Lorem
63

74
__all__ = ["Lorem", "LoremBEC"]

tests/test_init.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
import pytest
2-
3-
comms = pytest.importorskip("comms")
4-
5-
61
def test_version():
72
import lorem
83

0 commit comments

Comments
 (0)