Equivalence Between IODE Report and Python Syntax

Equivalence Between IODE Report Execution Commands And Python Functions

IODE Report Command

Python Equivalent

$abort

exit()

$ask

input(prompt)

$beep

No equivalent

$chdir

os.chdir(path) [1]

$debug

To be implemented

$define

my_variable = value –> See Python Variables

$foreach

for item in iterable: … –> See Python For Loops

$goto

Python does not support labels and goto

$incrtime

increment_t(value) –> See increment_t()

$indent

No equivalent (Python language IS indentation-sensitive)

$label

Python does not support labels and goto

$maximize

No longer maintained

$minimize

No longer maintained

$mkdir

os.mkdir(path) [1]

$multiline

use the backslash `` at the end of the line to continue on the next line

$msg

print(message)

$next

No equivalent

$noparsing

No equivalent (Python does not have a parsing phase like IODE)

$procdef

def function_name(parameters): … –> See Python Functions

$procend

No equivalent (simply stop indent to end the function definition)

$procexec

function_name(arguments) –> See Python Function Calls

$onerror

try: … except Exception as e: … –> See Python Exception Handling

$prompt

input(prompt)

$quit

exit()

$quitode

No longer maintained

$repeat

for arg in arguments: `` command(arg) ``

$repeatstring

No equivalent

$return

return value –> See Python Return Statement

$rmdir

os.rmdir(path) [1]

$settime

set_t(value) –> See set_t()

$shift

No equivalent

$show

print(variable)

$sleep

time.sleep(seconds) [2]

$system

os.system(command) [1]

$vseps

text.split(separators)

Equivalence Between IODE Report And Python Functions

IODE Report Functions

Python Equivalent

@upper(txt)

txt.upper()

@lower(txt)

txt.lower()

@replace(txt, from, to)

txt.replace(old, new)

@fmt(val, fmt)

See printf-style String Formatting

@take(n, txt)

txt[:n]

@drop(n, txt)

txt[n:]

@count(txt)

len(txt.split(‘,’))

@index(n, list_txt)

split_list(list_txt)[n-1]

@sqz(txt)

txt.replace(’ ‘, ‘’)

@strip(txt)

txt.strip()

@ansi(txt)

See String Methods

@equal(t1, t2)

t1 == t2 –> See Python Comparisons

@void(t1, ...)

No equivalence

@vtake(n, list_txt)

list_txt.split(separators)[:n]

@vdrop(n, list_txt)

list_txt.split(separators)[n:]

@vcount(list_txt)

len(list_txt.split(separators))

@fdelete(filepath)

Path(filepath).unlink()

@fappend(filepath, txt)

with open(filepath, ‘a’) as f: f.write(txt)

@getdir()

os.getcwd()

@chdir(dirname)

os.chdir(dirname) [1]

@mkdir(dirname)

os.mkdir(dirname) [1]

@rmdir(dirname)

os.rmdir(dirname) [1]

@date(format)

datetime.now().strftime(“%d/%m/%Y”) [2]

@time(format)

datetime.now().strftime(“%H:%M:%S”) [2]

@month(month, language)

datetime.date(year, month, day).strftime(“%B”)

@ChronoReset()

start = time.time_ns() [3]

@ChronoGet()

elapsed_time = time.time_ns() - start [3]

@cexpand(pattern)

comments.get_names(pattern) –> See Database.get_names() and Database.names()

@eexpand(pattern)

equations.get_names(pattern) –> See Database.get_names() and Database.names()

@iexpand(pattern)

identities.get_names(pattern) –> See Database.get_names() and Database.names()

@lexpand(pattern)

lists.get_names(pattern) –> See Database.get_names() and Database.names()

@sexpand(pattern)

scalars.get_names(pattern) –> See Database.get_names() and Database.names()

@texpand(pattern)

tables.get_names(pattern) –> See Database.get_names() and Database.names()

@vexpand(pattern)

variables.get_names(pattern) –> See Database.get_names() and Database.names()

@vliste(eq_name)

equations[eq_name].get_variables_list() –> See Equation.get_variables_list()

@sliste(eq_name)

equations[eq_name].get_coefficients_list() –> See Equation.get_coefficients_list()

@ttitle(table_name)

Tables[table_name].title –> See Table.title()

@srelax(scl_name)

scalars[scl_name].relax –> See Scalar.relax()

@sstderr(scl_name)

scalars[scl_name].std –> See Scalar.std()

@cvalue(cmt_names)

[comments[name] for name in cmt_names] –> See Database.__getitem__()

@vvalue(var_names)

[variables[name] for name in var_names] –> See Database.__getitem__()

@sample()

variables.sample –> See Variables.sample()

@evalue(eq_name)

equations[eq_name].lec –> See Equation.lec()

@eqsample(eq_name)

equations[eq_name].sample –> See Equation.sample()

@eqsamplefrom(eq_name)

equations[eq_name].sample.start –> See Equation.sample() and Sample.start()

@eqsampleto(eq_name)

equations[eq_name].sample.end –> See Equation.sample() adnd Sample.end()

@eqlhs(eq_name)

lhs, rhs = equations[eq_name].split_equation() –> See Equation.split_equation()

@eqrhs(eq_name)

lhs, rhs = equations[eq_name].split_equation() –> See Equation.split_equation()

@SqlOpen

No longer maintained

@SqlQuery

No longer maintained

@SqlNext

No longer maintained

@SqlField

No longer maintained

@SqlRecord

No longer maintained

@SqlClose

No longer maintained

@SimEps()

simu.convergence_threshold –> See Simulation.convergence_threshold()

@SimRelax()

simu.relax –> See Simulation.relax()

@SimMaxit()

simu.max_nb_iterations –> See Simulation.max_nb_iterations()

@SimNiter(period)

simu.nb_iterations(period) –> See Simulation.nb_iterations()

@SimNorm(period)

simu.norm(period) –> See Simulation.norm()

Equivalence Between IODE Report Commands and Python Methods

Workspaces

Below workspace must be replaced by either:

Data

Below workspace must be replaced by either:
  • comments

  • equations

  • identities

  • lists

  • scalars

  • tables

  • variables

    IODE Report Commands

    Python Equivalent

    datacreate

    if name not in workspace:  `` --> See :meth:`Database.__contains__` ``    workspace[name] = value –> See Database.__setitem__()

    datadelete

    del workspace[name] –> See See Database.__delitem__()

    dataexist

    name in workspace –> See Database.__contains__()

    dataedit

    workspace[name] = value –> See Database.__setitem__()

    dataupdate

    workspace[name] = value –> See Database.__setitem__()

    dataappend

    workspace[new_name] = value –> See Database.__setitem__()

    dataduplicate

    workspace[new_name] = workspace[name] –> See Database.__setitem__()

    datarename

    workspace.rename(old_name, new_name) –> See Database.rename()

    datasearch

    workspace.search(pattern, word, case_sensitive, in_name, in_formula, in_text, list_result) –> See Database.search()

    datascan

    (equations|identities|tables)[pattern].coefficients –> See Equations.coefficients() (equations|identities|tables)[pattern].variables –> See Equations.variables()

    datalistXxx

    names = workspace.get_names(pattern) –> See Database.get_names() and Database.names`() names = workspace.get_names(pattern, filepath)

    datalistsort

    lists[list_name] = sorted(lists[list_name])

    datalistcount

    len(lists[list_name])

    datacompareEps

    variables.threshold = value –> See Variables.threshold()

    datacompareXxx

    workspace.compare(filepath, only_in_workspace_list_name, only_in_file_list_name, `` --> See :meth:`Database.compare` ``                  equal_objects_list_name, different_objects_list_name)

    datacalclst

    list1, list2 = lists[name_1], lists[name_2] union: list(set(list1) | set(list2)) intersection: list(set(list1) & set(list2)) difference: list(set(list1) - set(list2))

    datacalcvar

    variables[varname] = lec_formula –> See Database.__setitem__()

    datadisplaygraph

    df = variables.to_frame() then see Chart visualization

    datasavegraph

    df = variables.to_frame() then see Chart visualization

    datawidthvar

    Managed in the graphical user interface

    datandecvar

    Managed in the graphical user interface

    datamodevar

    variables.mode = VAR_MODE_LEVEL –> See Variables.mode()

    datastartvar

    Managed in the graphical user interface

    datawidthtbl

    Managed in the graphical user interface

    datawidthscl

    Managed in the graphical user interface

    datandecscl

    Managed in the graphical user interface

    dataeditcnf

    Managed in the graphical user interface

    datarasvar

    variables.execute_RAS(pattern, xdim, ydim, ref_year, sum_year, maxit, epsilon) –> See Variables.execute_RAS()

    datapatternXXX

    workspace.get_names_from_pattern(list_name, pattern, xdim, ydim) –> See Database.get_names_from_pattern()

Equations

IODE Report Commands

Python Equivalent

EqsEstimate

equations.estimate(from_period, to_period, list_eqs) –> See Equations.estimate() or equations[name].estimate(from_period, to_period) –> See Equation.estimate()

EqsStepWise

equations[eq_name].estimate_step_wise(from_period, to_period, lec_condition, test) –> See Equations.estimate_step_wise()

EqsSetCmt

equations[eq_name].comment = "new_comment" –> See Equation.comment()

EqsSetSample

equations[eq_name].sample = "from:to" –> See Equation.sample()

EqsSetMethod

equations[eq_name].method = EQ_METHOD_LSQ –> See Equation.method()

EqsSetInstrs

equations[eq_name].instruments = "instruments" –> See Equation.instruments()

EqsSetBloc

equations[eq_name].block = "block" –> See Equation.block()

Computed Tables

IODE Report Commands

Python Equivalent

PrintTblFile

tables.print_tables_as = "COMPUTED" –> See Tables.print_tables_as() tables.print_to_file(destination_file, names, generalized_sample, nb_decimals) –> See iode.Tables.print_to_file()

PrintTbl

computed_table = tables[table_name].compute(generalized_sample, extra_files, nb_decimals) –> See iode.Table.compute() computed_table.print_to_file(destination_file, format) –> See iode.ComputedTable.print_to_file()

ViewTblFile

load_extra_files(list_of_files) –> See iode.load_extra_files()

ViewTbl

computed_table = table.compute(generalized_sample, extra_files, nb_decimals) –> See iode.Table.compute()

ViewByTbl

alias of ViewTbl (line above)

PrintVar

table = Table(2, title, list_of_variables) –> See iode.Table computed_table = tables[table_name].compute(generalized_sample, extra_files, nb_decimals) –> See iode.Table.compute() computed_table.print_to_file(destination_file, format) –> See iode.ComputedTable.print_to_file()

ViewVar

table = Table(2, title, list_of_variables) –> See iode.Table computed_table = table.compute(generalized_sample, extra_files, nb_decimals) –> See iode.Table.compute()

ViewWidth

Managed in the graphical user interface

ViewWidth0

Managed in the graphical user interface

ViewNdec

computed_table = tables[table_name].compute(generalized_sample, extra_files, nb_decimals) –> See iode.Table.compute()

ViewGr

computed_table = tables[table_name].compute(generalized_sample, extra_files, nb_decimals) –> See iode.Table.compute() computed_table.plot(title, plot_type, ...) –> See iode.ComputedTable.plot()

PrintGr

No longer maintained: use computed_table.print_to_file(destination_file, format) instead –> See iode.ComputedTable.print_to_file()

Models

IODE Report Commands

Python Equivalent

ModelCalcSCC

simu.model_calculate_SCC(nb_iterations, pre_name, inter_name, post_name, list_eqs) –> See Simulation.model_calculate_SCC()

ModelSimulateParms

simu = Simulation(convergence_threshold, relax, max_nb_iterations, sort_algorithm, `` ``                  initialization_method, debug, nb_passes, debug_newton) –> See Simulation()

ModelSimulate

simu.model_simulate(from_period, to_period, list_eqs) –> See Simulation.model_simulate()

ModelSimulateSCC

simu.model_simulate_SCC(from_period, to_period, pre_name, inter_name, post_name) –> See Simulation.model_simulate_SCC()

ModelExchange

simu.model_exchange(list_exo) –> See Simulation.model_exchange()

ModelCompile

simu.model_compile(list_eqs) –> See Simulation.model_compile()

ModelSimulateSaveNiters

simu.save_nb_iterations("NB_ITER") –> See Simulation.save_nb_iterations()

ModelSimulateSaveNorms

simu.save_norms("SIMU_NORM") –> See Simulation.save_norms()

Execute Identities

IODE Report Commands

Python Equivalent

idtexecute

identities.execute(identities, from_period, to_period, var_files, scalar_files, trace) –> See Identities.execute()

idtexecutetrace

identities.execute(identities, from_period, to_period, var_files, scalar_files, trace) –> See Identities.execute()

idtexecutevarfiles

identities.execute(identities, from_period, to_period, var_files, scalar_files, trace) –> See Identities.execute()

idtexecutesclfiles

identities.execute(identities, from_period, to_period, var_files, scalar_files, trace) –> See Identities.execute()

Reports

IODE Report Commands

Python Equivalent

ReportExec

execute_report(filepath, parameters) –> See execute_report()

Miscellaneous

IODE Report Commands

Python Equivalent

StatUnitRoot

dickey_fuller_test(lec, drift, trend, order) –> See dickey_fuller_test()

FileImportCmt

comments.convert_file(input_file, input_format, save_file, rule_file, debug_file) –> See Comments.convert_file()

FileImportVar

variables.convert_file(input_file, input_format, save_file, rule_file, from_period, to_period, debug_file) –> See Variables.convert_file()