Skip to content

Commit 24b479e

Browse files
committed
makes orsopy actually optional
1 parent 8db92c2 commit 24b479e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

RATapi/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
"""RATapi is a Python package for modelling, fitting and optimising reflectivity problems."""
22

3+
from contextlib import suppress
4+
35
import RATapi.examples as examples
46
from RATapi import events, models
57
from RATapi.classlist import ClassList
68
from RATapi.controls import Controls
79
from RATapi.project import Project
810
from RATapi.run import run
9-
from RATapi.utils import convert, orso, plotting
11+
from RATapi.utils import convert, plotting
12+
13+
with suppress(ImportError): # orsopy is an optional dependency
14+
from RATapi.utils import orso as orso
1015

11-
__all__ = ["examples", "models", "events", "ClassList", "Controls", "Project", "run", "plotting", "convert", "orso"]
16+
__all__ = ["examples", "models", "events", "ClassList", "Controls", "Project", "run", "plotting", "convert"]

0 commit comments

Comments
 (0)