Skip to content
Snippets Groups Projects
Commit dec9eced authored by sandcha's avatar sandcha
Browse files

Merge branch 'strates-as-scale' into 'master'

Fait des strates démographiques un paramètre

See merge request !39
parents 5a5c9e7a d89aab4f
No related branches found
No related tags found
1 merge request!39Fait des strates démographiques un paramètre
Pipeline #20059 passed
......@@ -6,13 +6,15 @@ stages:
- build
- deploy
# get a cache before each stage
cache:
untracked: true
# In key name, include Docker image to explicit Python version. Ref slug for branch or tag name.
key: cache-${CI_JOB_IMAGE}-${CI_COMMIT_REF_SLUG}
paths:
- .venv/
- ./dist
# add the untracked files to the cache.zip
untracked: true
before_script:
......@@ -23,6 +25,9 @@ dependencies:
# Prevent call of before_script because it will fail
before_script:
- ''
tags:
# run only on runners automatically sharing cache (with 'leximpact-shared-cache' tag)
- leximpact-shared-cache
script:
- python -m venv .venv
- source .venv/bin/activate
......@@ -31,12 +36,16 @@ dependencies:
check-style:
stage: test
needs: ["dependencies"]
tags:
- leximpact-shared-cache
script:
- make check-style
test:
stage: test
needs: ["dependencies"]
tags:
- leximpact-shared-cache
script:
- make test-ci
......@@ -57,6 +66,7 @@ validate_yaml:
check_version:
stage: test
# TODO check if this job really needs "dependencies" and explicit why
needs: ["dependencies"]
script:
# Check for functional changes and version number
......@@ -66,6 +76,8 @@ check_version:
build:
stage: build
tags:
- leximpact-shared-cache
script:
- make build
......@@ -73,6 +85,8 @@ build:
# release needed to bypass 'git tag' access rights configuration limited by annual token
release-and-tag:
stage: deploy
tags:
- leximpact-shared-cache
needs: ["build"]
# use release-cli to get release name from variable
image: registry.gitlab.com/gitlab-org/release-cli:latest
......@@ -93,6 +107,8 @@ release-and-tag:
deploy-wheel:
stage: deploy
needs: ["build"]
tags:
- leximpact-shared-cache
script:
- if ! .gitlab/ci/has-functional-changes.sh ; then exit 0 ; fi
# publish the wheel knowing that artifacts from all previous stages are passed by default
......
# Changelog
## 4.2.0 [!39](https://git.leximpact.dev/leximpact/simulateur-dotations-communes/openfisca-france-dotations-locales/-/merge_requests/39)
* Évolution du système socio-fiscal.
* Périodes concernées : 01/01/2017
* Zones impactées :
- `parameters/population/groupes_demographiques.yaml`
- `variables/population.py`
* Détails :
- Extrait de `strate_demographique` les seuils de strates en un paramètre `population.groupes_demographiques`
- Définit en CI que les runners GitLab doivent avoir pour tag `leximpact-shared-cache`
### 4.1.1 [!38](https://git.leximpact.dev/leximpact/simulateur-dotations-communes/openfisca-france-dotations-locales/-/merge_requests/38)
* Évolution du système socio-fiscal.
......
description: Groupes démographiques des communes déterminés en fonction de l'importance de leur population \
(autrement désignés par strates démographiques)
metadata:
type: single_amount
reference: https://www.legifrance.gouv.fr/codes/article_lc/LEGIARTI000033878299
# la référence définit les seuils mais pas de numéro de groupe (strate) qu'on déduit ici
brackets:
- amount:
2017-01-01:
value: 1
threshold:
2017-01-01:
value: 0
- amount:
2017-01-01:
value: 2
threshold:
2017-01-01:
value: 500
- amount:
2017-01-01:
value: 3
threshold:
2017-01-01:
value: 1_000
- amount:
2017-01-01:
value: 4
threshold:
2017-01-01:
value: 2_000
- amount:
2017-01-01:
value: 5
threshold:
2017-01-01:
value: 3_500
- amount:
2017-01-01:
value: 6
threshold:
2017-01-01:
value: 5_000
- amount:
2017-01-01:
value: 7
threshold:
2017-01-01:
value: 7_500
- amount:
2017-01-01:
value: 8
threshold:
2017-01-01:
value: 10_000
- amount:
2017-01-01:
value: 9
threshold:
2017-01-01:
value: 15_000
- amount:
2017-01-01:
value: 10
threshold:
2017-01-01:
value: 20_000
- amount:
2017-01-01:
value: 11
threshold:
2017-01-01:
value: 35_000
- amount:
2017-01-01:
value: 12
threshold:
2017-01-01:
value: 50_000
- amount:
2017-01-01:
value: 13
threshold:
2017-01-01:
value: 75_000
- amount:
2017-01-01:
value: 14
threshold:
2017-01-01:
value: 100_000
- amount:
2017-01-01:
value: 15
threshold:
2017-01-01:
value: 200_000
......@@ -16,24 +16,8 @@ class strate_demographique(Variable):
def formula(commune, period, parameters):
pop = commune('population_dgf', period)
return (
+ 1 * (pop <= 499)
+ 2 * (499 < pop) * (pop <= 999)
+ 3 * (999 < pop) * (pop <= 1999)
+ 4 * (1999 < pop) * (pop <= 3499)
+ 5 * (3499 < pop) * (pop <= 4999)
+ 6 * (4999 < pop) * (pop <= 7499)
+ 7 * (7499 < pop) * (pop <= 9999)
+ 8 * (9999 < pop) * (pop <= 14999)
+ 9 * (14999 < pop) * (pop <= 19999)
+ 10 * (19999 < pop) * (pop <= 34999)
+ 11 * (34999 < pop) * (pop <= 49999)
+ 12 * (49999 < pop) * (pop <= 74999)
+ 13 * (74999 < pop) * (pop <= 99999)
+ 14 * (99999 < pop) * (pop <= 199999)
+ 15 * (199999 < pop)
)
bareme_strates_demographiques = parameters(period).population.groupes_demographiques
return bareme_strates_demographiques.calc(pop)
class population_insee(Variable):
......
......@@ -4,7 +4,7 @@ from setuptools import setup, find_packages
setup(
name = "OpenFisca-France-Dotations-Locales",
version = "4.1.1",
version = "4.2.0",
author = "LexImpact Team",
author_email = "leximpact@an.fr",
classifiers=[
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment