1111from types import ModuleType
1212from typing import Protocol , runtime_checkable
1313
14- from ... import amici_path
14+ import amici
15+ from amici import amici_path , import_model_module
1516
1617#: boolean indicating if this is the full package with swig interface or
1718# the raw package without extension
2223#: boolean indicating if amici was compiled with hdf5 support
2324hdf5_enabled : bool = False
2425
26+ __all__ = [
27+ "import_model_module" ,
28+ "ModelModule" ,
29+ ]
30+
2531if has_clibs :
2632 # Import SWIG module and swig-dependent submodules
2733 # if required and available
3743 message = "builtin type .* has no __module__ attribute" ,
3844 )
3945 # The swig-generated Python module
40- from amici ._installation import amici
46+ from amici ._installation import amici as amici_swig_py
4147
4248 # TODO: selective import to avoid loading unneeded symbols
4349 from amici ._installation .amici import *
4753 # from .swig_wrappers
4854 hdf5_enabled = "read_solver_settings_from_hdf5" in dir ()
4955 # These modules require the swig interface and other dependencies
56+ from . import _pandas , _swig_wrappers
5057 from ._numpy import ExpDataView as ExpDataView
5158 from ._numpy import ReturnDataView as ReturnDataView
5259 from ._numpy import evaluate as evaluate
@@ -62,10 +69,24 @@ class ModelModule(Protocol): # noqa: F811
6269
6370 To enable static type checking."""
6471
65- def get_model (self ) -> amici .Model :
72+ def get_model (self ) -> amici_swig_py .Model :
6673 """Create a model instance."""
6774 ...
6875
69- AmiciModel = amici .Model | amici .ModelPtr
76+ AmiciModel = amici_swig_py .Model | amici_swig_py .ModelPtr
77+
78+ __all__ += [
79+ * amici ._installation .amici .__all__ ,
80+ "ExpDataView" ,
81+ "ReturnDataView" ,
82+ "evaluate" ,
83+ "ModelModule" ,
84+ * _pandas .__all__ ,
85+ * _swig_wrappers .__all__ ,
86+ AmiciModel ,
87+ ]
88+
89+ # expose the swig module itself
90+ amici = amici_swig_py
7091else :
7192 ModelModule = ModuleType
0 commit comments