Skip to content

Commit

Permalink
feat: update latest input data (eqasim-org#289)
Browse files Browse the repository at this point in the history
* feat : update data path and name

* feat : change test & docs

* fix : date BD-TOPO

* fix : rectify test

* fix : Changelog conflict

* fix : change fix

---------

Co-authored-by: Marie Laurent <[email protected]>
  • Loading branch information
2 people authored and Nitnelav committed Jan 20, 2025
1 parent 8db341a commit 4253bcb
Show file tree
Hide file tree
Showing 11 changed files with 94 additions and 94 deletions.
4 changes: 2 additions & 2 deletions data/bpe/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

def configure(context):
context.config("data_path")
context.config("bpe_path", "bpe_2021/bpe21_ensemble_xy_csv.zip")
context.config("bpe_csv", "bpe21_ensemble_xy.csv")
context.config("bpe_path", "bpe_2023/BPE23.zip")
context.config("bpe_csv", "BPE23.csv")
context.stage("data.spatial.codes")

def execute(context):
Expand Down
3 changes: 2 additions & 1 deletion data/census/cleaned.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ def execute(context):
df.loc[df["TRANS"] == "2", "commute_mode"] = "walk"
df.loc[df["TRANS"] == "3", "commute_mode"] = "bike"
df.loc[df["TRANS"] == "4", "commute_mode"] = "car"
df.loc[df["TRANS"] == "5", "commute_mode"] = "pt"
df.loc[df["TRANS"] == "5", "commute_mode"] = "car"
df.loc[df["TRANS"] == "6", "commute_mode"] = "pt"
df.loc[df["TRANS"] == "Z", "commute_mode"] = np.nan
df["commute_mode"] = df["commute_mode"].astype("category")

Expand Down
6 changes: 3 additions & 3 deletions data/census/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ def configure(context):
context.stage("data.spatial.codes")

context.config("data_path")
context.config("census_path", "rp_2019/RP2019_INDCVI_csv.zip")
context.config("census_csv", "FD_INDCVI_2019.csv")
context.config("census_path", "rp_2021/RP2021_indcvi.zip")
context.config("census_csv", "FD_INDCVI_2021.csv")

context.config("projection_year", None)

Expand Down Expand Up @@ -65,6 +65,6 @@ def execute(context):

def validate(context):
if not os.path.exists("{}/{}".format(context.config("data_path"), context.config("census_path"))):
raise RuntimeError("RP 2019 data is not available")
raise RuntimeError("RP 2021 data is not available")

return os.path.getsize("{}/{}".format(context.config("data_path"), context.config("census_path")))
8 changes: 4 additions & 4 deletions data/od/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
def configure(context):
context.stage("data.spatial.codes")
context.config("data_path")
context.config("od_pro_path", "rp_2019/RP2019_MOBPRO_csv.zip")
context.config("od_sco_path", "rp_2019/RP2019_MOBSCO_csv.zip")
context.config("od_pro_csv", "FD_MOBPRO_2019.csv")
context.config("od_sco_csv", "FD_MOBSCO_2019.csv")
context.config("od_pro_path", "rp_2021/RP2021_mobpro.zip")
context.config("od_sco_path", "rp_2021/RP2021_mobsco.zip")
context.config("od_pro_csv", "FD_MOBPRO_2021.csv")
context.config("od_sco_csv", "FD_MOBSCO_2021.csv")

def execute(context):
df_codes = context.stage("data.spatial.codes")
Expand Down
4 changes: 2 additions & 2 deletions data/spatial/codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def configure(context):

context.config("regions", [11])
context.config("departments", [])
context.config("codes_path", "codes_2021/reference_IRIS_geo2021.zip")
context.config("codes_xlsx", "reference_IRIS_geo2021.xlsx")
context.config("codes_path", "codes_2023/reference_IRIS_geo2023.zip")
context.config("codes_xlsx", "reference_IRIS_geo2023.xlsx")

def execute(context):
# Load IRIS registry
Expand Down
2 changes: 1 addition & 1 deletion data/spatial/iris.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

def configure(context):
context.config("data_path")
context.config("iris_path", "iris_2021")
context.config("iris_path", "iris_2023")
context.stage("data.spatial.codes")

def execute(context):
Expand Down
6 changes: 3 additions & 3 deletions data/spatial/population.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
def configure(context):
context.config("data_path")
context.stage("data.spatial.codes")
context.config("population_path", "rp_2019/base-ic-evol-struct-pop-2019.zip")
context.config("population_xlsx", "base-ic-evol-struct-pop-2019.xlsx")
context.config("population_year", 19)
context.config("population_path", "rp_2021/base-ic-evol-struct-pop-2021_xlsx.zip")
context.config("population_xlsx", "base-ic-evol-struct-pop-2021.xlsx")
context.config("population_year", 21)

def execute(context):
year = str(context.config("population_year"))
Expand Down
70 changes: 35 additions & 35 deletions docs/population.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,31 @@ to start with an empty folder, e.g. `/data`. All data sets need to be named
in a specific way and put into specific sub-directories. The following paragraphs
describe this process.

### 1) Census data (RP 2019)
### 1) Census data (RP 2021)

Census data containing the socio-demographic information of people living in
France is available from INSEE:

- [Census data](https://www.insee.fr/fr/statistiques/6544333)
- [Census data](https://www.insee.fr/fr/statistiques/8268848)
- Download the data set in **csv** format by clicking the link under *Individus localisés au canton-ou-ville*.
- Copy the *zip* file into the folder `data/rp_2019`
- Copy the *zip* file into the folder `data/rp_2021`

### 2) Population totals (RP 2019)
### 2) Population totals (RP 2021)

We also make use of more aggregated population totals available from INSEE:

- [Population data](https://www.insee.fr/fr/statistiques/6543200)
- [Population data](https://www.insee.fr/fr/statistiques/8268806)
- Download the data for *France hors Mayotte* in **xlsx** format.
- Copy the *zip* file into the folder `data/rp_2019`.
- Copy the *zip* file into the folder `data/rp_2021`.

### 3) Origin-destination data (RP-MOBPRO / RP-MOBSCO 2019)
### 3) Origin-destination data (RP-MOBPRO / RP-MOBSCO 2021)

Origin-destination data is available from INSEE (at two locations):

- [Work origin-destination data](https://www.insee.fr/fr/statistiques/6456056)
- [Education origin-destination data](https://www.insee.fr/fr/statistiques/6456052)
- [Work origin-destination data](https://www.insee.fr/fr/statistiques/8205896)
- [Education origin-destination data](https://www.insee.fr/fr/statistiques/8205892)
- Download the data from the links, both in **csv** format.
- Copy both *zip* files into the folder `data/rp_2019`.
- Copy both *zip* files into the folder `data/rp_2021`.

### 4) Income tax data (Filosofi 2019)

Expand All @@ -57,14 +57,14 @@ The tax data set is available from INSEE:
- Download the administrative level data (second link): *Base niveau administratif en 2019* in **xlsx** format
- Copy the second *zip* file into `data/filosofi_2019`

### 5) Service and facility census (BPE 2021)
### 5) Service and facility census (BPE 2023)

The census of services and facilities in France is available from INSEE:

- [Service and facility census](https://www.insee.fr/fr/statistiques/3568638)
- [Service and facility census](https://www.insee.fr/fr/statistiques/8217525)
- Download the uppermost data set in **csv** format. It contains all available
services while the lower data sets only contain observations for specific sectors.
- Copy the *zip* file into the folder `data/bpe_2021`.
- Copy the *zip* file into the folder `data/bpe_2023`.

### 6a) National household travel survey (ENTD 2008)

Expand All @@ -91,23 +91,23 @@ guarantee that you have exactly the correct format), you should make sure that
the following files are accessible in the folder `data/egt_2010`:
`Menages_semaine.csv`, `Personnes_semaine.csv`, `Deplacements_semaine.csv`.

### 7) IRIS zoning system (2021)
### 7) IRIS zoning system (2023)

The IRIS zoning system is available from IGN:

- [IRIS data](https://geoservices.ign.fr/contoursiris)
- Download the **2021** edition.
- Copy the *7z* file into the folder `data/iris_2021`
- Download the **2023** edition.
- Copy the *7z* file into the folder `data/iris_2023`


### 8) Zoning registry (2021)
### 8) Zoning registry (2023)

We make use of a zoning registry by INSEE that establishes a connection between
the identifiers of IRIS, municipalities, departments and regions:

- [Zoning data](https://www.insee.fr/fr/information/7708995)
- Download the **2021** edition as a *zip* file.
- Copy the *zip* file into `data/codes_2021`.
- Download the **2023** edition as a *zip* file.
- Copy the *zip* file into `data/codes_2023`.

### 9) Enterprise census (SIRENE)

Expand All @@ -134,7 +134,7 @@ The geolocated enterprise census is available on data.gouv.fr:
The French Buildings database is available from IGN:

- [Buildings database](https://geoservices.ign.fr/bdtopo)
- In the sidebar on the right, under *Téléchargement anciennes éditions*, click on *BD TOPO® 2022 GeoPackage Départements* to go to the saved data publications from 2022.
- In the sidebar on the right, under *Téléchargement anciennes éditions*, click on *BD TOPO® 2024 GeoPackage Départements* to go to the saved data publications from 2024.
- The data is split by department and they are identified with a number. For the Île-de-France region, download:
- Paris (75)
- Seine-et-Marne (77)
Expand All @@ -159,32 +159,32 @@ The French adresses database is available on data.gouv.fr :

Your folder structure should now have at least the following files:

- `data/rp_2019/RP2019_INDCVI_csv.zip`
- `data/rp_2019/RP2019_MOBPRO_csv.zip`
- `data/rp_2019/RP2019_MOBSCO_csv.zip`
- `data/rp_2019/base-ic-evol-struct-pop-2019.zip`
- `data/rp_2021/RP2021_indcvi.zip`
- `data/rp_2021/RP2021_mobpro.zip`
- `data/rp_2021/RP2021_mobsco.zip`
- `data/rp_2021/base-ic-evol-struct-pop-2021_xlsx.zip`
- `data/filosofi_2019/indic-struct-distrib-revenu-2019-COMMUNES.zip`
- `data/filosofi_2019/indic-struct-distrib-revenu-2019-SUPRA.zip`
- `data/bpe_2021/bpe21_ensemble_xy_csv.zip`
- `data/bpe_2023/BPE23.zip`
- `data/entd_2008/Q_individu.csv`
- `data/entd_2008/Q_tcm_individu.csv`
- `data/entd_2008/Q_menage.csv`
- `data/entd_2008/Q_tcm_menage_0.csv`
- `data/entd_2008/K_deploc.csv`
- `data/entd_2008/Q_ind_lieu_teg.csv`
- `data/iris_2021/CONTOURS-IRIS_2-1__SHP__FRA_2021-01-01.7z`
- `data/codes_2021/reference_IRIS_geo2021.zip`
- `data/iris_2023/CONTOURS-IRIS_3-0__SHP__FRA_2023-01-01.7z`
- `data/codes_2023/reference_IRIS_geo2023.zip`
- `data/sirene/StockEtablissement_utf8.csv`
- `data/sirene/StockUniteLegale_utf8.zip`
- `data/sirene/GeolocalisationEtablissement_Sirene_pour_etudes_statistiques_utf8.zip`
- `data/bdtopo_idf/BDTOPO_3-0_TOUSTHEMES_GPKG_LAMB93_D075_2022-03-15.7z`
- `data/bdtopo_idf/BDTOPO_3-0_TOUSTHEMES_GPKG_LAMB93_D077_2022-03-15.7z`
- `data/bdtopo_idf/BDTOPO_3-0_TOUSTHEMES_GPKG_LAMB93_D078_2022-03-15.7z`
- `data/bdtopo_idf/BDTOPO_3-0_TOUSTHEMES_GPKG_LAMB93_D091_2022-03-15.7z`
- `data/bdtopo_idf/BDTOPO_3-0_TOUSTHEMES_GPKG_LAMB93_D092_2022-03-15.7z`
- `data/bdtopo_idf/BDTOPO_3-0_TOUSTHEMES_GPKG_LAMB93_D093_2022-03-15.7z`
- `data/bdtopo_idf/BDTOPO_3-0_TOUSTHEMES_GPKG_LAMB93_D094_2022-03-15.7z`
- `data/bdtopo_idf/BDTOPO_3-0_TOUSTHEMES_GPKG_LAMB93_D095_2022-03-15.7z`
- `data/bdtopo_idf/BDTOPO_3-0_TOUSTHEMES_GPKG_LAMB93_D075_2024-03-15.7z`
- `data/bdtopo_idf/BDTOPO_3-0_TOUSTHEMES_GPKG_LAMB93_D077_2024-03-15.7z`
- `data/bdtopo_idf/BDTOPO_3-0_TOUSTHEMES_GPKG_LAMB93_D078_2024-03-15.7z`
- `data/bdtopo_idf/BDTOPO_3-0_TOUSTHEMES_GPKG_LAMB93_D091_2024-03-15.7z`
- `data/bdtopo_idf/BDTOPO_3-0_TOUSTHEMES_GPKG_LAMB93_D092_2024-03-15.7z`
- `data/bdtopo_idf/BDTOPO_3-0_TOUSTHEMES_GPKG_LAMB93_D093_2024-03-15.7z`
- `data/bdtopo_idf/BDTOPO_3-0_TOUSTHEMES_GPKG_LAMB93_D094_2024-03-15.7z`
- `data/bdtopo_idf/BDTOPO_3-0_TOUSTHEMES_GPKG_LAMB93_D095_2024-03-15.7z`
- `data/ban_idf/adresses-75.csv.gz`
- `data/ban_idf/adresses-77.csv.gz`
- `data/ban_idf/adresses-78.csv.gz`
Expand Down
36 changes: 18 additions & 18 deletions docs/verify_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@

tests = [
{
"name": "Census 2019",
"name": "Census 2021",
"urls": [
"https://www.insee.fr/fr/statistiques/6544333",
"https://www.insee.fr/fr/statistiques/fichier/6544333/RP2019_INDCVIZA_csv.zip",
"https://www.insee.fr/fr/statistiques/fichier/6544333/RP2019_INDCVIZD_csv.zip",
"https://www.insee.fr/fr/statistiques/fichier/6544333/RP2019_INDCVIZE_csv.zip"
"https://www.insee.fr/fr/statistiques/8268848",
"https://www.insee.fr/fr/statistiques/fichier/8268848/RP2021_indcviza.zip",
"https://www.insee.fr/fr/statistiques/fichier/8268848/RP2021_indcvizd.zip",
"https://www.insee.fr/fr/statistiques/fichier/8268848/RP2021_indcvize.zip"
]
},
{
"name": "OD Matrices 2019",
"urls": [
"https://www.insee.fr/fr/statistiques/6456056",
"https://www.insee.fr/fr/statistiques/6456052",
"https://www.insee.fr/fr/statistiques/fichier/6456056/RP2019_mobpro_csv.zip",
"https://www.insee.fr/fr/statistiques/fichier/6456052/RP2019_mobsco_csv.zip"
"https://www.insee.fr/fr/statistiques/8205896",
"https://www.insee.fr/fr/statistiques/8205892",
"https://www.insee.fr/fr/statistiques/fichier/8205896/RP2021_mobpro.zip",
"https://www.insee.fr/fr/statistiques/fichier/8205892/RP2021_mobsco.zip"
]
},
{
"name": "Population totals 2019",
"urls": [
"https://www.insee.fr/fr/statistiques/6543200",
"https://www.insee.fr/fr/statistiques/fichier/6543200/base-ic-evol-struct-pop-2019_csv.zip"
"https://www.insee.fr/fr/statistiques/8268806",
"https://www.insee.fr/fr/statistiques/fichier/8268806/base-ic-evol-struct-pop-2021_csv.zip"
]
},
{
Expand All @@ -40,10 +40,10 @@
]
},
{
"name": "BPE 2021",
"name": "BPE 2023",
"urls": [
"https://www.insee.fr/fr/statistiques/3568638",
"https://www.insee.fr/fr/statistiques/fichier/3568638/bpe21_ensemble_xy_csv.zip"
"https://www.insee.fr/fr/statistiques/8217525",
"https://www.insee.fr/fr/statistiques/fichier/8217525/BPE23.zip"
]
},
{
Expand All @@ -59,17 +59,17 @@
]
},
{
"name": "IRIS 2021",
"name": "IRIS 2023",
"urls": [
"https://geoservices.ign.fr/contoursiris",
"https://wxs.ign.fr/1yhlj2ehpqf3q6dt6a2y7b64/telechargement/inspire/CONTOURS-IRIS-PACK_2021-01$CONTOURS-IRIS_2-1__SHP__FRA_2021-01-01/file/CONTOURS-IRIS_2-1__SHP__FRA_2021-01-01.7z"
"https://data.geopf.fr/telechargement/download/CONTOURS-IRIS/CONTOURS-IRIS_3-0__SHP__FRA_2023-01-01/CONTOURS-IRIS_3-0__SHP__FRA_2023-01-01.7z"
]
},
{
"name": "Zoning 2021",
"name": "Zoning 2023",
"urls": [
"https://www.insee.fr/fr/information/2017499",
"https://www.insee.fr/fr/statistiques/fichier/2017499/reference_IRIS_geo2021.zip"
"https://www.insee.fr/fr/statistiques/fichier/7708995/reference_IRIS_geo2023.zip"
]
},
{
Expand Down
7 changes: 3 additions & 4 deletions synthesis/locations/education.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ def configure(context):
context.stage("data.bpe.cleaned", alias = "location_source")

EDUCATION_WEIGHT_MAP = [
("C101", 100), # Preschools
("C102", 50), # Intercommunal preschools
("C104", 145), # Elemantary schools
("C105", 80), # Intercommunal elemantary schools
("C107", 100), # Preschools
("C108", 115), # Primary schools
("C109", 145), # Elemantary schools
("C301", 700), # General and technological high schools, multi-purpose high schools
("C302", 285), # Professional high schools
("C303", 100), # Agricultural high schools
Expand Down
Loading

0 comments on commit 4253bcb

Please sign in to comment.