ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Importing Ecoinvent Database In Ecospold Format For Mac
    카테고리 없음 2020. 3. 22. 20:05
    1. Importing Ecoinvent Database In Ecospold Format For Mac And Cheese

    Note This class does not need to be instantiated, as all its methods are classmethods, i.e. Do BW2Package.importobj('foo') instead of BW2Package.importobj('foo') classmethod exportobj ( obj, filename=None, folder='export', backwardscompatible=False ) Export an object. Args:. obj (object): Object to export. filename (str, optional): Name of file to create.

    Default is obj.name. folder (str, optional): Folder to create file in. Default is export. backwardscompatible (bool, optional): Create package compatible with bw2data version 1. Returns: Filepath of created file. Classmethod exportobjs ( objs, filename, folder='export', backwardscompatible=False ) Export a list of objects.

    Can have heterogeneous types. Args:. objs (list): List of objects to export. filename (str): Name of file to create. folder (str, optional): Folder to create file in. Default is export. backwardscompatible (bool, optional): Create package compatible with bw2data version 1.

    Returns: Filepath of created file. Classmethod importfile ( filepath, whitelist=True ) Import bw2package file, and create the loaded objects, including registering, writing, and processing the created objects. Args:. filepath (str): Path of file to import. whitelist (bool): Apply whitelist to allowed types.

    Default is True. Returns: Created object or list of created objects. Classmethod loadfile ( filepath, whitelist=True ) Load a bw2package file with one or more objects.

    Importing Ecoinvent Database In Ecospold Format For Mac And Cheese

    Does not create new objects. Args:.

    filepath (str): Path of file to import. whitelist (bool): Apply whitelist of approved classes to allowed types.

    Default is True. Returns the loaded data in the bw2package dict data format, with the following changes:. 'class' is an actual Python class object (but not instantiated). Simapro CSV class bw2io.extractors.simaprocsv. SimaProCSVExtractor classmethod parsebiosphereflow ( line, category, pm ) Parse biosphere flow line.

    name. subcategory. unit. value or formula. uncertainty type.

    uncert. comment However, sometimes the value is in index 2, and the unit in index 3.

    Because why not! We assume default ordering unless we find a number in index 2. Classmethod parsecalculatedparameter ( line, pm ) Parse line in Calculated parameters section. name. formula.

    comment Can include multiline comment in TSV. Classmethod parsefinalwasteflow ( line, pm ) Parse final wate flow line. 0: name 1: subcategory? Value or formula 4. Uncertainty type 5. However, sometimes the value is in index 2, and the unit in index 3.

    Because why not! We assume default ordering unless we find a number in index 2. Classmethod parseinputline ( line, category, pm ) Parse technosphere input line. name. unit.

    value or formula. uncertainty type. uncert. comment However, sometimes the value is in index 1, and the unit in index 2. Because why not! We assume default ordering unless we find a number in index 1.

    Classmethod parseinputparameter ( line ) Parse line in Input parameters section. name. value (not formula). uncertainty type. uncert.

    hidden (“Yes” or “No” - we ignore). comment classmethod parsereferenceproduct ( line, pm ) Parse reference product line. name. unit.

    value or formula. allocation. waste type.

    category (separated by ). comment However, sometimes the value is in index 1, and the unit in index 2. Because why not! We assume default ordering unless we find a number in index 1. Classmethod parsewastetreatment ( line, pm ) Parse reference product line. name.

    unit. value or formula. waste type. category (separated by ). comment class bw2io.extractors.simaprolciacsv. SimaProLCIACSVExtractor classmethod parsecf ( line ) Parse line in Substances section. category.

    subcategory. flow. CAS number. CF. unit. Base class bw2io.importers.base.

    ImportBase (.args,.kwargs ) Base class for format-specific importers. Defines workflow for applying strategies. Applystrategies ( strategies=None, verbose=True ) Apply a list of strategies. Uses the default list self.strategies if strategies is None. Args: strategies (list, optional): List of strategies to apply. Defaults to self.strategies. Returns: Nothings, but modifies self.data, and adds each strategy to self.appliedstrategies.

    Applystrategy ( strategy, verbose=True ) Apply strategy transform to self.data. Adds strategy name to self.appliedstrategies. If StrategyError is raised, print error message, but don’t raise error. Note Strategies should not partially modify data before raising StrategyError. Args: strategy (callable) Returns: Nothing, but modifies self.data, and strategy to self.appliedstrategies. Unlinked Iterate through unique unlinked exchanges. Uniqueness is determined by activityhash.

    Writeunlinked ( name ) Write all data to an UnlikedData data store (not a Database!) class bw2io.importers.baselci. LCIImporter ( dbname ) Base class for format-specific importers. Defines workflow for applying strategies. Takes a database name (string) as initialization parameter. Addunlinkedactivities ( ) Add technosphere flows to self.data. Createnewbiosphere ( biospherename, relink=True ) Create new biosphere database from biosphere flows in self.data. Links all biosphere flows to new bio database if relink.

    Matchdatabase ( dbname=None, fields=None, ignorecategories=False, relink=False, kind=None ) Match current database against itself or another database. If dbname is None, match against current data. Otherwise, dbname should be the name of an existing Database. Fields is a list of fields to use for matching. Field values are case-insensitive, but otherwise must match exactly for a link to be valid. If fields is None, use the default fields of ‘name’, ‘categories’, ‘unit’, ‘reference product’, and ‘location’.

    If ignorecategories, link based only on name, unit and location. Ignorecategories conflicts with fields. If relink, relink exchanges even if a link is already present. Kind can be a string or a list of strings.

    Common values are “technosphere”, “biosphere”, “production”, and “substitution”. Nothing is returned, but self.data is changed. Writedatabase ( data=None, deleteexisting=True, backend=None, activateparameters=False,.kwargs ) Write data to a Database. All arguments are optional, and are normally not specified.

    Deleteexisting effects both the existing database (it will be emptied prior to writing if True, which is the default), and, if activateparameters is True, existing database and activity parameters. Database parameters will only be deleted if the import data specifies a new set of database parameters (i.e. Databaseparameters is not None) - the same is true for activity parameters. If you need finer-grained control, please use the DatabaseParameter, etc. Objects directly.

    Args:. data (dict, optional): The data to write to the Database. Default is self.data. deleteexisting (bool, default True): See above. activateparameters (bool, default False). Instead of storing parameters in Activity and other proxy objects, create ActivityParameter and other parameter objects, and evaluate all variables and formulas.

    backend (string, optional): Storage backend to use when creating Database. Default is the default backend. Returns: Database instance. Writeexcel ( onlyunlinked=False, onlynames=False ) Write database information to a spreadsheet. If onlyunlinked, then only write unlinked exchanges. If onlynames, then write only activity names, no exchange data. Returns the filepath to the spreadsheet file.

    Writeprojectparameters ( data=None, deleteexisting=True ) Write global parameters to ProjectParameter database table. Deleteexisting controls whether new parameters will deleteexisting existing parameters, or just update values.

    The name field is used to determine if a parameter exists. Data should be a list of dictionaries ( self.projectparameters is used by default). Note only imports are supported. Class bw2io.importers.ecospold1. SingleOutputEcospold1Importer ( filepath, dbname ) Import and process single-output datasets in the ecospold 1 format.

    Applies the following strategies: #. If only one exchange is a production exchange, that is the reference product #. Delete (unreliable) integer codes from extracted data #.

    Drop unspecified subcategories from biosphere flows #. Normalize biosphere flow categories to ecoinvent 3.1 standard #.

    Normalize biosphere flow names to ecoinvent 3.1 standard #. Remove locations from biosphere exchanges #. Create a code from the activity hash of the dataset #. Link biosphere exchanges to the default biosphere database #. Link internal technosphere exchanges Args:. filepath: Either a file or directory. dbname: Name of database to create.

    Class bw2io.importers.ecospold1. MultiOutputEcospold1Importer (.args,.kwargs ) Import and process mutli-output datasets in the ecospold 1 format. Works the same as the single-output importer, but first allocates multioutput datasets. Class bw2io.importers.ecospold1lcia. Ecospold1LCIAImporter ( filepath, biosphere=None ). Note both imports and exports are supported.

    Class bw2io.importers.excel. ExcelImporter ( filepath ) Generic Excel importer. Excel spreadsheet should follow the following format::: Project parameters, metadata Database, Parameters, metadata Activity, Exchanges, Neither project parameters, parameters, nor exchanges for each activity are required. An activity is marked as finished with a blank line. In general, data is imported without modification. However, the following transformations are applied:. Numbers are translated from text into actual numbers.

    Tuples, separated in the cell by the:: string, are reconstructed. True and False are transformed to boolean values. Fields with the value (Unknown) are dropped. Generic bw2io.strategies.generic. Linkiterablebyfields ( unlinked, other=None, fields=None, kind=None, internal=False, relink=False ) Generic function to link objects in unlinked to objects in other using fields fields. The database to be linked must have uniqueness for each object for the given fields.

    If kind, limit objects in unlinked of type kind. If relink, link to objects which already have an input. Otherwise, skip already linked objects.

    If internal, linked unlinked to other objects in unlinked. Each object must have the attributes database and code. Assignonlyproductasproduction ( db ) Assign only product as reference product.

    Skips datasets that already have a reference product or no production exchanges. Production exchanges must have a name and an amount. Will replace the following activity fields, if not already specified:. ‘name’ - name of reference product. ‘unit’ - unit of reference product.

    ‘production amount’ - amount of reference product bw2io.strategies.generic. Linktechnospherebyactivityhash ( db, externaldbname=None, fields=None ) Link technosphere exchanges using activityhash function. If externaldbname, link against a different database; otherwise link internally. If fields, link using only certain fields. Setcodebyactivityhash ( db, overwrite=False ) Use activityhash to set dataset code.

    By default, won’t overwrite existing codes, but will if overwrite is True. Setcodebyactivityhash ( db, overwrite=False ) Use activityhash to set dataset code. By default, won’t overwrite existing codes, but will if overwrite is True. Tupleizecategories ( db ) bw2io.strategies.generic. Dropunlinked ( db ) This is the nuclear option - use at your own risk! Normalizeunits ( db ) Normalize units in datasets and their exchanges. Biosphere bw2io.strategies.biosphere.

    Dropunspecifiedsubcategories ( db ) Drop subcategories if they are in the following:. unspecified. (unspecified). ' (empty string). None bw2io.strategies.biosphere.

    Normalizebiospherenames ( db, lcia=False ) Normalize biosphere flow names to ecoinvent 3.1 standard. Assumes that each dataset and each exchange have a name. Will change names even if exchange is already linked.

    Normalizebiospherecategories ( db, lcia=False ) Normalize biosphere categories to ecoinvent 3.1 standard bw2io.strategies.biosphere. Stripbiosphereexclocations ( db ) Biosphere flows don’t have locations - if any are included they can confuse linking. LCIA bw2io.strategies.lcia.

    Addactivityhashcode ( data ) Add code field to characterization factors using activityhash, if code not already present. Dropunlinkedcfs ( data ) Drop CFs which don’t have input attribute bw2io.strategies.lcia. Setbiospheretype ( data ) Set CF types to ‘biosphere’, to keep compatibility with LCI strategies. This will overwrite existing type values. Matchsubcategories ( data, biospheredbname, remove=True ) Given a characterization with a top-level category, e.g. ('air',), find all biosphere flows with the same top-level categories, and add CFs for these flows as well.

    Doesn’t replace CFs for existing flows with multi-level categories. If remove, also delete the top-level CF, but only if it is unlinked. Ecospold 1 bw2io.strategies.ecospold1allocation. Cleanintegercodes ( data ) Convert integer activity codes to strings and delete integer codes from exchanges (they can’t be believed).

    Es1allocatemultioutput ( data ) This strategy allocates multioutput datasets to new datasets. This deletes the multioutput dataset, breaking any existing linking.

    This shouldn’t be a concern, as you shouldn’t link to a multioutput dataset in any case. Note that multiple allocations for the same product and input will result in undefined behavior. Allocateexchanges ( ds ) Take a dataset, which has multiple outputs, and return a list of allocated datasets. The allocation data structure looks like. Ecospold 2 bw2io.strategies.ecospold2.

    Linkbiospherebyflowuuid ( db, biosphere='biosphere3' ) bw2io.strategies.ecospold2. Removezeroamountcoproducts ( db ) Remove coproducts with zero production amounts from exchanges bw2io.strategies.ecospold2. Removezeroamountinputswithnoactivity ( db ) Remove technosphere exchanges with amount of zero and no uncertainty. Input exchanges with zero amounts are the result of the ecoinvent linking algorithm, and can be safely discarded. Es2assignonlyproductwithamountasreferenceproduct ( db ) If a multioutput process has one product with a non-zero amount, assign that product as reference product. This is by default called after removezeroamountcoproducts, which will delete the zero-amount coproducts in any case.

    However, we still keep the zero-amount logic in case people want to keep all coproducts. Assignsingleproductasactivity ( db ) bw2io.strategies.ecospold2. Createcompositecode ( db ) Create composite code from activity and flow names bw2io.strategies.ecospold2. Linkinternaltechnospherebycompositecode ( db ) Link internal technosphere inputs by code. Only links to process datasets actually in the database document. Deleteexchangesmissingactivity ( db ) Delete exchanges that weren’t linked correctly by ecoinvent. These exchanges are missing the “activityLinkId” attribute, and the flow they want to consume is not produced as the reference product of any activity.

    See the report. Deleteghostexchanges ( db ) Delete technosphere which can’t be linked due to ecoinvent errors. A ghost exchange is one which links to a combination of activity and flow which aren’t provided in the database. Simapro bw2io.strategies.simapro. Spallocateproducts ( db ) Create a dataset from each product in a raw SimaPro dataset bw2io.strategies.simapro.

    Linktechnospherebasedonnameunitlocation ( db, externaldbname=None ) Link technosphere exchanges based on name, unit, and location. Can’t use categories because we can’t reliably extract categories from SimaPro exports, only exchanges. If externaldbname, link against a different database; otherwise link internally. Splitsimapronamegeo ( db ) Split a name like ‘foo/CH U’ into name and geo components. Sets original name to simapro name. Normalizesimaprobiospherecategories ( db ) Normalize biosphere categories to ecoinvent standard.

    Normalizesimaprobiospherenames ( db ) Normalize biosphere flow names to ecoinvent standard bw2io.strategies.simapro. Normalizesimaproformulae ( formula, settings ) Convert SimaPro formulae to Python.

    Backups bw2io.backup. Backupdatadirectory ( ) Backup data directory to a.tar.gz (compressed tar archive). Backup archive is saved to the user’s home directory. Restoration is done manually. Returns the filepath of the backup archive. Backupprojectdirectory ( project ) Backup project data directory to a.tar.gz (compressed tar archive).

    Project is the name of a project. Backup archive is saved to the user’s home directory. Restoration is done using restoreprojectdirectory. Returns the filepath of the backup archive.

    About The converter was the first “piece” to be developed for the openLCA framework. The Idea for the tool emerged at GreenDelta when discussions between the (then) new ILCD format and EcoSpold(1) did not come to an end.

    We started working on the converter by the end of 2006. The first releases were in April and August 2007, new versions were published in 2010 and 2013.

    Recently more and more effort is spent on mapping files used in the converter. The tool converts various LCA data formats from one format into the other, including EcoSpold01 to ILCD, EcoSpold02 to ILCD, ILCD to EcoSpold01, and ILCD to EcoSpold02. Converted files can also be used by other LCA software packages, beyond openLCA. The converter runs as a stand-alone application on Windows, Mac, and Linux operating systems – its installation is simple. Like openLCA, the openLCA format converter is an open source software, which means that both the software and its source code is publicly and freely available. The user interface was never too beautiful; almost all of the effort was spent on things below the user interface (which reminds us of an iceberg, always).

    From the 2nd release onward, the converter contains also mapping files to assign reference flows and other elements from one format to the other. Over time, the import and export functionalities from the converter have also been implemented in openLCA, but the format converter is still available as stand-alone tool for users of other LCA software packages, such as SimaPro for example where only recently (in 2016) an ILCD format export was added. Current status, usage The latest release of the converter is version 3.1.3 from end of 2015. The converter is a Java application, its use should be straightforward.

    You need to have Java installed on your computer though. To use the converter, unzip the archive if you downloaded the zip archive, or open directly the Jar file. A database subfolder with the mapping files is created. If you want to modify or overwrite the mappings, close the converter first and modify the mapping files then; making a backup of the files to be edited is recommended.

    Further details are explained in the format converter documentation which is available on the. More and more of the features of the format converter are now also available in the “normal” openLCA application, where also the more modern L2D format is available (LCA Linked Data format, developed by GreenDelta). If you have a recommendation for improvement, let us know. We know the converter has been used quite often, for example for creating the basis for the Chinese. We also understand that for more uncommon tasks, the converter alone will not be able to directly provide the final result, but the result will need to be fine-tuned.

    Therefore, if you are working on or considering a possible major conversion task, we would be interested to know as well. We are experienced in providing smooth, efficient conversion also from and to all major LCA software systems. History, older documentation and feedback The format converter is now almost 10 years released. Our initial hope, that releasing the converter as open source will lead to additions and improvements by others, has not really materialized yet for the tool, but this may still change.

    For the mapping lists, some additions have been recently published by of the European Commission. To possibly support understanding of the converter, documentation regarding previous released versions of the format converter and documentation about the format conversion and its shortcomings is provided below. Converter version 2 (2010) EcoSpold01 to ILCD (1.0) format, 35 pages: EcoSpold02 to ILCD (1.0) format, 38 pages: ILCD (1.0) to EcoSpold01 format, 59 pages: ILCD (1.0) to EcoSpold01 format, 61 pages: Since ecoinvent 3 was not released yet at the time when the EcoSpold02 format was implemented in the converter, the EcoSpold02 converter format follows the official format specification which is different from the format as it is used now in the ecoinvent database and in the ecoeditor, see also the comment on the page. Use instructions for the V2 converter (pdf from ppt, 31 pages): Converter version 1 (2007) For the very first release of the converter, we provided a complete, web-based documentation which we re-post here, in version 1.1: The converter supported EcoSpold01, ELCD (not ILCD, which is the predecessor), and the Swedish ISO14048/TSIMI format. The documentation covers EcoSpold01 and ELCD.

    For all fields, requirement, occurrence, nomenclature and pattern, and the data type are assessed, as follows: For each attribute, a link to the converter code is provided which allows to directly jump to the code. Related projects and services We have been involved in successful conversion of LCA data sets, models, and entire databases, since about ten years now. Here a list of selected services and of projects. Projects can be really small (only a few hours) to several months if specific tools need to be written for the conversion and for a later quality assurance.

    We are evidently welcoming any inquiries – if you are thinking of, pondering about a migration task or conversion project, please.

Designed by Tistory.