Skip to content

Commit

Permalink
re-bury the julia imports that got shuffled around
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonBurns committed Dec 3, 2024
1 parent b35e764 commit 6153383
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
12 changes: 5 additions & 7 deletions rmgpy/pdep/sls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)}"
Expand Down
15 changes: 10 additions & 5 deletions rmgpy/rmg/reactionmechanismsimulator_reactors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6153383

Please sign in to comment.