From 615338370c803dbf4b18eb17aa05a77ec66cd0c5 Mon Sep 17 00:00:00 2001 From: Jackson Burns Date: Tue, 3 Dec 2024 15:15:03 -0500 Subject: [PATCH] re-bury the julia imports that got shuffled around --- rmgpy/pdep/sls.py | 12 +++++------- rmgpy/rmg/reactionmechanismsimulator_reactors.py | 15 ++++++++++----- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/rmgpy/pdep/sls.py b/rmgpy/pdep/sls.py index ce43f659e9..12a0dd8e05 100644 --- a/rmgpy/pdep/sls.py +++ b/rmgpy/pdep/sls.py @@ -32,12 +32,8 @@ and implementing the SLS master equation reduction method """ -from juliacall import Main - -Main.seval("using ReactionMechanismSimulator.SciMLBase") -Main.seval("using ReactionMechanismSimulator.Sundials") -import sys import logging +import sys import numpy as np import scipy.linalg @@ -50,8 +46,10 @@ NO_JULIA = False try: - from diffeqpy import de - from julia import Main + from juliacall import Main + + Main.seval("using ReactionMechanismSimulator.SciMLBase") + Main.seval("using ReactionMechanismSimulator.Sundials") except Exception as e: logging.info( f"Unable to import Julia dependencies, original error: {str(e)}" diff --git a/rmgpy/rmg/reactionmechanismsimulator_reactors.py b/rmgpy/rmg/reactionmechanismsimulator_reactors.py index 567c370d34..f40ba703d6 100644 --- a/rmgpy/rmg/reactionmechanismsimulator_reactors.py +++ b/rmgpy/rmg/reactionmechanismsimulator_reactors.py @@ -34,15 +34,20 @@ import logging import sys -import juliacall import numpy as np -from juliacall import Main import rmgpy.constants as constants -Main.seval("using PythonCall") -Main.seval("using ReactionMechanismSimulator") -Main.seval("using ReactionMechanismSimulator.Sundials") +NO_JULIA = True +try: + import juliacall + from juliacall import Main + Main.seval("using PythonCall") + Main.seval("using ReactionMechanismSimulator") + Main.seval("using ReactionMechanismSimulator.Sundials") + NO_JULIA = False +except: + logging.warning("Julia import failed, RMS reactors not available.") from rmgpy import constants from rmgpy.data.kinetics.depository import DepositoryReaction