simapro方法文件到olca模式转换器

spm2olca的Python项目详细描述


spm2olca是一个简单的命令行工具,用于转换simapro lcia 方法文件到 olca-schema(json-ld) 包裹。

安装

包的安装要求python>;=3.5 installed而Python Scripts文件夹位于系统路径中。那么,你可以用 pip安装:

pip install spm2olca

在此之后,您应该可以在系统上的任何位置运行该工具。 您可以通过执行以下命令进行测试:

spm2olca -h

要卸载它,只需执行以下命令:

pip uninstall spm2olca

用法

只需键入spm2olca命令,后跟simapro csv文件 要转换的LCIA方法:

spm2olca "My Method.csv"

这将生成olca-schema包,该包将具有相同的 文件名,但扩展名为.zip。然后可以导入此文件 进入OpenLCA。

要查看其他选项,请使用帮助标志-h

spm2olca -h

其他选项:

  • -out:定义输出文件的名称
  • -skip_unmapped:不包括具有未映射流的LCIA因子 (仅在提供流映射时适用)
  • -log:定义日志级别(例如,“all”将记录所有内容)
  • -units:应该使用带有单元映射的csv文件
  • -flows:应该使用带有流映射的csv文件

具有所有选项的命令可能如下所示:

spm2olca -out=out.zip -log=all -skip_unmapped -units=units.csv -flows=flows.csv Method.csv

映射文件

可以为应在中使用的流和单元指定映射文件 转变。如果没有给出单元映射文件,spm2olca将采用 中的default mapping文件 转换。对于流,如果没有映射文件 提供或映射文件中未包含它们。将军 这些映射文件的格式为:

  • 以分号作为分隔符的csv文件
  • UTF-8编码,无字节顺序标记
  • 没有列标题

单位映射

单元按名称映射到openlca单元和流属性。这个 映射文件必须具有以下列:

0.  SimaPro name of the unit
1.  openLCA reference ID of the unit
2.  openLCA name of the flow property
3.  openLCA reference ID of the flow property

流映射

simapro流通过csv映射到openlca引用流 具有以下列的映射文件:

0.  SimaPro name of the flow (string)
1.  SimaPro compartment of the flow (string)
2.  SimaPro sub-compartment of the flow (string)
3.  SimaPro unit of the flow (string)
4.  openLCA reference ID of the flow (UUID)
5.  openLCA name of the flow (string)
6.  openLCA reference ID of the reference flow property of the flow (UUID)
7.  openLCA name of the reference flow property of the flow (string)
8.  openLCA reference ID of the reference unit of the flow (UUID)
9.  openLCA name of the reference unit of the flow (string)
10. conversion factor: amount_simapro * factor = amount_openlca (double)

这与openlca引用数据中的文件相同。转换 factorf转换simapro中simaproa_s的流量 OpenLCA中相应流量的参考单位 参考单位a_o

a_o = f * a_s

例如

a_o = [m3] = 0.001 * [kg] with a_s = [kg]

因此,simapro lcia因子的值是除以 转换为OpenLCA时,此类映射流的系数,例如:

lcia_o = 2000/[m3] = 2/(0.001*[kg]) with a_s = [kg]

simapro lcia方法文件的结构

在下面,simapro lcia方法文件的格式如 一个 EBNF 类似符号:

(* A LCIA method file contains a file header, LCIA methods, and flow lists *)MethodFile  =FileHeader{Method }{UnitList }{FlowList };(* The file header contains meta-data about the file format, column separator
   etc. *)FileHeader  ="{"..."}";(* Each LCIA method starts with a line "Method" and ends with a line "End". It
   contains some method meta data, the LCIA categories*)Method      ="Method"MethodMetaData{ImpactCategory }{NWSet }{DamageCategory };(* An LCIA category starts with the line "Impact category" directly followed by
   a line with the meta-information like name and reference unit. *)ImpactCategory   ="Impact category"ImpactCategory ";"ReferenceUnit ;ImpactFactors ;(* The LCIA factors are written into a section starting with the header
   "Substances" followed with an LCIA factors each in a separate row. *)ImpactFactors ="Substances"{Compartment ";"SubCompartment ";"FlowName ";"CasNumber ";"ImpactFactor ";"Unit};(* The weighting section in a normalization weighting set is optional *)NWSet ="Normalization-Weighting set"NWSetNameEmptyLine"Normalization"{ImpactCategory ";"NormalizationFactor }["Weighting"ImpactCategory ";"WeightingFactor];(* A damage category starts with the header "Damage category" and contains a
   damage factor for each impact category. *)DamageCategory ="Damage category"DamageCategory ";"ReferenceUnitEmptyLine"Impact categories"{ImpactCategory ";"DamageFactor }QuantityList ="Quantities"{QuantityName ";"}UnitList ="Units"{UnitSymbol ";"QuantityName ";"UnitFactor ";"ReferenceUnitName};(* A flow list starts with a line with the flow type (e.g. "Waterborne emissions"
   followed by the meta data of the flows of this type with a separate line for
   each flow. *)FlowList =<FlowType>{FlowMetaData }"End";

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java根据两个数组的值对数组进行排序   具有自签名证书和NTLM代理的java Maven SSL repo错误   java自定义字体按钮不工作AndroidStudio   java通过Spring MVC web应用程序向客户端发送文本文件   Java Spring Web服务SOAP身份验证   ANT property environment=“env”无法在JAVA中检索它,但如果作为ANT命令运行,则可以正常工作   java是为spring mvc rest api或spring boot api对应用服务器的每个新请求创建的服务、存储库和组件的新实例吗?   java私有静态最终字符串未完成其工作   PKCS12的安全Java密钥重新处理   java JPA继承表每类SQLSyntaxErrorException