@@ -32,10 +32,10 @@ def _is_model_src_exe(model_src_path: Path):
3232 raise ValueError (msg )
3333
3434
35- def _check_sub_process ( sub_process : str ):
36- if sub_process not in {"Octave" , "Matlab" }:
35+ def _check_interpreter ( interpreter : str ):
36+ if interpreter not in {"Octave" , "Matlab" }:
3737 msg = (
38- "Set `sub_process ` as Octave or Matlab to run the model using source codes."
38+ "Set `interpreter ` as Octave or Matlab to run the model using source codes."
3939 "Otherwise set `model_src_path` to the model executable file, "
4040 "see the documentaion." )
4141 raise ValueError (msg )
@@ -77,15 +77,15 @@ class StemmusScope():
7777 repository <https://github.com/EcoExtreML/STEMMUS_SCOPE_Processing>`_
7878 model_src_path(str): path to Stemmus_Scope executable file or to a
7979 directory containing model source codes.
80- sub_process (str, optional): use `Matlab` or `Octave`. It is optional if
80+ interpreter (str, optional): use `Matlab` or `Octave`. It is optional if
8181 `model_src_path` is a path to Stemmus_Scope executable file.
8282
8383 Example:
8484 See notebooks/run_model_in_notebook.ipynb in `STEMMUS_SCOPE_Processing
8585 repository <https://github.com/EcoExtreML/STEMMUS_SCOPE_Processing>`_
8686 """
8787
88- def __init__ (self , config_file : str , model_src_path : str , sub_process : str = None ):
88+ def __init__ (self , config_file : str , model_src_path : str , interpreter : str = None ):
8989 # make sure paths are abolute and path objects
9090 config_file = utils .to_absolute_path (config_file )
9191 model_src_path = utils .to_absolute_path (model_src_path )
@@ -95,10 +95,10 @@ def __init__(self, config_file: str, model_src_path: str, sub_process: str = Non
9595 if _is_model_src_exe (model_src_path ):
9696 self .exe_file = model_src_path
9797 else :
98- _check_sub_process ( sub_process )
98+ _check_interpreter ( interpreter )
9999
100100 self .model_src = model_src_path
101- self .sub_process = sub_process
101+ self .interpreter = interpreter
102102
103103 # read config template
104104 self ._config = config_io .read_config (config_file )
@@ -163,7 +163,7 @@ def run(self) -> str:
163163 # set matlab log dir
164164 os .environ ['MATLAB_LOG_DIR' ] = str (self ._config ["InputPath" ])
165165 result = _run_sub_process (args , None )
166- if self .sub_process == "Matlab" :
166+ if self .interpreter == "Matlab" :
167167 # set Matlab arguments
168168 path_to_config = f"'{ self .cfg_file } '"
169169 eval_code = f'STEMMUS_SCOPE_exe({ path_to_config } );exit;'
@@ -172,7 +172,7 @@ def run(self) -> str:
172172 if utils .os_name () != "nt" :
173173 args = shlex .join (args )
174174 result = _run_sub_process (args , self .model_src )
175- if self .sub_process == "Octave" :
175+ if self .interpreter == "Octave" :
176176 # set Octave arguments
177177 # use subprocess instead of oct2py,
178178 # see issue STEMMUS_SCOPE_Processing/issues/46
0 commit comments