Commit 52011cc 1 parent 45bf6bd commit 52011cc Copy full SHA for 52011cc
File tree 2 files changed +58
-0
lines changed
2 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 16
16
source_target_pair_as_bw_dict ,
17
17
split_replace_disaggregate ,
18
18
)
19
+ from .patches import TECHNOSPHERE_PATCHES
19
20
from . import __version__
20
21
21
22
@@ -145,6 +146,12 @@ def generate_technosphere_mapping(
145
146
)
146
147
data = split_replace_disaggregate (data = data , target_lookup = target_lookup )
147
148
149
+ try :
150
+ for key , value in TECHNOSPHERE_PATCHES [(source_version , target_version )].items ():
151
+ data [key ].extend (value )
152
+ except KeyError :
153
+ pass
154
+
148
155
if not data ["replace" ] and not data ["disaggregate" ]:
149
156
logger .info (
150
157
"It seems like there are no technosphere changes for this release. Doing nothing."
@@ -231,6 +238,9 @@ def generate_biosphere_mapping(
231
238
)
232
239
)
233
240
241
+ if not description :
242
+ description = f"Data migration file from { source_db_name } to { target_db_name } generated with `ecoinvent_migrate` version { __version__ } "
243
+
234
244
data = pd .read_excel (io = excel_filepath , sheet_name = candidates [0 ]).to_dict (orient = "records" )
235
245
data = source_target_biosphere_pair (
236
246
data = data ,
Original file line number Diff line number Diff line change
1
+ TECHNOSPHERE_PATCHES = {
2
+ ("3.9.1" , "3.10" ): {
3
+ 'replace' : [
4
+ {
5
+ 'source' : {
6
+ 'name' : "modified Solvay process, Hou's process" ,
7
+ 'location' : 'GLO' ,
8
+ 'reference product' : 'ammonium chloride' ,
9
+ 'unit' : 'kg'
10
+ },
11
+ 'target' : {
12
+ 'name' : "soda ash production, dense, Hou's process" ,
13
+ 'location' : 'GLO' ,
14
+ 'reference product' : 'ammonium chloride' ,
15
+ 'unit' : 'kg'
16
+ }
17
+ },
18
+ {
19
+ 'source' : {
20
+ 'name' : 'Mannheim process' ,
21
+ 'location' : 'RER' ,
22
+ 'reference product' : 'sodium sulfate, anhydrite' ,
23
+ 'unit' : 'kg'
24
+ },
25
+ 'target' : {
26
+ 'name' : "hydrochloric acid production, Mannheim process" ,
27
+ 'location' : 'RER' ,
28
+ 'reference product' : 'sodium sulfate, anhydrite' ,
29
+ 'unit' : 'kg'
30
+ }
31
+ },
32
+ {
33
+ 'source' : {
34
+ 'name' : 'Mannheim process' ,
35
+ 'location' : 'RoW' ,
36
+ 'reference product' : 'sodium sulfate, anhydrite' ,
37
+ 'unit' : 'kg'
38
+ },
39
+ 'target' : {
40
+ 'name' : "hydrochloric acid production, Mannheim process" ,
41
+ 'location' : 'RoW' ,
42
+ 'reference product' : 'sodium sulfate, anhydrite' ,
43
+ 'unit' : 'kg'
44
+ }
45
+ },
46
+ ]
47
+ }
48
+ }
You can’t perform that action at this time.
0 commit comments