Fix Python compilation and runtime

This commit is contained in:
Denis Merigoux 2023-11-22 18:08:44 +01:00
parent 67d1665afc
commit fc242a5d1f
No known key found for this signature in database
GPG Key ID: EE99DCFA365C3EE3
3 changed files with 6 additions and 4 deletions

View File

@ -319,13 +319,15 @@ let rec format_expression (ctx : decl_ctx) (fmt : Format.formatter) (e : expr) :
| EApp ((EOp (Log (VarDef var_def_info, info)), _), [arg1])
when Cli.globals.trace ->
Format.fprintf fmt
"log_variable_definition(%a,@ LogIO(io_input=%s,@ io_output=%b),@ %a)"
"log_variable_definition(%a,@ LogIO(input_io=InputIO.%s,@ \
output_io=%s),@ %a)"
format_uid_list info
(match var_def_info.log_io_input with
| Runtime.NoInput -> "NoInput"
| Runtime.OnlyInput -> "OnlyInput"
| Runtime.Reentrant -> "Reentrant")
var_def_info.log_io_output (format_expression ctx) arg1
(if var_def_info.log_io_output then "True" else "False")
(format_expression ctx) arg1
| EApp ((EOp (Log (PosRecordIfTrueBool, _)), pos), [arg1])
when Cli.globals.trace ->
Format.fprintf fmt

View File

@ -36,4 +36,4 @@
(action
(chdir
%{workspace_root}
(run catala Python -O %{dep:aides_logement.catala_fr}))))
(run catala Python -O -t %{dep:aides_logement.catala_fr}))))

View File

@ -431,7 +431,7 @@ def money_of_decimal(d: Decimal) -> Money:
"""
Warning: rounds to the nearest cent
"""
return Money(Integer(mpz(d.value)))
return Money(Integer(mpz(d.value) * mpz(100)))
# --------