matlab_parser module¶
Definition of the Matlab parser.
Overview¶
This module contains the MatlabParser
which enables to parse Matlab files in order to automatically
detect inputs and outputs.
This class is basically used through the MatlabDiscipline
class
in order to build a discipline based on the Matlab function.
Classes:
|
Parse Matlab file to identify inputs and outputs. |
- class gemseo.wrappers.matlab.matlab_parser.MatlabParser(full_path=None)[source]¶
Bases:
object
Parse Matlab file to identify inputs and outputs.
Examples
>>> # Parse the matlab function "fucntion.m" >>> parser = MatlabParser("function.m") >>> print(parser.inputs) >>> print(parser.outputs)
- Parameters
full_path (Optional[str]) –
The path to the matlab file. If
None
, the user shall parse the file explicitly.By default it is set to None.
- Return type
None
Attributes:
Return the directory of the function.
Return the name of the function.
Return the inputs.
Return the outputs.
Methods:
parse
(path)Parse a .m file in order to get inputs and outputs.
- RE_ARGS = re.compile('\\((.*?)\\)')¶
- RE_ENCRYPTED_FCT = re.compile('.*(\\\\.*)*\\.p\\b')¶
- RE_FILE_FMT = re.compile('.*(\\\\.*)*\\.m\\b')¶
- RE_FUNCTION = re.compile('=(.*?)\\(')¶
- RE_OUTPUTS = re.compile('(\\[(.*?)\\])|(function( *?)(.*?)=)')¶
- property directory¶
Return the directory of the function.
- property function_name¶
Return the name of the function.
- property inputs¶
Return the inputs.
- property outputs¶
Return the outputs.