Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

it should be possible to run the package without pypest / amici #3

Open
fbergmann opened this issue Apr 20, 2023 · 0 comments
Open

Comments

@fbergmann
Copy link
Collaborator

I needed the following changes to have the package run for me:

diff --git a/petab_timecourse/__init__.py b/petab_timecourse/__init__.py
index 4f77a5b..b38cd07 100644
--- a/petab_timecourse/__init__.py
+++ b/petab_timecourse/__init__.py
@@ -22,14 +22,17 @@ from .misc import (
 )
 
 
-from . import amici
-from .amici import (
-    simulate_timecourse,
-)
-
-from .pypesto import (
-    TimecourseObjective,
-)
+try: 
+    from . import amici
+    from .amici import (
+        simulate_timecourse,
+    )
+
+    from .pypesto import (
+        TimecourseObjective,
+    )
+except ImportError:
+    pass
 
 from .problem import Problem
 
diff --git a/petab_timecourse/simulator.py b/petab_timecourse/simulator.py
index fb7a9bf..249b06d 100644
--- a/petab_timecourse/simulator.py
+++ b/petab_timecourse/simulator.py
@@ -23,11 +23,15 @@ from petab.C import (
 from .C import (
     PERIODS,
 )
-from .amici import (
-    precreate_edata_periods,
-    precreate_parameter_mapping_periods,
-    add_output_timepoints_if_missing,
-)
+try:
+    from .amici import (
+        precreate_edata_periods,
+        precreate_parameter_mapping_periods,
+        add_output_timepoints_if_missing,
+    )
+except ImportError:
+    pass
+
 from .misc import (
     get_timecourse,
     subset_petab_problem,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant