brightway-lca / brightway2

Metapackage for brightway2 imports and documentation
https://brightway.dev/
BSD 3-Clause "New" or "Revised" License
100 stars 37 forks source link

how to use brightway 2 to import lcia file. {http://www.EcoInvent.org/EcoSpold02}impactIndicator raise ValueError ValueError #76

Open mf093087 opened 5 months ago

mf093087 commented 5 months ago

I want to import the .spold, which is a life cycle impact assessment file. However, I can't import it. Below is the error

{http://www.EcoInvent.org/EcoSpold02}impactIndicator
    raise ValueError
ValueError

The file content is like the below. Because it is very long, so I don't put all of the file content.

<?xml version='1.0' encoding='UTF-8'?>
<ecoSpold xmlns="http://www.EcoInvent.org/EcoSpold02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.EcoInvent.org/EcoSpold02 ../../schemas/datasets/EcoSpold02.xsd http://www.EcoInvent.org/UsedUserMasterData ../../schemas/datasets/EcoSpold02UserMasterData.xsd">
  <childActivityDataset>
    <activityDescription>
      <activity specialActivityType="0" id="2bf8c0dd-2378-5cd4-946d-65c0ae254247" activityNameId="2f25a5b2-68c7-4028-97d4-3c4bc5334472" parentActivityId="60323513-c433-419c-94e8-cb2511d23e2a" inheritanceDepth="0" type="2" energyValues="0">
        <activityName xml:lang="en">milk production, from cow</activityName>
        <includedActivitiesStart xml:lang="en">This activity starts from the reception and storage of feed materials, and dairy herd housing. From cradle, i.e. including all upstream activities.</includedActivitiesStart>
        <includedActivitiesEnd xml:lang="en">This activity ends with the provision of milk at farm, ready-to-deliver. The dataset includes the consumption of feed; the livestock management operations (including bedding, drinking water, milking equipment, cleaning products and water, ammonia and dinitrogen oxyde emissions from housing, and methane emissions from enteric fermentation), manure management emissions; energy and buildings (including electricity for dairying, cattle housing and milk parlour equipment and buildings, and gasoline for regular operations) necessary for the operation of a typical dairy farm. The dataset does not include fodder and feed production and processing into meal for animals, litter production, manure management operations (however, emissions are accounted for); nor milk transportation beyond the farm gate (e.g. to dairy processing plants). Also, the dataset does not include particulate matter emissions, nor any drugs used on the dairy farm, because of the lack of data available on quantities and content. In terms of mass, drugs represent much less than 1% of inputs.</includedActivitiesEnd>
        <generalComment>
          <text xml:lang="en" index="0">This dataset represents the production of conventional milk from dairy cows, in Québec (Canada), in 2009-2011. The module includes the consumption of feed, and the operation of cattle housing systems for the management of the dairy herd and the production of cow milk. The functional unit is 1 kg of Fat and Protein Corrected Milk (FPCM) raw milk from Québec dairy farms. The FPCM correction is made for a conversion to a 4.0% fat and 3.3% true protein content, following the equation provided by the International Dairy Federation (IDF): FPCM (kg/yr) = Production (kg/yr) x [0.1226 x Fat% + 0.0776 x Protein% + 0.2534]. Live animals (culled cows and calves) sold for slaughterhing are by-products, as well as solid and liquid manure.</text>
          <text xml:lang="en" index="1">The average dairy farm in Québec produced 449400 L raw milk (at 4.06 kg/hL butterfat and 3.36 kg/hL protein), hence 469488 kg FCPM per farm. The average herd size over the year is: 57,7 milk cows (8137 kg FPCM/cow/year), 0.18 bulls, 0.39 young bulls, 1.11 veals male, 10.72 veals female, 12.56 bred heifers, 14.90 open heifers. Hence, the whole herd is worth 74 livestock units. 11 culled cows and 41 calves are sold for slaughter. The replacement rate is 32%. 91% of animals are housed in tie-stall systems, 9% in free-stall systems. With 6414 dairy farms, Québec milk production accounts for 38% of overall Canada production.</text>
          <text xml:lang="en" index="2">This dataset does not cover organic milk production in Quebec, which is marginal. 1.5% of overall Quebec dairy farms were organic-certified in 2010, and 1% of total milk produced in Québec in 2010 was organic milk (Fédération des Producteurs de lait du Québec; http://www.lait.org/en/interactive-faq/the-production.php). Furthermore, only 80% of organic milk ends up into organic-certified processed products (e.g. organic milk, yogurt, cheese)</text>
          <text xml:lang="en" index="3">44% of the manure is managed as solid manure (35% solid stored; 9% stockpiled) and 56% managed as liquid manure (35% liquid in open-pit with crust formation; 8% liquid in covered pit; 8% liquid in open-pit without crust; and 5% liquid in lagoon). According to these management figures and to the distribution of animal categories within the herd, emissions to the air from manure management have been calculated (in kg/kg FPCM): N2O (direct+indirect): 5,7866E-04 kg; NH3: 5,5310E-04 kg; CH4: 5,5198E-03 kg.</text>
          <text xml:lang="en" index="4"></text>
          <imageUrl index="5">https://db3.ecoinvent.org/images/f08a0b12-8f8b-4f1d-8b52-1d688403d0cc</imageUrl>
        </generalComment>
      </activity>
      <classification classificationId="01c46aed-f5d1-4428-8f0a-52a590cfa278">
        <classificationSystem xml:lang="en">ISIC rev.4 ecoinvent</classificationSystem>
        <classificationValue xml:lang="en">0141:Raising of cattle and buffaloes</classificationValue>
      </classification>
      <geography geographyId="868a66d1-7428-4ba2-9125-253b07afc119">
        <shortname xml:lang="en">CA-QC</shortname>
        <comment>
          <text xml:lang="en" index="0">The inventory applies to Québec dairy farms.</text>
        </comment>
      </geography>
      <technology technologyLevel="3">
        <comment>
          <text xml:lang="en" index="0">Data and assumptions are intended to reflect current equipment, processes, and market conditions.</text>
        </comment>
      </technology>
      <timePeriod startDate="2009-01-01" endDate="2023-12-31" isDataValidForEntirePeriod="true">
        <comment>
          <text xml:lang="en" index="0">Period indicated in the reference. </text>
        </comment>
      </timePeriod>
      <macroEconomicScenario macroEconomicScenarioId="d9f57f0a-a01f-42eb-a57b-8f18d6635801">
        <name xml:lang="en">Business-as-Usual</name>
      </macroEconomicScenario>
    </activityDescription>
    <flowData>
      <intermediateExchange id="343a5711-10c5-5a9f-9c60-9138c5774e06" unitId="487df68b-4994-4027-8fdc-a4dc298257b7" variableName="BP_amount_1" amount="1.0" isCalculatedAmount="true" mathematicalRelation="14070.9/ (dairy_cows_productivity* dairy_cows_per_herd)" sourceId="7b0dbb03-6131-4619-a9e5-4002e75d61e9" sourceYear="2012" sourceFirstAuthor="Quantis" intermediateExchangeId="49719318-578e-40fe-b359-0780c8df9221" productionVolumeAmount="90250704.912443" productionVolumeMathematicalRelation="RP_PV_1 * (BP_amount_1 / RP_amount_1)">
        <name xml:lang="en">cattle for slaughtering, live weight</name>
        <unitName xml:lang="en">kg</unitName>
        <comment xml:lang="en">11.37 culled cows (average live weight 615 kg) and 40.80 calves (average live weight 173,5 kg) are sold every year for slaughtering by the dairy farm. Total live weight is 14070,9 kg</comment>
        <property propertyId="9b14f020-ce8d-4929-a3b5-d6e44624e6bf" amount="0.14813788232605574" isDefiningValue="false" isCalculatedAmount="false" unitId="577e242a-461f-44a7-922c-d8e1c3d2bf45">
          <name xml:lang="en">allocation factor</name>
          <unitName xml:lang="en">dimensionless</unitName>
        </property>
        <property propertyId="f2283db2-62e4-467f-b9ac-c4f45be563b4" amount="0.0" isDefiningValue="false" isCalculatedAmount="false" unitId="487df68b-4994-4027-8fdc-a4dc298257b7">
          <name xml:lang="en">carbon allocation</name>
          <unitName xml:lang="en">kg</unitName>
        </property>
        <property propertyId="a301a838-7975-4d89-9e74-8eb77ad03cd1" amount="0.0" isDefiningValue="false" isCalculatedAmount="false" unitId="577e242a-461f-44a7-922c-d8e1c3d2bf45">
          <name xml:lang="en">carbon content</name>
          <unitName xml:lang="en">dimensionless</unitName>
        </property>
        <property propertyId="38f94dd1-d5aa-41b8-b182-c0c42985d9dc" amount="2.025" unitId="7b75baf0-cbee-45e6-bf66-af119da06553">
          <name xml:lang="en">price</name>
          <unitName xml:lang="en">EUR2005</unitName>
          <comment xml:lang="en">Calculated as an average of the regional prices (ZA and BR) which were provided by the data providers for the specific countries.</comment>
        </property>
        <property propertyId="2dec5fcb-b303-4bfa-8e30-0e043c523163" amount="0.06069071491635693" isDefiningValue="false" isCalculatedAmount="false" unitId="577e242a-461f-44a7-922c-d8e1c3d2bf45">
          <name xml:lang="en">true value</name>
          <unitName xml:lang="en">dimensionless</unitName>
        </property>
        <productionVolumeComment xml:lang="en">Calculated from production volume of reference product using the relative outputs.</productionVolumeComment>
        <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="b7fdf801-45a3-4c2e-b61e-07a7811bc7dd">
          <classificationSystem xml:lang="en">CPC</classificationSystem>
          <classificationValue xml:lang="en">02111: Cattle</classificationValue>
        </classification>
        <classification classificationId="d69e60e3-95d7-5087-890b-1a0ccbaf5db2">
          <classificationSystem xml:lang="en">HS2017</classificationSystem>
          <classificationValue xml:lang="en">010229: Cattle; live, other than pure-bred breeding animals</classificationValue>
        </classification>
        <outputGroup>0</outputGroup>
      </intermediateExchange>
      <parameter parameterId="d8728ca5-64fd-4532-ad24-900145d3e121" amount="57.7" variableName="dairy_cows_per_herd" unitId="5b972631-34e3-4db7-a615-f6931770a0cb">
        <name xml:lang="en">dairy cows per herd over the year, in average dairy farm</name>
        <unitName xml:lang="en">unit</unitName>
        <uncertainty>
          <lognormal meanValue="57.7" mu="4.06" variance="0.0006" varianceWithPedigreeUncertainty="0.0007"/>
          <pedigreeMatrix reliability="1" completeness="2" temporalCorrelation="1" geographicalCorrelation="1" furtherTechnologyCorrelation="1"/>
        </uncertainty>
        <comment xml:lang="en">(Quantis, 2012)</comment>
      </parameter>
      <parameter parameterId="42d9a8c5-3bcb-4ffa-b041-d3f5e0c5c198" amount="73.97" variableName="dairy_herd_size_LU" unitId="5b972631-34e3-4db7-a615-f6931770a0cb">
        <name xml:lang="en">dairy farm herd size</name>
        <unitName xml:lang="en">unit</unitName>
        <uncertainty>
          <lognormal meanValue="73.97" mu="4.3" variance="0.0006" varianceWithPedigreeUncertainty="0.0013"/>
          <pedigreeMatrix reliability="2" completeness="2" temporalCorrelation="1" geographicalCorrelation="1" furtherTechnologyCorrelation="1"/>
        </uncertainty>
        <comment xml:lang="en">dairy farm herd size expressed in livestock unit. This is calculated from 57,7 milk cows (@ 1 head/LU), 0.18 bulls (@ 1 head/LU), 1.11+10.72 veals (@ 5 heads/LU), and 12.56+14.90 heifers (@ 2 heads/LU). (Quantis, 2012)</comment>
      </parameter>
      <parameter parameterId="1b0f3bcb-de65-40c9-9384-158fabdafa7f" amount="0.9082" variableName="dairy_tie_stall_fraction" unitId="577e242a-461f-44a7-922c-d8e1c3d2bf45">
        <name xml:lang="en">fraction of dairy cows under tie-stall housing</name>
        <unitName xml:lang="en">dimensionless</unitName>
        <uncertainty>
          <lognormal meanValue="0.9082" mu="-0.1" variance="0.0006" varianceWithPedigreeUncertainty="0.0007"/>
          <pedigreeMatrix reliability="1" completeness="2" temporalCorrelation="1" geographicalCorrelation="1" furtherTechnologyCorrelation="1"/>
        </uncertainty>
        <comment xml:lang="en">91% of Quebec dairy herd is in tie-stall systems, 9% in free-stall systems (Quantis, 2012)</comment>
      </parameter>
      <parameter parameterId="daadf2d4-7bbb-4f69-8ab5-58df4c1685eb" amount="0.15" variableName="fraction_PW_to_air" unitId="577e242a-461f-44a7-922c-d8e1c3d2bf45">
        <name xml:lang="en">fraction, process water, to air</name>
        <unitName xml:lang="en">dimensionless</unitName>
        <uncertainty>
          <lognormal meanValue="0.15" mu="-1.9" variance="0.04" varianceWithPedigreeUncertainty="0.092025"/>
          <pedigreeMatrix reliability="4" completeness="4" temporalCorrelation="3" geographicalCorrelation="2" furtherTechnologyCorrelation="4"/>
        </uncertainty>
        <comment xml:lang="en">Literature value. In case when no industry/process specific data are available, default evaporation fraction value is used. This value is 15% and is based on literature (Statistics Canada, 2007 &amp; Shaffer, K.H., 2008, Consumptive water use in the Great Lakes Basin, USGS &amp; Shiklomanov, 2003, World Water Resources at the Beginning of the 21st Century) and has been approved by an expert.</comment>
      </parameter>
      <parameter parameterId="148c8010-cc60-48cd-9b40-fc7278e377f7" amount="0.15" variableName="fraction_TW_to_air" mathematicalRelation="fraction_PW_to_air" isCalculatedAmount="true" unitId="577e242a-461f-44a7-922c-d8e1c3d2bf45">
        <name xml:lang="en">fraction, tap water, to air</name>
        <unitName xml:lang="en">dimensionless</unitName>
        <uncertainty>
          <lognormal meanValue="0.15" mu="-1.9" variance="0.04" varianceWithPedigreeUncertainty="0.092025"/>
          <pedigreeMatrix reliability="4" completeness="4" temporalCorrelation="3" geographicalCorrelation="2" furtherTechnologyCorrelation="4"/>
        </uncertainty>
        <comment xml:lang="en">Calculated value. See comment in the other parametres present in this dataset. Tap water is considered to be always used as process water, thus process water fractions to air are applied to all tap water input flows to calculate the amount of water consumed in the processes.</comment>
      </parameter>
      <parameter parameterId="ca04da6b-a4e4-4172-8be4-0ad990e2e549" amount="0.15" variableName="fraction_WDI_to_air" mathematicalRelation="fraction_PW_to_air" isCalculatedAmount="true" unitId="577e242a-461f-44a7-922c-d8e1c3d2bf45">
        <name xml:lang="en">fraction, water, deionised, to air</name>
        <unitName xml:lang="en">dimensionless</unitName>
        <uncertainty>
          <lognormal meanValue="0.15" mu="-1.9" variance="0.04" varianceWithPedigreeUncertainty="0.092025"/>
          <pedigreeMatrix reliability="4" completeness="4" temporalCorrelation="3" geographicalCorrelation="2" furtherTechnologyCorrelation="4"/>
        </uncertainty>
        <comment xml:lang="en">Calculated value. See comment in the other parametres present in this dataset. Deionised water is considered to be always used as process water, thus process water fractions to air are applied to all deionised water input flows to calculate the amount of water consumed in the processes.</comment>
      </parameter>
      <parameter parameterId="138a6523-dbc1-4793-85c3-51a715837aad" amount="8136.71" variableName="dairy_cows_productivity" unitId="487df68b-4994-4027-8fdc-a4dc298257b7">
        <name xml:lang="en">milk productivity of Quebec dairy cows</name>
        <unitName xml:lang="en">kg</unitName>
        <uncertainty>
          <lognormal meanValue="8136.71" mu="9.0" variance="0.0006" varianceWithPedigreeUncertainty="0.0007"/>
          <pedigreeMatrix reliability="1" completeness="2" temporalCorrelation="1" geographicalCorrelation="1" furtherTechnologyCorrelation="1"/>
        </uncertainty>
        <comment xml:lang="en">kg FPCM milk per dairy cow per year, in Québec, in 2009-2011. Source: Quantis, 2012.</comment>
      </parameter>
      <impactIndicator impactIndicatorId="bfbecdfe-7374-4c10-9fe7-c886fdd1978d" impactMethodId="35716c60-7337-4442-9f3a-42effd692b82" impactCategoryId="90b2732a-cc11-4f9f-93ac-6d890afa7fd3" amount="0.04991536023294269">
        <impactMethodName>CML v4.8 2016</impactMethodName>
        <impactCategoryName>acidification</impactCategoryName>
        <name>acidification (incl. fate, average Europe total, A&amp;B)</name>
        <unitName>kg SO2-Eq</unitName>
      </impactIndicator>
      <impactIndicator impactIndicatorId="0e8ded58-82fd-491c-a5d3-1c2e100cb843" impactMethodId="35716c60-7337-4442-9f3a-42effd692b82" impactCategoryId="c7c113ae-9fef-489b-b9e6-a46b12f00ad9" amount="7.360864562218072">
        <impactMethodName>CML v4.8 2016</impactMethodName>
        <impactCategoryName>climate change</impactCategoryName>
        <name>global warming potential (GWP100)</name>
        <unitName>kg CO2-Eq</unitName>
      </impactIndicator>
      <impactIndicator impactIndicatorId="690cf42b-2716-414f-9532-2f33e0e8cf07" impactMethodId="35716c60-7337-4442-9f3a-42effd692b82" impactCategoryId="0f2b6b14-f992-4bb9-8cb6-75f92ed9c649" amount="3.0740602264015298">
        <impactMethodName>CML v4.8 2016</impactMethodName>
        <impactCategoryName>ecotoxicity: freshwater</impactCategoryName>
        <name>freshwater aquatic ecotoxicity (FAETP inf)</name>
        <unitName>kg 1,4-DCB-Eq</unitName>
      </impactIndicator>
      <impactIndicator impactIndicatorId="2089f8c8-5d7a-42b6-8287-22554b2f7013" impactMethodId="35716c60-7337-4442-9f3a-42effd692b82" impactCategoryId="3db36018-4449-4227-8b1a-fdc1b69e532f" amount="6409.394484154318">
        <impactMethodName>CML v4.8 2016</impactMethodName>
        <impactCategoryName>ecotoxicity: marine</impactCategoryName>
        <name>marine aquatic ecotoxicity (MAETP inf)</name>
        <unitName>kg 1,4-DCB-Eq</unitName>
      </impactIndicator>
      <impactIndicator impactIndicatorId="15aa9cec-9211-40fa-b6cf-014e7ff73bd4" impactMethodId="35716c60-7337-4442-9f3a-42effd692b82" impactCategoryId="3daafa94-287b-42a8-bc86-dcb2261a13b8" amount="0.07799735765077655">
        <impactMethodName>CML v4.8 2016</impactMethodName>
        <impactCategoryName>ecotoxicity: terrestrial</impactCategoryName>
        <name>terrestrial ecotoxicity (TETP inf)</name>
        <unitName>kg 1,4-DCB-Eq</unitName>
      </impactIndicator>
      <impactIndicator impactIndicatorId="a731d4ee-5daa-44c2-9254-3a619bc5c328" impactMethodId="35716c60-7337-4442-9f3a-42effd692b82" impactCategoryId="12323275-9349-4178-bf82-b9eda9651685" amount="19.6705737962144">
        <impactMethodName>CML v4.8 2016</impactMethodName>
        <impactCategoryName>energy resources: non-renewable</impactCategoryName>
        <name>abiotic depletion potential (ADP): fossil fuels</name>
        <unitName>MJ</unitName>
      </impactIndicator>

May I ask, if the brightway2 can't support this file?