|
|
# Dynare Python
|
|
|
|
|
|
The general goal of the project is to create a Python package that can
|
|
|
|
|
|
- trigger the Dynare Preprocessor
|
|
|
- apply Python algorithms to Python representation of a Dynare model
|
|
|
- call Julia to leverage DynareJulia algorithms and recover results as Python objects
|
|
|
- call Matlab/Octave to leverage Dynare Matlab/Octave algorithms and recover results as Python objects
|
|
|
- call Julia to leverage DynareJulia algorithms and recover results as Python objects
|
|
|
- call Matlab/Octave to leverage Dynare Matlab/Octave algorithms and recover results as Python objects
|
|
|
|
|
|
## Development tasks
|
|
|
|
|
|
### Add Python output to the Dynare Preprocessor
|
|
|
|
|
|
Either
|
|
|
- as *.pi file
|
|
|
|
|
|
- as \*.py file
|
|
|
- calling the bytecode library generated by the preprosessor
|
|
|
#### *.py files
|
|
|
|
|
|
#### \*.py files
|
|
|
|
|
|
- Adapt the Julia specific code for Python in
|
|
|
* `ModelTree.hh`
|
|
|
* `DynamicModel.cc` and `DynamicModel.hh`
|
|
|
* `StaticModel.cc` and `StaticModel.hh`
|
|
|
* `ExtendedPreprocessorTypes.hh`
|
|
|
* `ExprNode.hh`
|
|
|
* `ModelEquationBlock.cc` and `ModelEquationsBlock.hh`
|
|
|
* add language Python as language option in `DynareMain.cc` (see Julia option)
|
|
|
* the main differences between Python code and Julia code relevant here are
|
|
|
- `def` instead of `function`
|
|
|
- array indexing starts with 0 instead of 1
|
|
|
- Python functions don't terminate with `end`
|
|
|
- maybe it is possible to generalize the existing code for Julia
|
|
|
* in `ModelTree.hh` creates `dynamic_set_auxiliary_series()` that manipulates time series with `lag` and `lead` functions. We need to choose a time series representation in Python.
|
|
|
|
|
|
#### calling the bytecode library generated by the preprocessor
|
|
|
- the code for `bytecode` `mex` file needs to separated between a `mex` wrapper and a standard `C`library
|
|
|
|
|
|
### Decide about the distribution of Dynare Preprocessor for Python (should be transparent to the Python user who installs the Dynare Python package)
|
|
|
### Use [JuliaCall](https://juliapy.github.io/PythonCall.jl/stable/juliacall/) to call DynareJulia |
|
|
|
|
|
### Use [JuliaCall](https://juliapy.github.io/PythonCall.jl/stable/juliacall/) to call DynareJulia |
|
|
\ No newline at end of file |