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
      • Variables
        • iode.Variables
        • iode.Variables.names
        • iode.Variables.iode_type
        • iode.Variables.filename
        • iode.Variables.description
        • iode.Variables.load
        • iode.Variables.save
        • iode.Variables.clear
        • iode.Variables.copy
        • iode.Variables.subset
        • iode.Variables.new_detached
        • iode.Variables.print_to_file
        • iode.Variables.search
        • iode.Variables.index
        • iode.Variables.get_names
        • iode.Variables.get_names_from_pattern
        • iode.Variables.rename
        • iode.Variables.__len__
        • iode.Variables.__contains__
        • iode.Variables.__iter__
        • iode.Variables.__getitem__
        • iode.Variables.__setitem__
        • iode.Variables.__delitem__
        • iode.Variables.i
        • iode.Variables.copy_from
        • iode.Variables.merge
        • iode.Variables.merge_from
        • iode.Variables.compare
        • iode.Variables.is_detached
        • iode.Variables.is_global_workspace
        • iode.Variables.mode
        • iode.Variables.sample
        • iode.Variables.nb_periods
        • iode.Variables.periods
        • iode.Variables.periods_as_str
        • iode.Variables.periods_as_float
        • iode.Variables.threshold
        • iode.Variables.__add__
        • iode.Variables.__radd__
        • iode.Variables.__iadd__
        • iode.Variables.__sub__
        • iode.Variables.__rsub__
        • iode.Variables.__isub__
        • iode.Variables.__mul__
        • iode.Variables.__rmul__
        • iode.Variables.__imul__
        • iode.Variables.__truediv__
        • iode.Variables.__rtruediv__
        • iode.Variables.__itruediv__
        • iode.Variables.__pow__
        • iode.Variables.periods_subset
        • iode.Variables.low_to_high
        • iode.Variables.high_to_low
        • iode.Variables.extrapolate
        • iode.Variables.seasonal_adjustment
        • iode.Variables.trend_correction
        • iode.Variables.execute_RAS
        • iode.Variables.from_numpy
        • iode.Variables.to_numpy
        • iode.Variables.df
        • iode.Variables.from_frame
        • iode.Variables.to_frame
        • iode.Variables.from_array
        • iode.Variables.to_array
        • iode.Variables.plot
        • iode.Variables.convert_file
        • iode.Variables.export_as_file
      • 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.Variables
  • iode.Variables.search
  • View page source

iode.Variables.search

Variables.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.