iode
  • Installation
  • Introduction
  • The LEC Language
  • IODE Reports
  • Graphical User Interface (GUI)
  • Tutorial
  • API Reference
  • API Reference (Python)
    • WORKSPACE
      • Comments
      • Equations
      • Identities
      • Lists
      • Scalars
      • Tables
        • iode.Tables
        • iode.Tables.names
        • iode.Tables.iode_type
        • iode.Tables.filename
        • iode.Tables.description
        • iode.Tables.load
        • iode.Tables.save
        • iode.Tables.clear
        • iode.Tables.copy
        • iode.Tables.subset
        • iode.Tables.new_detached
        • iode.Tables.print_to_file
        • iode.Tables.search
        • iode.Tables.index
        • iode.Tables.get_names
        • iode.Tables.get_names_from_pattern
        • iode.Tables.rename
        • iode.Tables.coefficients
        • iode.Tables.variables
        • iode.Tables.__len__
        • iode.Tables.__contains__
        • iode.Tables.__iter__
        • iode.Tables.__getitem__
        • iode.Tables.__setitem__
        • iode.Tables.__delitem__
        • iode.Tables.i
        • iode.Tables.copy_from
        • iode.Tables.merge
        • iode.Tables.merge_from
        • iode.Tables.compare
        • iode.Tables.is_detached
        • iode.Tables.is_global_workspace
        • iode.Tables.print_nb_decimals
        • iode.Tables.print_tables_as
      • Variables
      • Miscellaneous
    • IODE OBJECTS
    • TIME
    • ESTIMATION
    • SIMULATION
    • LEC
    • REPORTS
    • GRAPHICAL USER INTERFACE
    • PRINT
    • MISCELLANEOUS
    • DEPRECATED
  • Command Line Interface (iodecmd)
  • Change log
iode
  • API Reference (Python)
  • iode.Tables
  • iode.Tables.search
  • View page source

iode.Tables.search

Tables.search(pattern: str, word: bool = True, case_sensitive: bool = True, in_name: bool = True, in_formula: bool = True, in_text: bool = True, list_result: str = '_RES') → List[str]

Return a list of all objects from the current database having a specific pattern in their names or LEC expression, comment…

The following characters in pattern have a special meaning:

  • * : any character sequence, even empty

  • ? : any character (one and only one)

  • @ : any alphanumerical char [A-Za-z0-9]

  • & : any non alphanumerical char

  • | : any alphanumeric character or none at the beginning and end of a string

  • ! : any non-alphanumeric character or none at the beginning and end of a string

  • `` : escape the next character

The Search method depends on the type of object:

  • Comments: the name and text of the comments are analyzed

  • Equations: the name and LEC form of the equations are analyzed

  • Identities: the name and LEC form of the identities are analyzed

  • Lists: the name and text of the lists are analyzed

  • Scalars: the name of the scalars is analyzed

  • Tables: the table name, titles and LEC forms are analyzed

  • Variables: the name of the variables is analyzed

Parameters:
pattern: str

string to search

word: bool, optional

Whether or not the pattern to be searched for must be a whole word and not part of a word. Default to True.

case_sensitive: bool, optional

Whether or not the search is case sensitive. Default to True.

in_name: bool, optional

Whether or not to also search in object names. Default to True.

in_formula: bool, optional

Whether or not to also search in LEC expressions (for Equations, Identities and Tables (LEC cells)). Default to True.

in_text: bool, optional

Whether or not to also search in texts (for Comments, lists, Equations (comment) and Tables (text cells)). Default to True.

list_result: str, optional

Name of the IODE list in which the resulting list of objects is saved. Default to _RES.

Returns:
list(str)

Examples

>>> from iode import SAMPLE_DATA_DIR
>>> from iode import comments, equations, identities, lists, tables
>>> comments.load(f"{SAMPLE_DATA_DIR}/fun.cmt")
Loading .../fun.cmt
317 objects loaded 
>>> equations.load(f"{SAMPLE_DATA_DIR}/fun.eqs")
Loading .../fun.eqs
274 objects loaded 
>>> identities.load(f"{SAMPLE_DATA_DIR}/fun.idt")
Loading .../fun.idt
48 objects loaded 
>>> lists.load(f"{SAMPLE_DATA_DIR}/fun.lst")
Loading .../fun.lst
17 objects loaded 
>>> tables.load(f"{SAMPLE_DATA_DIR}/fun.tbl")
Loading .../fun.tbl
46 objects loaded 
>>> # get list of comments containing 'Bruto'
>>> comments.search("Bruto")
['GOSF', 'GOSG', 'GOSH', 'GOSH_', ..., 'VIF', 'VIG', 'YDH', 'YDH_']
>>> # get list of equations containing 'AOUC'
>>> equations.search("AOUC")
['AOUC', 'PC', 'PIF', 'PXS', 'QXAB']
>>> # get list of identities containing 'NDOMY'
>>> identities.search("NDOMY")
['LCLASS', 'LKEYN', 'UCLASS']
>>> # get list of IODE lists containing 'AOUC'
>>> lists.search("AOUC")
['COPY0', 'ENDO0', 'TOTAL0']
>>> # get list of IODE tables containing 'AOUC' in cells
>>> tables.search("AOUC")
['ANAPRIX', 'MULT1FR', 'MULT1RESU', 'T1', 'T1NIVEAU']
Previous Next

© Copyright 2026, Jean-Marc Paul, Geert Bryon, Alix Damman, Yannick Van den Abbeel.

Built with Sphinx using a theme provided by Read the Docs.