Skip to content

Commit

Permalink
Merge branch 'master' into json-number-format
Browse files Browse the repository at this point in the history
  • Loading branch information
paulboosz committed Dec 19, 2024
2 parents cb60990 + cd4fb2f commit df70ee2
Show file tree
Hide file tree
Showing 46 changed files with 12,296 additions and 12,344 deletions.
9 changes: 6 additions & 3 deletions data/common/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,12 @@ def cached_search(dbname, search_terms, excluded_term=None):


def find_id(dbname, activity):
return cached_search(dbname, activity["search"]).get(
"Process identifier", activity["id"]
)
if (search_terms := activity.get("search")) is not None:
search_result = cached_search(dbname, search_terms)
if search_result is not None:
return search_result.get("Process identifier", activity["id"])

return None


def compute_simapro_impacts(activity, method, impacts_py):
Expand Down
2 changes: 1 addition & 1 deletion data/food/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def to_process(activity):
"elec_MJ": 0,
"heat_MJ": 0,
"id": activity["id"],
"identifier": find_id(activity.get("database", DEFAULT_DB), activity),
"sourceId": find_id(activity.get("database", DEFAULT_DB), activity),
"impacts": {},
"name": cached_search(activity.get("database", DEFAULT_DB), activity["search"])[
"name"
Expand Down
12 changes: 8 additions & 4 deletions data/object/activities.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
[
{
"alias": null,
"id": "07e9e916-e02b-45e2-a298-2b5084de6242",
"name": "sawnwood, board, hardwood, dried (u=10%), planed//[Europe without Switzerland] market for sawnwood, board, hardwood, dried (u=10%), planed",
"categories": [],
"displayName": "Planche (bois de feuillus)",
"density": 600,
"elec_MJ": 0,
"heat_MJ": 0,
"waste": 0,
"unit": "m3",
"source": "Ecoinvent 3.9.1",
"comment": "",
"alias": null
"sourceId": null,
"comment": ""
},
{
"alias": null,
"id": "3295b2a5-328a-4c00-b046-e2ddeb0da823",
"name": "polypropylene product/RER constructed by Ecobalyse",
"categories": [],
"displayName": "Composant en plastique (PP)",
"density": 900,
"elec_MJ": 0,
"heat_MJ": 0,
"waste": 0,
"unit": "kg",
"source": "Ecobalyse",
"comment": "modélisation d'un composant générique (voir documentation)",
"alias": null
"sourceId": null,
"comment": "modélisation d'un composant générique (voir documentation)"
}
]
Loading

0 comments on commit df70ee2

Please sign in to comment.