Equivalence Between IODE Report and Python Syntax
Equivalence Between IODE Report Execution Commands And Python Functions
IODE Report Command
Python Equivalent
$abort
$ask
$beep
No equivalent
$chdir
$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
$multiline
use the backslash `` at the end of the line to continue on the next line
$msg
$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
$quit
$quitode
No longer maintained
$repeat
for arg in arguments:`` command(arg) ``$repeatstring
No equivalent
$return
return value –> See Python Return Statement
$rmdir
$settime
set_t(value) –> See
set_t()$shift
No equivalent
$show
$sleep
$system
$vseps
Equivalence Between IODE Report And Python Functions
IODE Report Functions
Python Equivalent
@upper(txt)
@lower(txt)
@replace(txt, from, to)
@fmt(val, fmt)
@take(n, txt)
@drop(n, txt)
@count(txt)
@index(n, list_txt)
@sqz(txt)
@strip(txt)
@ansi(txt)See String Methods
@equal(t1, t2)t1 == t2 –> See Python Comparisons
@void(t1, ...)No equivalence
@vtake(n, list_txt)
@vdrop(n, list_txt)
@vcount(list_txt)
@fdelete(filepath)
@fappend(filepath, txt)
@getdir()
@chdir(dirname)
@mkdir(dirname)
@rmdir(dirname)
@date(format)
@time(format)
@month(month, language)
@ChronoReset()
@ChronoGet()
@cexpand(pattern)
comments.get_names(pattern)–> SeeDatabase.get_names()andDatabase.names()
@eexpand(pattern)
equations.get_names(pattern)–> SeeDatabase.get_names()andDatabase.names()
@iexpand(pattern)
identities.get_names(pattern)–> SeeDatabase.get_names()andDatabase.names()
@lexpand(pattern)
lists.get_names(pattern)–> SeeDatabase.get_names()andDatabase.names()
@sexpand(pattern)
scalars.get_names(pattern)–> SeeDatabase.get_names()andDatabase.names()
@texpand(pattern)
tables.get_names(pattern)–> SeeDatabase.get_names()andDatabase.names()
@vexpand(pattern)
variables.get_names(pattern)–> SeeDatabase.get_names()andDatabase.names()
@vliste(eq_name)
equations[eq_name].get_variables_list()–> SeeEquation.get_variables_list()
@sliste(eq_name)
equations[eq_name].get_coefficients_list()–> SeeEquation.get_coefficients_list()
@ttitle(table_name)
Tables[table_name].title–> SeeTable.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()andSample.start()
@eqsampleto(eq_name)equations[eq_name].sample.end –> See
Equation.sample()adndSample.end()
@eqlhs(eq_name)
lhs, rhs = equations[eq_name].split_equation()–> SeeEquation.split_equation()
@eqrhs(eq_name)
lhs, rhs = equations[eq_name].split_equation()–> SeeEquation.split_equation()
@SqlOpenNo longer maintained
@SqlQueryNo longer maintained
@SqlNextNo longer maintained
@SqlFieldNo longer maintained
@SqlRecordNo longer maintained
@SqlCloseNo longer maintained
@SimEps()
simu.convergence_threshold–> SeeSimulation.convergence_threshold()
@SimRelax()
simu.relax–> SeeSimulation.relax()
@SimMaxit()
simu.max_nb_iterations–> SeeSimulation.max_nb_iterations()
@SimNiter(period)
simu.nb_iterations(period)–> SeeSimulation.nb_iterations()
@SimNorm(period)
simu.norm(period)–> SeeSimulation.norm()
Equivalence Between IODE Report Commands and Python Methods
Workspaces
- Below workspace must be replaced by either:
comments
equations
identities
lists
scalars
tables
variables
IODE Report Commands
Python Equivalent
WsLoadworkspace.load(filepath)–> SeeDatabase.load()WsCopyworkspace.copy_into(filepath)–> SeeDatabase.copy_into()WsMergeworkspace.merge_from(filepath)–> SeeDatabase.merge_from()WsClearworkspace.clear()–> SeeDatabase.clear()WsClearAllexecute_command("$WsClearAll")–> Seeexecute_command()WsDescrworkspace.description–> SeeDatabase.description()WsSaveworkspace.save(filepath)–> SeeDatabase.save()WsSaveCmpworkspace.save(filepath, True)–> SeeDatabase.save()WsSamplevariables.sample = "1990Y1:2050Y1"–> SeeVariables.sample()WsExtrapolatevariables.extrapolate(method, from_, to_, variables_list)–> SeeVariables.extrapolate()WsLtohStockvariables.low_to_high(LTOH_STOCK, method, filepath, var_list)–> SeeVariables.low_to_high()WsLtohFlowvariables.low_to_high(LTOH_FLOW, method, filepath, var_list)–> SeeVariables.low_to_high()WsHtolSumvariables.high_to_low(HTOL_SUM, filepath, var_list)–> SeeVariables.high_to_low()WsHtolMeanvariables.high_to_low(HTOL_MEAN, filepath, var_list)–> SeeVariables.high_to_low()WsHtolLastvariables.high_to_low(HTOL_LAST, filepath, var_list)–> SeeVariables.high_to_low()WsSeasonAdjvariables.seasonal_adjustment(input_file, eps_test, series)–> SeeVariables.seasonal_adjustment()WsSeasAdjvariables.seasonal_adjustment(input_file, eps_test, series)–> SeeVariables.seasonal_adjustment()WsTrendvariables.trend_correction(input_file, lambda_, series, log=True)–> SeeVariables.trend_correction()WsTrendStdvariables.trend_correction(input_file, lambda_, series, log=False)–> SeeVariables.trend_correction()WsImportworkspace.load(filepath)–> SeeDatabase.load()WsExportworkspace.save(filepath)–> SeeDatabase.save()WsImportEviewsexecute_command("$WsImportEviews")–> Seeexecute_command()CsvSavedf = workspace.to_frame()–> Seeiode.Variables.to_frame()df.to_csv(filepath, …) [4]CsvDigitsdf = workspace.to_frame()–> Seeiode.Variables.to_frame()df.to_csv(filepath, …) [4]CsvSepdf = workspace.to_frame()–> Seeiode.Variables.to_frame()ndf.to_csv(filepath, …) [4]CsvDecdf = workspace.to_frame()–> Seeiode.Variables.to_frame()ndf.to_csv(filepath, …) [4]CsvNaNdf = workspace.to_frame()–> Seeiode.Variables.to_frame()df.to_csv(filepath, …) [4]CsvAxesdf = workspace.to_frame()–> Seeiode.Variables.to_frame()df.to_csv(filepath, …) [4]
Assuming library pandas is installed.
Data
- Below workspace must be replaced by either:
comments
equations
identities
lists
scalars
tables
variables
IODE Report Commands
Python Equivalent
datacreateif name not in workspace: `` --> See :meth:`Database.__contains__` `` workspace[name] = value–> SeeDatabase.__setitem__()datadeletedel workspace[name]–> See SeeDatabase.__delitem__()dataexistname in workspace–> SeeDatabase.__contains__()dataeditworkspace[name] = value–> SeeDatabase.__setitem__()dataupdateworkspace[name] = value–> SeeDatabase.__setitem__()dataappendworkspace[new_name] = value–> SeeDatabase.__setitem__()dataduplicateworkspace[new_name] = workspace[name]–> SeeDatabase.__setitem__()datarenameworkspace.rename(old_name, new_name)–> SeeDatabase.rename()datasearchworkspace.search(pattern, word, case_sensitive, in_name, in_formula, in_text, list_result)–> SeeDatabase.search()datascan(equations|identities|tables)[pattern].coefficients–> SeeEquations.coefficients()(equations|identities|tables)[pattern].variables–> SeeEquations.variables()datalistXxxnames = workspace.get_names(pattern)–> SeeDatabase.get_names()andDatabase.names`()names = workspace.get_names(pattern, filepath)datalistsortlists[list_name] = sorted(lists[list_name])datalistcountlen(lists[list_name])datacompareEpsvariables.threshold = value–> SeeVariables.threshold()datacompareXxxworkspace.compare(filepath, only_in_workspace_list_name, only_in_file_list_name, `` --> See :meth:`Database.compare` `` equal_objects_list_name, different_objects_list_name)datacalclstlist1, 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))datacalcvarvariables[varname] = lec_formula–> SeeDatabase.__setitem__()datadisplaygraphdf = variables.to_frame()then see Chart visualizationdatasavegraphdf = variables.to_frame()then see Chart visualizationdatawidthvarManaged in the graphical user interface
datandecvarManaged in the graphical user interface
datamodevarvariables.mode = VAR_MODE_LEVEL–> SeeVariables.mode()datastartvarManaged in the graphical user interface
datawidthtblManaged in the graphical user interface
datawidthsclManaged in the graphical user interface
datandecsclManaged in the graphical user interface
dataeditcnfManaged in the graphical user interface
datarasvarvariables.execute_RAS(pattern, xdim, ydim, ref_year, sum_year, maxit, epsilon)–> SeeVariables.execute_RAS()datapatternXXXworkspace.get_names_from_pattern(list_name, pattern, xdim, ydim)–> SeeDatabase.get_names_from_pattern()
Equations
IODE Report Commands
Python Equivalent
EqsEstimate
equations.estimate(from_period, to_period, list_eqs)–> SeeEquations.estimate()orequations[name].estimate(from_period, to_period)–> SeeEquation.estimate()
EqsStepWise
equations[eq_name].estimate_step_wise(from_period, to_period, lec_condition, test)–> SeeEquations.estimate_step_wise()
EqsSetCmt
equations[eq_name].comment = "new_comment"–> SeeEquation.comment()
EqsSetSample
equations[eq_name].sample = "from:to"–> SeeEquation.sample()
EqsSetMethod
equations[eq_name].method = EQ_METHOD_LSQ–> SeeEquation.method()
EqsSetInstrs
equations[eq_name].instruments = "instruments"–> SeeEquation.instruments()
EqsSetBloc
equations[eq_name].block = "block"–> SeeEquation.block()
Computed Tables
IODE Report Commands
Python Equivalent
PrintTblFile
tables.print_tables_as = "COMPUTED"–> SeeTables.print_tables_as()tables.print_to_file(destination_file, names, generalized_sample, nb_decimals)–> Seeiode.Tables.print_to_file()
PrintTbl
computed_table = tables[table_name].compute(generalized_sample, extra_files, nb_decimals)–> Seeiode.Table.compute()computed_table.print_to_file(destination_file, format)–> Seeiode.ComputedTable.print_to_file()
ViewTblFile
load_extra_files(list_of_files)–> Seeiode.load_extra_files()
ViewTbl
computed_table = table.compute(generalized_sample, extra_files, nb_decimals)–> Seeiode.Table.compute()
ViewByTblalias of
ViewTbl(line above)
PrintVar
table = Table(2, title, list_of_variables)–> Seeiode.Tablecomputed_table = tables[table_name].compute(generalized_sample, extra_files, nb_decimals)–> Seeiode.Table.compute()computed_table.print_to_file(destination_file, format)–> Seeiode.ComputedTable.print_to_file()
ViewVar
table = Table(2, title, list_of_variables)–> Seeiode.Tablecomputed_table = table.compute(generalized_sample, extra_files, nb_decimals)–> Seeiode.Table.compute()
ViewWidthManaged in the graphical user interface
ViewWidth0Managed in the graphical user interface
ViewNdec
computed_table = tables[table_name].compute(generalized_sample, extra_files, nb_decimals)–> Seeiode.Table.compute()
ViewGr
computed_table = tables[table_name].compute(generalized_sample, extra_files, nb_decimals)–> Seeiode.Table.compute()computed_table.plot(title, plot_type, ...)–> Seeiode.ComputedTable.plot()
PrintGrNo longer maintained: use
computed_table.print_to_file(destination_file, format)instead –> Seeiode.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)–> SeeSimulation.model_calculate_SCC()
ModelSimulateParms
simu = Simulation(convergence_threshold, relax, max_nb_iterations, sort_algorithm, `` `` initialization_method, debug, nb_passes, debug_newton)–> SeeSimulation()
ModelSimulate
simu.model_simulate(from_period, to_period, list_eqs)–> SeeSimulation.model_simulate()
ModelSimulateSCC
simu.model_simulate_SCC(from_period, to_period, pre_name, inter_name, post_name)–> SeeSimulation.model_simulate_SCC()
ModelExchange
simu.model_exchange(list_exo)–> SeeSimulation.model_exchange()
ModelCompile
simu.model_compile(list_eqs)–> SeeSimulation.model_compile()
ModelSimulateSaveNiters
simu.save_nb_iterations("NB_ITER")–> SeeSimulation.save_nb_iterations()
ModelSimulateSaveNorms
simu.save_norms("SIMU_NORM")–> SeeSimulation.save_norms()
Execute Identities
IODE Report Commands
Python Equivalent
idtexecute
identities.execute(identities, from_period, to_period, var_files, scalar_files, trace)–> SeeIdentities.execute()idtexecutetrace
identities.execute(identities, from_period, to_period, var_files, scalar_files, trace)–> SeeIdentities.execute()idtexecutevarfiles
identities.execute(identities, from_period, to_period, var_files, scalar_files, trace)–> SeeIdentities.execute()idtexecutesclfiles
identities.execute(identities, from_period, to_period, var_files, scalar_files, trace)–> SeeIdentities.execute()
Reports
IODE Report Commands
Python Equivalent
ReportExec
execute_report(filepath, parameters)–> Seeexecute_report()
Print IODE Objects
IODE Report Commands
Python Equivalent
PrintNbDec
equations.print_nb_decimals = value–> See SeeEquations.print_nb_decimals()scalars.print_nb_decimals = value–> See SeeScalars.print_nb_decimals()tables.print_nb_decimals = value–> See SeeTables.print_nb_decimals()PrintObjTitle
tables.print_tables_as = enum–> See SeeTables.print_tables_as()PrintObjInfos
equations.print_equations_as = enum–> See SeeEquations.print_equations_as()PrintObjLec
equations.print_equations_lec_as = enum–> See SeeEquations.print_equations_lec_as()PrintObjDefXxx
workspace.print_to_file(filepath, names)–> See SeeComments.print_to_file()
Miscellaneous
IODE Report Commands
Python Equivalent
StatUnitRoot
dickey_fuller_test(lec, drift, trend, order)–> Seedickey_fuller_test()FileImportCmt
comments.convert_file(input_file, input_format, save_file, rule_file, debug_file)–> SeeComments.convert_file()FileImportVar
variables.convert_file(input_file, input_format, save_file, rule_file, from_period, to_period, debug_file)–> SeeVariables.convert_file()