harbor run -t swe-rebench/brightway-lca__brightway2-io-294harbor download swe-rebench/brightway-lca__brightway2-io-294Extraction of CPC & HS2017 classifications fail The fix for #282 does not seem to work. See the example below:
filename = "08203446-9eb0-579b-a2db-8efbc9f35a9f_2a1573b0-ab2e-4126-b931-a4c8b240a97c.spold"
database = "ecoinvent-3.10.1-cutoff"
node = bd.get_node(filename=filename, database=database)
print(node["name"])
print(node['location'])
print(node['code'])
print(node["classifications"])
returns
market for isohexane
GLO
d4fd2299216f2df9ead62b51afff2710
[('EcoSpold01Categories', 'chemicals/organics'),
('ISIC rev.4 ecoinvent', '2011:Manufacture of basic chemicals'),
('CPC', '3')]
expected results
market for isohexane
GLO
d4fd2299216f2df9ead62b51afff2710
[('EcoSpold01Categories', 'chemicals/organics'),
('ISIC rev.4 ecoinvent', '2011:Manufacture of basic chemicals'),
('CPC', '34110: Hydrocarbons and their halogenated, sulphonated, nitrated or nitrosated derivatives'),
('HS2017', '290290: Cyclic hydrocarbons; n.e.c. in heading no. 2902')]
since 08203446-9eb0-579b-a2db-8efbc9f35a9f_2a1573b0-ab2e-4126-b931-a4c8b240a97c.spold contains the following:
<activityDescription>
...
<classification classificationId="7ac1cbc6-1385-4a68-8647-ed7aa78db201">
<classificationSystem xml:lang="en">EcoSpold01Categories</classificationSystem>
<classificationValue xml:lang="en">chemicals/organics</classificationValue>
</classification>
<classification classificationId="28f738cc-bb73-48f8-b633-f83fb9bc5ddc">
<classificationSystem xml:lang="en">ISIC rev.4 ecoinvent</classificationSystem>
<classificationValue xml:lang="en">2011:Manufacture of basic chemicals</classificationValue>
</classification>
...
</activityDescription>
<flowData>
<intermediateExchange>
...
<classification classificationId="39b0f0ab-1a2f-401b-9f4d-6e39400760a4">
<classificationSystem xml:lang="en">By-product classification</classificationSystem>
<classificationValue xml:lang="en">allocatable product</classificationValue>
</classification>
<classification classificationId="f9c4918d-e5bd-4d4d-96d0-76cf1fc4d53c">
<classificationSystem xml:lang="en">CPC</classificationSystem>
<classificationValue xml:lang="en">34110: Hydrocarbons and their halogenated, sulphonated, nitrated or nitrosated derivatives</classificationValue>
</classification>
<classification classificationId="26a493dd-33e2-5789-aad3-1179ff0bf8ec">
<classificationSystem xml:lang="en">HS2017</classificationSystem>
<classificationValue xml:lang="en">290290: Cyclic hydrocarbons; n.e.c. in heading no. 2902</classificationValue>
</classification>
...
</intermediateExchange>
...
</flowData>
filename = "329fad9d-2c83-57b1-98f1-79c7faeb0f99_2a1573b0-ab2e-4126-b931-a4c8b240a97c.spold"
database = "ecoinvent-3.9.1-cutoff"
node = bd.get_node(filename=filename, database=database)
print(node["name"])
print(node['location'])
print(node['code'])
print(node["classifications"])
returns
market for isohexane
GLO
7f94506cf1198efdfbd069a26f8ce1c6
[('EcoSpold01Categories', 'chemicals/organics'),
('ISIC rev.4 ecoinvent', '2011:Manufacture of basic chemicals'),
('CPC', '3')]
expected results
market for isohexane
GLO
d4fd2299216f2df9ead62b51afff2710
[('EcoSpold01Categories', 'chemicals/organics'),
('ISIC rev.4 ecoinvent', '2011:Manufacture of basic chemicals'),
('CPC', '341: Basic organic chemicals')]
since 329fad9d-2c83-57b1-98f1-79c7faeb0f99_2a1573b0-ab2e-4126-b931-a4c8b240a97c.spold contains the following:
<activityDescription>
...
<classification classificationId="7ac1cbc6-1385-4a68-8647-ed7aa78db201">
<classificationSystem xml:lang="en">EcoSpold01Categories</classificationSystem>
<classificationValue xml:lang="en">chemicals/organics</classificationValue>
</classification>
<classification classificationId="28f738cc-bb73-48f8-b633-f83fb9bc5ddc">
<classificationSystem xml:lang="en">ISIC rev.4 ecoinvent</classificationSystem>
<classificationValue xml:lang="en">2011:Manufacture of basic chemicals</classificationValue>
</classification>
...
</activityDescription>
<flowData>
<intermediateExchange>
...
<classification classificationId="39b0f0ab-1a2f-401b-9f4d-6e39400760a4">
<classificationSystem xml:lang="en">By-product classification</classificationSystem>
<classificationValue xml:lang="en">allocatable product</classificationValue>
</classification>
<classification classificationId="3fab12aa-bf00-4458-a36a-af1fc0dea9b0">
<classificationSystem xml:lang="en">CPC</classificationSystem>
<classificationValue xml:lang="en">341: Basic organic chemicals</classificationValue>
</classification>
...
</intermediateExchange>
...
</flowData>
What puzzles me, is that a CPC value is extracted at all. If it had failed to extract anything all together, this could have been explained by the additional classifications (CPC and HS2017) being located in the <flowData> <intermediateExchange>.