mobisurvstd 0.8.0__tar.gz → 0.8.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mobisurvstd-0.8.0/src/mobisurvstd.egg-info → mobisurvstd-0.8.2}/PKG-INFO +1 -1
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/pyproject.toml +1 -1
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/egt2010/personnes.py +7 -2
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/egt2020/personnes.py +8 -2
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/emp/personnes.py +8 -2
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/validation.py +0 -2
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2/src/mobisurvstd.egg-info}/PKG-INFO +1 -1
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/LICENSE.md +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/README.md +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/setup.cfg +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/__init__.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/__main__.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/cerema/__init__.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/cerema/common.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/cerema/deplacements.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/cerema/edgt.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/cerema/edvm.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/cerema/emc2.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/cerema/emd.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/cerema/menages.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/cerema/personnes.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/cerema/survey.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/cerema/trajets.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/cerema/zones.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/classes.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/cli.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/common/__init__.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/common/cars.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/common/clean.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/common/households.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/common/legs.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/common/motorcycles.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/common/persons.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/common/trips.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/common/zones.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/egt2010/__init__.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/egt2010/deplacements.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/egt2010/menages.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/egt2010/survey.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/egt2010/trajets.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/egt2010/zones.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/egt2020/__init__.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/egt2020/deplacements.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/egt2020/menages.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/egt2020/motos.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/egt2020/survey.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/egt2020/trajets.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/egt2020/voitures.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/emp/__init__.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/emp/deplacements.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/emp/menages.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/emp/motos.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/emp/survey.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/emp/voitures.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/logger.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/main.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/resources/__init__.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/resources/admin_express.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/resources/insee_data.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/resources/nuts.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/schema/__init__.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/schema/cars.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/schema/common.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/schema/guarantees.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/schema/households.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/schema/legs.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/schema/motorcycles.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/schema/persons.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/schema/trips.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd/utils.py +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd.egg-info/SOURCES.txt +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd.egg-info/dependency_links.txt +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd.egg-info/requires.txt +0 -0
- {mobisurvstd-0.8.0 → mobisurvstd-0.8.2}/src/mobisurvstd.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mobisurvstd
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.2
|
|
4
4
|
Summary: A tool to standardize French mobility survey datasets (EMC2, EGT, EMP, etc.) into a unified format.
|
|
5
5
|
Author-email: Lucas Javaudin <lucas@lucasjavaudin.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "mobisurvstd"
|
|
9
|
-
version = "0.8.
|
|
9
|
+
version = "0.8.2"
|
|
10
10
|
description = "A tool to standardize French mobility survey datasets (EMC2, EGT, EMP, etc.) into a unified format."
|
|
11
11
|
readme = "README.md"
|
|
12
12
|
authors = [{ name = "Lucas Javaudin", email = "lucas@lucasjavaudin.com" }]
|
|
@@ -255,8 +255,13 @@ def standardize_persons(
|
|
|
255
255
|
study_bicycle_parking=pl.when(is_student).then(
|
|
256
256
|
pl.col("PKVLTRAV").replace_strict(BICYCLE_PARKING_MAP)
|
|
257
257
|
),
|
|
258
|
-
|
|
259
|
-
|
|
258
|
+
# PERMVP value is NULL for all persons below 15.
|
|
259
|
+
has_driving_license=pl.when(pl.col("age") <= 15)
|
|
260
|
+
.then(pl.lit("no"))
|
|
261
|
+
.otherwise(pl.col("PERMVP").replace_strict(DRIVING_LICENSE_MAP)),
|
|
262
|
+
has_motorcycle_driving_license=pl.when(pl.col("age") <= 15)
|
|
263
|
+
.then(pl.lit("no"))
|
|
264
|
+
.otherwise(pl.col("PERM2RM").replace_strict(DRIVING_LICENSE_MAP)),
|
|
260
265
|
public_transit_subscription=pl.when(pl.col("ABONTC").ne(1))
|
|
261
266
|
.then(
|
|
262
267
|
pl.when(pl.col("REMBTC").eq(1))
|
|
@@ -310,8 +310,14 @@ def standardize_persons(filename: str, households: pl.LazyFrame):
|
|
|
310
310
|
study_only_at_home=pl.col("LIEU_ETUD").eq(2),
|
|
311
311
|
study_car_parking=pl.col("PKVPETUD").replace_strict(CAR_PARKING_MAP),
|
|
312
312
|
study_bicycle_parking=pl.col("PKVLETUD").replace_strict(BICYCLE_PARKING_MAP),
|
|
313
|
-
|
|
314
|
-
|
|
313
|
+
# PERMVP value is NULL for all persons below 14.
|
|
314
|
+
has_driving_license=pl.when(pl.col("age") <= 14)
|
|
315
|
+
.then(pl.lit("no"))
|
|
316
|
+
.otherwise(pl.col("PERMVP").replace_strict(DRIVING_LICENSE_MAP)),
|
|
317
|
+
# PERM2RM value is NULL for all persons below 14.
|
|
318
|
+
has_motorcycle_driving_license=pl.when(pl.col("age") <= 14)
|
|
319
|
+
.then(pl.lit("no"))
|
|
320
|
+
.otherwise(pl.col("PERM2RM").replace_strict(DRIVING_LICENSE_MAP)),
|
|
315
321
|
has_public_transit_subscription=pl.col("ABONTC").eq(1),
|
|
316
322
|
public_transit_subscription=pl.when(
|
|
317
323
|
# Forfait Navigo Gratuité, Améthyste et Gratuité Jeunes en insertion
|
|
@@ -523,13 +523,18 @@ def standardize_persons(filename1: str, filename2: str, filename3: str, househol
|
|
|
523
523
|
pcs_category_code2003=pl.when(pl.col("CS24") > 0).then("CS24"),
|
|
524
524
|
workplace_singularity=pl.col("BTRAVFIX").replace_strict(WORKPLACE_SINGULARITY_MAP),
|
|
525
525
|
telework=pl.col("BTRAVTEL").replace_strict(TELEWORK_MAP),
|
|
526
|
-
|
|
526
|
+
# BPERMIS is null for all persons below 17.
|
|
527
|
+
has_driving_license=pl.when(pl.col("age") <= 17)
|
|
528
|
+
.then(pl.lit("no"))
|
|
529
|
+
.otherwise(pl.col("BPERMIS").replace_strict(DRIVING_LICENSE_MAP)),
|
|
530
|
+
# We assume that if no PT subscription was declared, then the person has no PT subscription
|
|
531
|
+
# (i.e., there is no NULL value).
|
|
527
532
|
has_public_transit_subscription=pl.any_horizontal(
|
|
528
533
|
pl.col(f"BTYP{i}RES_{a}").eq(1)
|
|
529
534
|
& pl.col(f"BTYP{i}CART").is_in(("1.1", "2.1", "2.2", "2.5"))
|
|
530
535
|
for i in range(1, 5)
|
|
531
536
|
for a in ("A", "D", "E")
|
|
532
|
-
),
|
|
537
|
+
).fill_null(False),
|
|
533
538
|
has_car_sharing_subscription=pl.col("BABONNAUTOP") == 1,
|
|
534
539
|
car_sharing_subscription=(
|
|
535
540
|
10 * pl.col("BABONNAUTOP") + pl.col("BAUTOPTYP").fill_null(0)
|
|
@@ -539,6 +544,7 @@ def standardize_persons(filename1: str, filename2: str, filename3: str, househol
|
|
|
539
544
|
is_surveyed=pl.col("NOIK").is_not_null(),
|
|
540
545
|
trips_weekday=pl.col("MDATE_jour").replace_strict(WEEKDAY_MAP),
|
|
541
546
|
)
|
|
547
|
+
breakpoint()
|
|
542
548
|
lf = lf.with_columns(
|
|
543
549
|
# Many persons have ETUDIE = 1 (they study) but SITUA is null.
|
|
544
550
|
# We can assign them "student:unspecified" as detailed_professional_occupation.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mobisurvstd
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.2
|
|
4
4
|
Summary: A tool to standardize French mobility survey datasets (EMC2, EGT, EMP, etc.) into a unified format.
|
|
5
5
|
Author-email: Lucas Javaudin <lucas@lucasjavaudin.com>
|
|
6
6
|
License-Expression: MIT
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|