Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions activities.json
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@
"textile": [
{
"alias": "elasthane",
"defaultCountry": "CN",
"defaultGeozone": "CN",
"displayName": "Elasthane (Lycra)",
"geographicOrigin": "Asie - Pacifique",
"id": "9973088b-c929-4cc5-894a-1e4d28c161d4",
Expand Down Expand Up @@ -495,7 +495,7 @@
"textile": [
{
"alias": "ei-acrylique",
"defaultCountry": "CN",
"defaultGeozone": "CN",
"displayName": "Production de plexiglas (Polyméthacrylate de méthyle)",
"geographicOrigin": "Asie - Pacifique",
"id": "49a0bec0-f9f3-42db-a514-a9dcf06a8969",
Expand Down Expand Up @@ -529,7 +529,7 @@
"textile": [
{
"alias": "ei-jute-kenaf",
"defaultCountry": "CN",
"defaultGeozone": "CN",
"displayName": "Production de jute, rouissage",
"geographicOrigin": "Asie - Pacifique",
"id": "a09b2677-2900-4417-a202-e5f9a1abcce1",
Expand Down Expand Up @@ -563,7 +563,7 @@
"textile": [
{
"alias": "ei-pp",
"defaultCountry": "FR",
"defaultGeozone": "FR",
"displayName": "Production de polypropylène, granulés",
"geographicOrigin": "Europe",
"id": "73ef624d-250e-4a9a-af5d-43505b21b527",
Expand Down Expand Up @@ -598,7 +598,7 @@
"textile": [
{
"alias": "ei-pet",
"defaultCountry": "CN",
"defaultGeozone": "CN",
"displayName": "Production de PET, granulés, amorphe",
"geographicOrigin": "Asie - Pacifique",
"id": "9dba0e95-0c35-4f8b-9267-62ddf47d4984",
Expand Down Expand Up @@ -637,7 +637,7 @@
"manufacturerAllocation": 0.5,
"recycledQualityRatio": 1
},
"defaultCountry": "CN",
"defaultGeozone": "CN",
"displayName": "Production de PET recyclé, granulés, amorphe",
"geographicOrigin": "Asie - Pacifique",
"id": "8f44c680-1263-4588-b79b-a9e4dc3d8de4",
Expand Down Expand Up @@ -672,7 +672,7 @@
"textile": [
{
"alias": "ei-pa",
"defaultCountry": "FR",
"defaultGeozone": "FR",
"displayName": "Production de nylon 6-6",
"geographicOrigin": "Europe",
"id": "c84280ff-e921-4d5c-92d6-51030bf4f74e",
Expand Down Expand Up @@ -706,7 +706,7 @@
"textile": [
{
"alias": "ei-lin",
"defaultCountry": "FR",
"defaultGeozone": "FR",
"displayName": "Production de fibres de lin, rouissage",
"geographicOrigin": "Europe",
"id": "a52e486c-b67e-40af-8337-e8143cbf9076",
Expand Down Expand Up @@ -740,7 +740,7 @@
"textile": [
{
"alias": "ei-laine-par-defaut",
"defaultCountry": "CN",
"defaultGeozone": "CN",
"displayName": "Laine par défaut",
"geographicOrigin": "Asie - Pacifique",
"id": "1fc3e17d-5661-429d-a150-7986eae16d9d",
Expand Down Expand Up @@ -794,7 +794,7 @@
"textile": [
{
"alias": "ei-laine-nouvelle-filiere",
"defaultCountry": "CN",
"defaultGeozone": "CN",
"displayName": "Laine nouvelle filière",
"geographicOrigin": "Asie - Pacifique",
"id": "72e29a61-52a9-4eb5-b3fc-5fb87edea041",
Expand Down Expand Up @@ -829,7 +829,7 @@
"textile": [
{
"alias": "ei-coton",
"defaultCountry": "CN",
"defaultGeozone": "CN",
"displayName": "Production de fibres de coton",
"geographicOrigin": "Asie - Pacifique",
"id": "62a4d6fb-3276-4ba5-93a3-889ecd3bff84",
Expand Down Expand Up @@ -865,7 +865,7 @@
"textile": [
{
"alias": "ei-coton-organic",
"defaultCountry": "CN",
"defaultGeozone": "CN",
"displayName": "Production de fibres de coton bio",
"geographicOrigin": "Asie - Pacifique",
"id": "a1c1c2ec-33b1-49d6-bf8e-139e2eb7f097",
Expand Down Expand Up @@ -900,7 +900,7 @@
"textile": [
{
"alias": "ei-chanvre",
"defaultCountry": "CN",
"defaultGeozone": "CN",
"displayName": "Production de chanvre",
"geographicOrigin": "Asie - Pacifique",
"id": "0c1a4654-b030-4fe1-86b7-d96ce0b85bb8",
Expand Down Expand Up @@ -934,7 +934,7 @@
"textile": [
{
"alias": "ei-viscose",
"defaultCountry": "CN",
"defaultGeozone": "CN",
"displayName": "Fibre de viscose",
"geographicOrigin": "Asie - Pacifique",
"id": "c087d394-5901-4b03-ba7a-7d4b0db0490c",
Expand Down Expand Up @@ -993,7 +993,7 @@
"manufacturerAllocation": 0.8,
"recycledQualityRatio": 0.5
},
"defaultCountry": "FR",
"defaultGeozone": "FR",
"displayName": "Production de coton recyclé (déchets post-consommation)",
"geographicOrigin": "France",
"id": "457e9b0d-9eda-4dca-b199-deeb0a154fa9",
Expand Down Expand Up @@ -1053,7 +1053,7 @@
"manufacturerAllocation": 0.8,
"recycledQualityRatio": 0.5
},
"defaultCountry": "FR",
"defaultGeozone": "FR",
"displayName": "Production de coton recyclé (déchets de production)",
"geographicOrigin": "Espagne & France",
"id": "d3d20384-88fb-4c75-ac12-c647365ac6c5",
Expand Down
6 changes: 4 additions & 2 deletions common/distances/transports.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import json
from pathlib import Path

from common.distances.CountryDistances import CountryDistances
from common.export import load_json
from config import settings

INPUT_DISTANCES = "distances_raw.json"
COUNTRIES_OFFICIAL = "../../../public/data/countries.json"
OUTPUT = "../../../public/data/transports.json"
COUNTRIES_OFFICIAL = Path(settings.OUTPUT_DIR) / "geozones.json"
OUTPUT = Path(settings.OUTPUT_DIR) / "transports.json"

# dictionary of regions to add with the corresponding country
regions = {
Expand Down
2 changes: 1 addition & 1 deletion ecobalyse_data/export/textile.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def activity_to_materials(eco_activity: dict) -> List[Material]:
name=textile_metadata["name"],
primary=textile_metadata.get("primary"),
geographic_origin=textile_metadata["geographicOrigin"],
default_country=textile_metadata["defaultCountry"],
default_geozone=textile_metadata["defaultGeozone"],
cff=cff,
)
)
Expand Down
2 changes: 1 addition & 1 deletion models/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class Material(EcoModel):
origin: str
primary: Optional[bool]
geographic_origin: str
default_country: str
default_geozone: str
cff: Optional[Cff]
process_id: uuid.UUID

Expand Down
32 changes: 16 additions & 16 deletions public/data/textile/materials.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"alias": "ei-chanvre",
"cff": null,
"defaultCountry": "CN",
"defaultGeozone": "CN",
"geographicOrigin": "Asie - Pacifique",
"id": "0c1a4654-b030-4fe1-86b7-d96ce0b85bb8",
"name": "Chanvre",
Expand All @@ -14,7 +14,7 @@
{
"alias": "ei-laine-par-defaut",
"cff": null,
"defaultCountry": "CN",
"defaultGeozone": "CN",
"geographicOrigin": "Asie - Pacifique",
"id": "1fc3e17d-5661-429d-a150-7986eae16d9d",
"name": "Laine par défaut",
Expand All @@ -29,7 +29,7 @@
"manufacturerAllocation": 0.8,
"recycledQualityRatio": 0.5
},
"defaultCountry": "FR",
"defaultGeozone": "FR",
"geographicOrigin": "France",
"id": "457e9b0d-9eda-4dca-b199-deeb0a154fa9",
"name": "Coton recyclé (déchets post-consommation)",
Expand All @@ -41,7 +41,7 @@
{
"alias": "ei-acrylique",
"cff": null,
"defaultCountry": "CN",
"defaultGeozone": "CN",
"geographicOrigin": "Asie - Pacifique",
"id": "49a0bec0-f9f3-42db-a514-a9dcf06a8969",
"name": "Acrylique",
Expand All @@ -53,7 +53,7 @@
{
"alias": "ei-coton",
"cff": null,
"defaultCountry": "CN",
"defaultGeozone": "CN",
"geographicOrigin": "Asie - Pacifique",
"id": "62a4d6fb-3276-4ba5-93a3-889ecd3bff84",
"name": "Coton",
Expand All @@ -65,7 +65,7 @@
{
"alias": "ei-laine-nouvelle-filiere",
"cff": null,
"defaultCountry": "CN",
"defaultGeozone": "CN",
"geographicOrigin": "Asie - Pacifique",
"id": "72e29a61-52a9-4eb5-b3fc-5fb87edea041",
"name": "Laine nouvelle filière",
Expand All @@ -77,7 +77,7 @@
{
"alias": "ei-pp",
"cff": null,
"defaultCountry": "FR",
"defaultGeozone": "FR",
"geographicOrigin": "Europe",
"id": "73ef624d-250e-4a9a-af5d-43505b21b527",
"name": "Polypropylène",
Expand All @@ -92,7 +92,7 @@
"manufacturerAllocation": 0.5,
"recycledQualityRatio": 1.0
},
"defaultCountry": "CN",
"defaultGeozone": "CN",
"geographicOrigin": "Asie - Pacifique",
"id": "8f44c680-1263-4588-b79b-a9e4dc3d8de4",
"name": "Polyester recyclé",
Expand All @@ -104,7 +104,7 @@
{
"alias": "elasthane",
"cff": null,
"defaultCountry": "CN",
"defaultGeozone": "CN",
"geographicOrigin": "Asie - Pacifique",
"id": "9973088b-c929-4cc5-894a-1e4d28c161d4",
"name": "Elasthane (Lycra)",
Expand All @@ -116,7 +116,7 @@
{
"alias": "ei-pet",
"cff": null,
"defaultCountry": "CN",
"defaultGeozone": "CN",
"geographicOrigin": "Asie - Pacifique",
"id": "9dba0e95-0c35-4f8b-9267-62ddf47d4984",
"name": "Polyester",
Expand All @@ -128,7 +128,7 @@
{
"alias": "ei-jute-kenaf",
"cff": null,
"defaultCountry": "CN",
"defaultGeozone": "CN",
"geographicOrigin": "Asie - Pacifique",
"id": "a09b2677-2900-4417-a202-e5f9a1abcce1",
"name": "Jute",
Expand All @@ -140,7 +140,7 @@
{
"alias": "ei-coton-organic",
"cff": null,
"defaultCountry": "CN",
"defaultGeozone": "CN",
"geographicOrigin": "Asie - Pacifique",
"id": "a1c1c2ec-33b1-49d6-bf8e-139e2eb7f097",
"name": "Coton biologique",
Expand All @@ -152,7 +152,7 @@
{
"alias": "ei-lin",
"cff": null,
"defaultCountry": "FR",
"defaultGeozone": "FR",
"geographicOrigin": "Europe",
"id": "a52e486c-b67e-40af-8337-e8143cbf9076",
"name": "Lin",
Expand All @@ -164,7 +164,7 @@
{
"alias": "ei-viscose",
"cff": null,
"defaultCountry": "CN",
"defaultGeozone": "CN",
"geographicOrigin": "Asie - Pacifique",
"id": "c087d394-5901-4b03-ba7a-7d4b0db0490c",
"name": "Viscose",
Expand All @@ -176,7 +176,7 @@
{
"alias": "ei-pa",
"cff": null,
"defaultCountry": "FR",
"defaultGeozone": "FR",
"geographicOrigin": "Europe",
"id": "c84280ff-e921-4d5c-92d6-51030bf4f74e",
"name": "Nylon",
Expand All @@ -191,7 +191,7 @@
"manufacturerAllocation": 0.8,
"recycledQualityRatio": 0.5
},
"defaultCountry": "FR",
"defaultGeozone": "FR",
"geographicOrigin": "Espagne & France",
"id": "d3d20384-88fb-4c75-ac12-c647365ac6c5",
"name": "Coton recyclé (déchets de production)",
Expand Down
8 changes: 4 additions & 4 deletions tests/fixtures/activities.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
"textile": [
{
"alias": "elasthane",
"defaultCountry": "CN",
"defaultGeozone": "CN",
"displayName": "Elasthane (Lycra)",
"geographicOrigin": "Asie - Pacifique",
"id": "9973088b-c929-4cc5-894a-1e4d28c161d4",
Expand Down Expand Up @@ -277,7 +277,7 @@
"manufacturerAllocation": 0.5,
"recycledQualityRatio": 1
},
"defaultCountry": "CN",
"defaultGeozone": "CN",
"displayName": "Production de PET recyclé, granulés, amorphe",
"geographicOrigin": "Asie - Pacifique",
"id": "8f44c680-1263-4588-b79b-a9e4dc3d8de4",
Expand Down Expand Up @@ -331,7 +331,7 @@
"textile": [
{
"alias": "ei-acrylique",
"defaultCountry": "CN",
"defaultGeozone": "CN",
"displayName": "Production de plexiglas (Polyméthacrylate de méthyle)",
"geographicOrigin": "Asie - Pacifique",
"id": "f6b6684b-c4ff-4df0-84a4-e09e59d32e5f",
Expand Down Expand Up @@ -360,7 +360,7 @@
"object": [
{
"alias": null,
"defaultCountry": "",
"defaultGeozone": "",
"displayName": "Example activity from existing",
"id": "0e9c64fe-8a5c-40ba-b60c-ff2b47b56627"
}
Expand Down
6 changes: 3 additions & 3 deletions tests/snapshots/textile/materials.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"manufacturerAllocation": 0.5,
"recycledQualityRatio": 1.0
},
"defaultCountry": "CN",
"defaultGeozone": "CN",
"geographicOrigin": "Asie - Pacifique",
"id": "8f44c680-1263-4588-b79b-a9e4dc3d8de4",
"name": "Polyester recyclé",
Expand All @@ -17,7 +17,7 @@
{
"alias": "elasthane",
"cff": null,
"defaultCountry": "CN",
"defaultGeozone": "CN",
"geographicOrigin": "Asie - Pacifique",
"id": "9973088b-c929-4cc5-894a-1e4d28c161d4",
"name": "Elasthane (Lycra)",
Expand All @@ -29,7 +29,7 @@
{
"alias": "ei-acrylique",
"cff": null,
"defaultCountry": "CN",
"defaultGeozone": "CN",
"geographicOrigin": "Asie - Pacifique",
"id": "f6b6684b-c4ff-4df0-84a4-e09e59d32e5f",
"name": "Acrylique",
Expand Down