catmap.parsers package¶
Submodules¶
catmap.parsers.parser_base module¶
-
class
catmap.parsers.parser_base.
ParserBase
(reaction_model=None)[source]¶ Bases:
catmap.ReactionModelWrapper
-
__getattr__
(attr)¶ Return the value of the reaction model instance if its there. Otherwise return the instances own value (or none if the instance does not have the attribute defined and the attribute is not private)
-
__init__
(reaction_model=None)[source]¶ Class for `parsing’ information from raw data (databases, spreadsheets, text files, trajectories, etc.) into a structure which is useful to the microkinetic model. This class acts as a base class to be inherited by other parser classes, but it is not functional on its own.
input_file: defines the file path or object to get data from
A functional derived parser class must also contain the methods:
parse(input_file): a function to parse the input_file file/object and return properly formatted data. The parse function should save all necessary attributes to the Parser class. After parsing the parent microkinetic model class will update itself from the Parser attributes.
-
__module__
= 'catmap.parsers.parser_base'¶
-
__setattr__
(attr, val)¶ Set attribute for the instance as well as the reaction_model instance
-
catmap.parsers.table_parser module¶
-
class
catmap.parsers.table_parser.
TableParser
(reaction_model=None, **kwargs)[source]¶ Bases:
catmap.parsers.parser_base.ParserBase
Parses attributes based on column headers and filters.
- Additional functionality may be added by inheriting and defining
- the parse_{header_name} function where header_name is the column header for the additional variable to be parsed.
-
__getattr__
(attr)¶ Return the value of the reaction model instance if its there. Otherwise return the instances own value (or none if the instance does not have the attribute defined and the attribute is not private)
-
__module__
= 'catmap.parsers.table_parser'¶
-
__setattr__
(attr, val)¶ Set attribute for the instance as well as the reaction_model instance
-
_baseparse
()¶