diff --git a/interfaces/cython/cantera/utils.py b/interfaces/cython/cantera/utils.py index fd82e75eb..d793b0fec 100644 --- a/interfaces/cython/cantera/utils.py +++ b/interfaces/cython/cantera/utils.py @@ -1,4 +1,7 @@ -from . import Solution +import os +import inspect + +from . import Solution, add_directory def import_phases(filename, phase_names): @@ -7,3 +10,11 @@ def import_phases(filename, phase_names): entered as a list of strings. """ return [Solution(filename, p) for p in phase_names] + + +def add_module_directory(): + """ + Add the directory containing the module from which this function is called + to the Cantera input file search path. + """ + add_directory(os.path.dirname(os.path.abspath(inspect.stack()[1][1])))