Skip to content

Commit 6f091d1

Browse files
committed
Align circular import fix
1 parent 6b2e8bf commit 6f091d1

1 file changed

Lines changed: 6 additions & 19 deletions

File tree

src/fairmd/lipids/__init__.py

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@
4444
FMDL_EXP_PATH: str = os.path.join(FMDL_DATA_PATH, "experiments")
4545
""" Path to the project experiments folder """
4646

47-
FMDL_MAICOS_NCORES: int | None = int(os.environ["FMDL_MAICOS_NCORES"]) if "FMDL_MAICOS_NCORES" in os.environ else None
48-
""" Number of cores for parallel MAICoS trajectory centering.
49-
None (default): use all cores if joblib is installed, else sequential.
50-
Set to 1 to force sequential processing. """
51-
5247
try:
5348
import rdkit # pyright: ignore[reportMissingImports] # noqa: F401
5449

@@ -93,14 +88,9 @@ def raise_if_subpath_of_dblspec(p: str) -> None:
9388
for p in [FMDL_DATA_PATH, FMDL_EXP_PATH, FMDL_MOL_PATH, FMDL_SIMU_PATH]:
9489
raise_if_subpath_of_dblspec(p)
9590

96-
try:
97-
from fairmd.lipids import molecules
98-
99-
_ = len(molecules.lipids_set)
100-
except Exception:
101-
# avoiding circular imports and import-time failures
102-
pass
91+
from fairmd.lipids import molecules
10392

93+
_ = len(molecules.lipids_set)
10494
print(
10595
f"FAIRMD Lipids is initialized from the folder: {FMDL_DATA_PATH}\n"
10696
"---------------------------------------------------------------",
@@ -110,24 +100,21 @@ def raise_if_subpath_of_dblspec(p: str) -> None:
110100
# so we should not complain that directories don't exist
111101
pass
112102
else:
113-
# Avoid failing on import in docs / CI / test environments
114-
if os.environ.get("READTHEDOCS") or os.environ.get("CI"):
115-
pass
116-
else:
117-
msg = f"""
103+
msg = f"""
118104
Error: no data folder {FMDL_DATA_PATH}.
119105
If Data folder was not created, please create it by using
120106
$ fmdl_initialize_data.py toy
121107
OR
122108
$ fmdl_initialize_data.py stable
123109
and then specify by FMDL_DATA_PATH environment variable."""
124-
raise RuntimeError(msg)
110+
raise RuntimeError(msg)
125111

112+
# reexport progress to use globally instead of tqdm
113+
from fairmd.lipids._base import progress # noqa: E402
126114

127115
__all__ = [
128116
"FMDL_DATA_PATH",
129117
"FMDL_EXP_PATH",
130-
"FMDL_MAICOS_NCORES",
131118
"FMDL_MOL_PATH",
132119
"FMDL_SIMU_PATH",
133120
"RCODE_COMPUTED",

0 commit comments

Comments
 (0)