Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(data): New ingredients #814

Merged
merged 105 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from 94 commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
d6c2ab6
Changed ingredients (contributed by Écobalyse)
Jul 18, 2024
9e47f8f
Changed ingredients (contributed by Écobalyse)
Jul 18, 2024
d533182
run format:json after copying the file
ccomb Jul 18, 2024
3fd30b3
Changed ingredients (contributed by Écobalyse)
Jul 18, 2024
713d063
reformat
ccomb Jul 23, 2024
d7ed9bf
Merge branch 'master' of github.com:MTES-MCT/ecobalyse into ingredients
ccomb Jul 29, 2024
c305e9a
Merge branch 'master' of github.com:MTES-MCT/ecobalyse into ingredients
ccomb Jul 29, 2024
7356c2e
changed the prettier version and call in the ingredient editor
ccomb Jul 31, 2024
27c463d
Changed ingredients (contributed by Écobalyse)
Jul 31, 2024
93f8263
Created a button to compute the surface, don't recompute it each time.
ccomb Aug 1, 2024
01578be
Merge branch 'ingredients' of github.com:MTES-MCT/ecobalyse into ingr…
ccomb Aug 1, 2024
5ecf1c1
use ccomb-5 which fix the comment separator for simapro csv import
ccomb Aug 2, 2024
0a9a1b8
Replace the newline with an HTML newline
ccomb Aug 2, 2024
e9836e0
new export
ccomb Aug 2, 2024
25fad0e
renamed variable and removed an old print
ccomb Aug 5, 2024
78814ee
unused variable
ccomb Aug 5, 2024
e10b699
display the ecoscore in the bw explorer
ccomb Aug 5, 2024
97c026b
Merge branch 'explorer_ecoscore' into ingredients
ccomb Aug 5, 2024
34be9a4
Renamed the Score column to Amount, added a Score column
ccomb Aug 5, 2024
16243fc
multiply by 1e6 to get uPts
ccomb Aug 5, 2024
b8ed517
Added Percent / PEF
ccomb Aug 5, 2024
6cbe998
changed display rounding of percent display
ccomb Aug 6, 2024
ed08964
Merge branch 'master' of github.com:MTES-MCT/ecobalyse into ingredients
ccomb Aug 6, 2024
8598d39
merge food and textile into the default project. Improved bw explorer to
ccomb Aug 9, 2024
fcb1e71
added a make delete_database and moved sync_datapackage
ccomb Aug 10, 2024
a194586
also remove negative ldu on greenhouse from urban on Ginko
ccomb Aug 10, 2024
ab9b311
Added migrations for Ginko, improved the bw explorer
ccomb Aug 12, 2024
0bf76fd
Split import and export in the Makefile
ccomb Aug 12, 2024
ee795da
fix search term
ccomb Aug 12, 2024
64b8fc5
corrected search term
ccomb Aug 12, 2024
8d46310
Merge branch 'master' of github.com:MTES-MCT/ecobalyse into ingredients
ccomb Aug 13, 2024
8318f17
Merge branch 'master' of github.com:MTES-MCT/ecobalyse into ingredients
ccomb Aug 13, 2024
6554209
removed test
ccomb Aug 13, 2024
f02cc19
- refactored the brightway explorer
ccomb Aug 13, 2024
1ddde9f
missing files
ccomb Aug 13, 2024
0bec711
doc
ccomb Aug 14, 2024
b325f5a
doc
ccomb Aug 14, 2024
5cb5996
this is not an Amount but really a Score
ccomb Aug 15, 2024
32f63eb
Better column order: the unit refers to the amount, not score.
ccomb Aug 15, 2024
4067169
corrected lines missing a million (but the total was ok)
ccomb Aug 16, 2024
16e3fbe
Better display of the production title.
ccomb Aug 16, 2024
bcc72c1
Merge branch 'master' of github.com:MTES-MCT/ecobalyse into ingredients
ccomb Aug 24, 2024
66f4de8
Merge branch 'master' of github.com:MTES-MCT/ecobalyse into ingredients
ccomb Aug 29, 2024
f561acd
new export
ccomb Aug 30, 2024
d80cd4b
Merge branch 'master' of github.com:MTES-MCT/ecobalyse into food_refa…
ccomb Aug 30, 2024
b57909b
Merge branch 'food_refactor' of github.com:MTES-MCT/ecobalyse into in…
ccomb Aug 30, 2024
01d0a54
adapt tests
ccomb Aug 30, 2024
7dd8b84
Merge branch 'master' of github.com:MTES-MCT/ecobalyse into ingredients
ccomb Sep 2, 2024
531fd8b
Merge branch 'master' of github.com:MTES-MCT/ecobalyse into ingredients
ccomb Sep 4, 2024
b55a94c
Merge branch 'master' of github.com:MTES-MCT/ecobalyse into ingredients
ccomb Sep 26, 2024
59af169
fix key error
ccomb Sep 26, 2024
3ae0942
Merge branch 'master' of github.com:MTES-MCT/ecobalyse into ingredients
ccomb Oct 1, 2024
1d22bcc
Changed ingredients (contributed by Écobalyse)
Oct 24, 2024
2e3abf2
Merge branch 'master' of github.com:MTES-MCT/ecobalyse into ingredients
ccomb Oct 28, 2024
8f361ec
new export
ccomb Oct 28, 2024
9df2884
adapted tests
ccomb Oct 28, 2024
c60a110
Changed ingredients (contributed by Écobalyse)
Oct 29, 2024
db6a8df
fixed right categories
ccomb Oct 29, 2024
ec0b3d4
adapted feeds to new ingredient names
ccomb Oct 29, 2024
2aaaad8
adapted the ingredients editor
ccomb Oct 29, 2024
ef1d29b
new export
ccomb Oct 29, 2024
4f30d93
Merge branch 'master' of github.com:MTES-MCT/ecobalyse into ingredients
ccomb Nov 3, 2024
ba7e9f3
Changed ingredients (contributed by Écobalyse)
Nov 4, 2024
b1f22bd
variable nams
ccomb Nov 5, 2024
d8c0a91
Show translated fields for SE, and add a None option
ccomb Nov 5, 2024
458ce02
Remove empty SE when saving
ccomb Nov 5, 2024
ed960f6
forgot a field name change
ccomb Nov 5, 2024
13cb3b6
Merge branch 'master' of github.com:MTES-MCT/ecobalyse into ingredients
ccomb Nov 5, 2024
dde925c
new export
ccomb Nov 5, 2024
9a7182d
same name in encoder and decoder
ccomb Nov 5, 2024
c49b1b9
new export for ingredients
ccomb Nov 6, 2024
4d69fe2
Merge branch 'master' of github.com:MTES-MCT/ecobalyse into ingredients
ccomb Nov 6, 2024
4be8806
new export
ccomb Nov 7, 2024
240757d
fixed examples
ccomb Nov 7, 2024
2609309
force the export to use a unique search result
ccomb Nov 7, 2024
094e48b
use the full name if the search returns more than one result. Adapt t…
ccomb Nov 7, 2024
4755c46
adapt textile activities as well
ccomb Nov 7, 2024
3f818f1
reformat
ccomb Nov 7, 2024
a00e973
new export
ccomb Nov 7, 2024
4a95300
fixed cull cow
ccomb Nov 7, 2024
0ae521c
Merge branch 'master' of github.com:MTES-MCT/ecobalyse into ingredients
ccomb Nov 7, 2024
451875b
adapt the ingredient editor to the new search behaviour : disable the
ccomb Nov 7, 2024
d367696
avoid duplication
ccomb Nov 12, 2024
008c968
variable naming
ccomb Nov 12, 2024
4262bf5
unuseful function
ccomb Nov 12, 2024
d323dee
looks like a merge error, the activities creation should not be in the
ccomb Nov 12, 2024
eded760
adapted to the new search behaviour
ccomb Nov 12, 2024
8a9b45d
new export
ccomb Nov 13, 2024
d8ec868
fixed wrong percentages
ccomb Nov 13, 2024
36a9cf5
new export
ccomb Nov 13, 2024
71b20d6
yet another wrong percentage
ccomb Nov 13, 2024
268637a
new export
ccomb Nov 13, 2024
3274dbf
format
ccomb Nov 13, 2024
c223f97
Merge branch 'master' of github.com:MTES-MCT/ecobalyse into ingredients
ccomb Nov 13, 2024
a19dfe8
Changed ingredients (contributed by Écobalyse)
Nov 18, 2024
5368882
new export
paulboosz Nov 18, 2024
c48ff7e
Merge branch 'master' of github.com:MTES-MCT/ecobalyse into ingredients
ccomb Nov 20, 2024
1bde94d
Merge branch 'ingredients' of github.com:MTES-MCT/ecobalyse into ingr…
ccomb Nov 20, 2024
5650085
Changed ingredients (contributed by Écobalyse)
Nov 20, 2024
8e7772e
Merge branch 'ingredients' of https://github.com/MTES-MCT/ecobalyse i…
Nov 20, 2024
93c0588
Changed ingredients (contributed by Écobalyse)
Nov 20, 2024
aaec9c6
new export
ccomb Nov 20, 2024
6bc9f5e
Merge branch 'ingredients' of github.com:MTES-MCT/ecobalyse into ingr…
ccomb Nov 20, 2024
a24fd41
Merge branch 'master' of github.com:MTES-MCT/ecobalyse into ingredients
ccomb Nov 20, 2024
761fc88
new export with packaging
ccomb Nov 20, 2024
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
19 changes: 14 additions & 5 deletions data/common/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,22 @@ def progress_bar(index, total):
print(f"Export in progress: {str(index)}/{total}", end="\r")


def search(dbname, name, excluded_term=None):
results = bw2data.Database(dbname).search(name)
def search(dbname, search_terms, excluded_term=None):
results = bw2data.Database(dbname).search(search_terms)
if excluded_term:
results = [res for res in results if excluded_term not in res["name"]]
if not results:
print(f"Not found in brightway : '{name}'")
print(f"Not found in brightway : '{search_terms}'")
return None
if len(results) > 1:
# if the search gives more than one results, find the one with exact name
exact_results = [a for a in results if a["name"] == search_terms]
if len(exact_results) == 1:
return exact_results[0]
else:
raise ValueError(
f"This 'search' field returns more than one result in database {dbname}: {search_terms}"
)
return results[0]


Expand Down Expand Up @@ -374,8 +383,8 @@ def load_json(filename):


@functools.cache
def cached_search(dbname, name, excluded_term=None):
return search(dbname, name, excluded_term)
def cached_search(dbname, search_terms, excluded_term=None):
return search(dbname, search_terms, excluded_term)


def find_id(dbname, activity):
Expand Down
2 changes: 1 addition & 1 deletion data/create_activities.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
del bw2data.databases["Ecobalyse"]

if (db := "Ecobalyse") not in bw2data.databases:
for vertical in ("object", "food", "textile"):
for vertical in ("food", "textile", "object"):
file = f"{vertical}/activities_to_create.json"
if os.path.exists(file):
add_created_activities(db, file)
Expand Down
Loading