Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
leximpact-server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
leximpact
Simulateur dotations aux communes
leximpact-server
Commits
5c496423
Commit
5c496423
authored
Jun 24, 2020
by
Augustin Wenger
Browse files
Options
Downloads
Patches
Plain Diff
Ajout du nbptr dans l'output pour les cas avec res_brut
parent
6e959511
No related branches found
No related tags found
1 merge request
!20
Nbptr in results
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Simulation_engine/simulate_pop_from_reform.py
+11
-1
11 additions, 1 deletion
Simulation_engine/simulate_pop_from_reform.py
with
11 additions
and
1 deletion
Simulation_engine/simulate_pop_from_reform.py
+
11
−
1
View file @
5c496423
...
...
@@ -205,6 +205,9 @@ def compare(period: str, dictionnaire_simulations, compute_deciles=True):
impots_par_reforme
=
next
(
iter
(
dictionnaire_simulations
.
values
()))[
1
][
"
foyer_fiscal
"
][[
"
wprm
"
]]
nbptr_par_reforme
=
next
(
iter
(
dictionnaire_simulations
.
values
()))[
1
][
"
foyer_fiscal
"
][[
"
wprm
"
]]
for
nom_simulation
in
dictionnaire_simulations
:
impots_par_reforme
[
nom_simulation
]
=
dictionnaire_simulations
[
nom_simulation
][
0
...
...
@@ -213,6 +216,9 @@ def compare(period: str, dictionnaire_simulations, compute_deciles=True):
impots_par_reforme
[
"
rfr
"
]
=
dictionnaire_simulations
[
nom_simulation
][
0
].
calculate
(
"
rfr
"
,
period
)
nbptr_par_reforme
[
nom_simulation
]
=
dictionnaire_simulations
[
nom_simulation
][
0
].
calculate
(
"
nbptr
"
,
period
)
for
nom_res_base
in
liste_noms_reformes_avec_apres
:
res
[
nom_res_base
]
=
-
(
...
...
@@ -287,7 +293,11 @@ def compare(period: str, dictionnaire_simulations, compute_deciles=True):
for
simu
in
dic_res_brut
:
for
cas_type
in
dic_res_brut
[
simu
]:
dic_res_brut
[
simu
][
cas_type
]
=
int
(
round
(
dic_res_brut
[
simu
][
cas_type
]))
resultat
=
{
"
total
"
:
total
,
"
res_brut
"
:
dic_res_brut
}
dic_nbptr
=
nbptr_par_reforme
.
to_dict
()
for
simu
in
dic_nbptr
:
for
cas_type
in
dic_nbptr
[
simu
]:
dic_nbptr
[
simu
][
cas_type
]
=
dic_nbptr
[
simu
][
cas_type
]
resultat
=
{
"
total
"
:
total
,
"
res_brut
"
:
dic_res_brut
,
"
nbreParts
"
:
dic_nbptr
}
return
resultat
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment