usepa / fedelemflowlist Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
This is an Excel problem saving the input files...makes sure the CAS column is of type 'Text' so Excel does not try to convert it to a date upon csv export
The pyarrow dependency is still causing install problems affecting downstream uses of the package. In particular it doesn't seem to be supported on 32-bit versions of Python for Windows. We need to explore how we can remove it and still maintain Parquet read and write without creating another dependency problem.
In version 1.2 of fedelemflowlist in context.py, there is a list comprehension that pulls items from a series using an index, but passes the index as though it were a key (str(row[x])
), which isn't the correct way of accessing items in a series, see L35--36:
There are a number of duplicate entries in the TRI mapping file e.g. ACETOPHENONE
Hello,
I think contexts for long term emissions could be included in the FEDEFL to match with what the ecoinvent database uses as elementary flows.
Currently, as LCIA method developers wanting to connect to the FEDEFL, we can only assign the same characterization factor for both long term and unspecified term emissions. For LCIA methods which differentiate short and long term impact categories (like Impact World+) it leads to an overestimation, since long term emissions are not forced to zero in short term impact categories.
Thank you :)
Failing to import fedelemflowlist version 1.1.1 due to the following error:
>>> import fedelemflowlist
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "~/Envs/ebm/lib/python3.11/site-packages/fedelemflowlist/__init__.py", line 11, in <module>
from fedelemflowlist.flowlist import read_in_flowclass_file
File "~/Envs/ebm/lib/python3.11/site-packages/fedelemflowlist/flowlist.py", line 8, in <module>
from fedelemflowlist.globals import log, inputpath, flow_list_specs,\
File "~/Envs/ebm/lib/python3.11/site-packages/fedelemflowlist/globals.py", line 23, in <module>
fedefl_path.local_path + "/fedelemflowlist/")
~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'PosixPath' and 'str'
I solved this error in ElectricityLCI by wrapping paths.local_path
with str
method:
paths=Paths()
paths.local_path = os.path.realpath(str(paths.local_path) + "/electricitylci")
LCIA mapping files are constructed by combining context mappings and flowable mappings which are assumed independent. That is, a context mapping applies to all flows for that context.
However in some cases modifications to this may be necessary. See #164 and #170, in which a specific flow requires an expansion to the available context mappings.
Flowables, like natural gas, can only have a single alternate unit (e.g. mass). Both in the flowlist dataframe and when generating the JSON
"Dysprosium"
typo as:
"Dysporium"
In rare cases, flows will have the same unit but different flow properties (e.g. net caloric value v. energy). Mapping files, nor the FEDEFL specify the flow property, I believe it is assumed from the unit.
When flow properties don't match when performing a mapping using the flow tool, it triggers an error
The latest release of olca is not supported at this time
The first two links (all_mappings and flow list) in the "Mapping Flowables" section of the Wiki are not working.
It would be nice to be able to map to alternate units in the mapping files. This would reduce the need for conversion factors and keep flows in the original units from the source database.
My sense is that because the mapping files require the UUIDs for target flows, and UUIDs are based on the units in the flow, this may be challenging.
Perhaps add_uuid_to_flowmapping.py could be modified to check for alternate units when a UUID can't be identified.
Needs to be added to flowables mapping, currently only "Water" gets tracked and not "Water, fresh"
only need to write, don't need other functions
Flows that have been updated in our defining sources that are in our list in a as the systematic name and not the chemistry dashboard name
Allyl alcohol versus 2-Propen-1-ol
Cuprammonium acetate versus Copper, bis(acetato-.kappa.O)diammine-
When using the flow mapping feature (in v1.10 or the public version of 1.9) the source category and target category fields add extra spaces even if no spaces are included in the mapping csv file. This causes openLCA not to recognize the category correctly
When editing the source flow and target flow manually and selecting the flow in the database, the category is fixed (see highlighted row in image) and the status is confirmed. This does not seem to impact the actual mapping, only the status.
The olca-ipc does not have the ability to access the synonym field it seems
Its present in NEI 2016 data. Add a mapping for it.
UserWarning: Duplicate name: 'categories/c2433915-9ca3-3933-a64d-68d67e3e3281.json'
return self._open_to_write(zinfo, force_zip64=force_zip
Hi!
I have tried to install the package as outlined in the instructions in a new conda virtual environment and I get the following error message:
pip install git+https://github.com/USEPA/[email protected]#egg=Federal-LCA-Commons-Elementary-Flow-List
Collecting Federal-LCA-Commons-Elementary-Flow-List
Cloning https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git (to revision v1.0) to c:\users\migue\appdata\local\temp\pip-install-1omv9nzh\federal-lca-commons-elementary-flow-list_7cc046fedf48446e99192e8920d09c60
Running command git clone -q https://github.com/USEPA/Federal-LCA-Commons-Elementary-Flow-List.git 'C:\Users\migue\AppData\Local\Temp\pip-install-1omv9nzh\federal-lca-commons-elementary-flow-list_7cc046fedf48446e99192e8920d09c60'
Running command git checkout -q d3cba44
WARNING: Generating metadata for package Federal-LCA-Commons-Elementary-Flow-List produced metadata for project name fedelemflowlist. Fix your #egg=Federal-LCA-Commons-Elementary-Flow-List fragments.
WARNING: Discarding git+https://github.com/USEPA/[email protected]#egg=Federal-LCA-Commons-Elementary-Flow-List. Requested fedelemflowlist from git+https://github.com/USEPA/[email protected]#egg=Federal-LCA-Commons-Elementary-Flow-List has inconsistent name: filename has 'federal-lca-commons-elementary-flow-list', but metadata has 'fedelemflowlist'
ERROR: Could not find a version that satisfies the requirement federal-lca-commons-elementary-flow-list (unavailable) (from versions: none)
ERROR: No matching distribution found for federal-lca-commons-elementary-flow-list (unavailable)
I get a similar error if I try to install version 1.0.7 . The environment has already an updated version of pip and pyarrow installed. (python version 3.9.5)
I'll admit I'm pretty ignorant here. Should there be a consistent naming convention for things like Benzo(b)fluoranthene and Benzo[j]fluoranthene? Should they both use parentheses or both use brackets?
I was surprised to find this mapping - is it intentional? As in, is there some reason that entities reporting NOx to NEI are actually reporting NO2?
When running add_uuid_to_flowmapping.py
File "...\fedelemflowlist\jsonld.py", line 57, in to_json
flow_ref = olca.FlowRef()
AttributeError: module 'olca' has no attribute 'FlowRef'
We no longer host large objects within the repository and git lfs increasingly causes install issues. Can we determine a way to remove it from the install process?
To address surface water flows. Previously only available designation is resource/water or emission/water, which is not specific enough because it is inclusive of subterranean flows.
Recommended replacing some existing contexts by adding the surface designation, eg:
Would also need to generate new contexts for:
A subset of flows have the incorrect conversion factor applied in ImpactWorld+
Conversion factor is typically added via alternate units, but in the case of ImpactWorld+ is supplied in the flowables file. This gets overridden here.
Primarily impacts mappings in Bq for isotopes, where Bq are converted to kBq with no conversion.
Identified by @pweiler2
I'm trying to generate openLCA JSON-LD zip archive with elementary flows and flowmappings and I'm get the error "AttributeError: 'Ref' object has no attribute 'to_json'". Here a snippet reproducing the error:
import fedelemflowlist
from pathlib import Path
output_path = Path('flows_w_mappings.zip')
flowlist = fedelemflowlist.get_flows(preferred_only=False)
flowlist = flowlist.iloc[0:100]
flowmapping = fedelemflowlist.get_flowmapping('ImpactWorld+')
fedelemflowlist.write_jsonld(flowlist,output_path, flowmapping)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/fjunior/Projects/cauldron/Federal-LCA-Commons-Elementary-Flow-List/fedelemflowlist/__init__.py", line 79, in write_jsonld
writer.write_to(path)
File "/Users/fjunior/Projects/cauldron/Federal-LCA-Commons-Elementary-Flow-List/fedelemflowlist/jsonld.py", line 146, in write_to
self._write_mappings(zw)
File "/Users/fjunior/Projects/cauldron/Federal-LCA-Commons-Elementary-Flow-List/fedelemflowlist/jsonld.py", line 224, in _write_mappings
mappings.append(e.to_json())
^^^^^^^^^^^
File "/Users/fjunior/Projects/cauldron/Federal-LCA-Commons-Elementary-Flow-List/fedelemflowlist/jsonld.py", line 119, in to_json
'from': self.source_flow.to_json(),
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/fjunior/Projects/cauldron/Federal-LCA-Commons-Elementary-Flow-List/fedelemflowlist/jsonld.py", line 74, in to_json
'flow': flow_ref.to_json()
^^^^^^^^^^^^^^^^
AttributeError: 'Ref' object has no attribute 'to_json'
I got the same error running the the run_mappings.ipynb
notebook locally1.
I did not manage to make it work in Binder. โฉ
This issue has been brought up by USLCI end-users regarding the moisture content of 'hardwood', 'softwood' biomass resource flows Users ask whether these flows refer to dry or wet mass? Of course, in USLCI (especially CORRIM-relevant flows as in the CORRIM repo itself), this isn't straightforward. Usually, the density varies by species mix/region and which process it's flowing into. Through the years, practitioners compiling & submitting data using these flows have not necessarily used them in a consistent manner--sometimes bringing it in with 50% moisture, some bringing it in at 80% moisture. Note, in some CORRIM flows, biomass elementary flows are completely missing but might be implied by technosphere flow description comment field text. I'm still not sure what the best solution for these aspects --2 possible routes are:
This problem is similar to the issue that was occurring in years prior when CED method combustion HHV factors were applied to elementary flows in mass units before the fuels entered the technosphere and lost mass due to purification to their actual combustion quality ---artificially overestimating CED because no mass loss and heating value gain of fuels via beneficiation/processing were accounted for. This is no longer an issue in FEDEFL-adapted USLCI raw fuel elementary flows are in energy (MJ) instead of mass (kg) units (which took care of that little LCI-LCIA connection oversight but only works in that context). I can't think of an easy fix for biomass flows destined for fuel and material use and having such varying flow property factors (e.g., MJ/kg, kg/m3) depending on species, regional species mix, resource type, and factors that moisture content such as regional harvest location.
Something happened and now I can no longer install this Python package using the following command. What happened?
pip install git+https://github.com/USEPA/[email protected]#egg=fedelemflowlist
See error screenshot:
Hello,
I was wondering if there already are mappings from the FEDEFL flows to the flow nomenclature used in SimaPro and brightway2/ecoinvent?
For some context, I am looking to connect an LCIA method to the FEDEFL list (through LCIAformatter) to then easily be able to distribute the LCIA method to the different LCA software. So if the work, or at least a part of the work, has already been done that would help me out greatly.
Thanks!
Perhaps in TRACI metadata, include discussion of how CFs are handled when fed contexts do not match directly to TRACI contexts
A few of the synonyms entries have CRLFs (/r/n) encoded within the text which makes for some odd CSV exports. See Lasiocarpine for an example.
To support USFS and CORRIM data, where wood is in volume, we need alt units in volume.
It should be fine to use alt units in the flowmapping, but it was causing the test to fail. This commit fixed that. @ashleyedelen Pull it into your fork to update your code. @oftheheadland
File Load Error. mapping file can be created in an IDE, but not using the jupyter notebook
First reported by @bnjmnmorelli
TRACI generally has metal ions and FEDEFL metals without charge. This results in a lack of mapping to a number of CFs in TRACI for these ions. Some examples
LEAD(II) - TRACI
Lead - FEDEFL
ANTIMONY(III), ANTIMONY(V) - TRACI
Antimony - FEDEFL
This needs to be consider for mapping purposes.
Listing more than one alt unit for a flowable triggers an error upon testing the flow list due to duplicate UUIDs. This manifests as duplicate records in the flow list, one for each alt unit and conversion factor. This does not impact the import of flows into openLCA.
There are DIOXIN AND DIOXIN-LIKE COMPOUNDS to water in TRI 2016. Add a mapping to TRI.
See discussion here
Due to the way secondary context mappings are applied to both resources and emissions for flowabes, we have some combinations of water flowables that are mapped with contexts that don't make sense (e.g. flowable: 'water, fresh' context: 'resource/water/saline water body/ocean'). May want to write in some logic to code out resource contexts that don't make sense.
However, it should be noted that the flows do make sense as emissions (eg. flowable: 'water, fresh' context: 'emission/water/saline water body/ocean').
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.