-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Context mapping #120
Context mapping #120
Conversation
Context mapping
Update NEI_FlowableMappings.csv
Update NEI_FlowableMappings.csv
…ld NEI/TRI flows to flow mapping files, and created new mapping files for NEI/TRI for QA
Context mapping
Context mapping update
Context mapping
…t files and add 1 to all blank/nan entries prior to applying default conversion factors where applicable
…maintains warning to check for duplicate flows in source flowables list
Added air compartment for pesticides that had previously been in the list before the additional pesticides from USDA was added.
updated chemical air emissions for pesticides
added s-kinoprene emission/air
added borax as an emission to air
added necessary geological air emissions categories for pesticides work
added silica
added Silica primary context to air for pesticide work
edits to finalize pesticide mapping petroleum oil is mapped to hydrocarbons, petroleum and silicon dioxide to silica
addition of water primary contexts to insecticide lists
pesticides update
updated geological secondary context for emissions based on pesticides update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the flow mapping unit tests are failing for me
583236 != 583296
Expected :583296
Actual :583236
<Click to see difference>
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2020.2.1\plugins\python\helpers\pycharm\teamcity\diff_tools.py", line 32, in _patched_equals
old(self, first, second, msg)
File "C:\Users\wesle\AppData\Local\Programs\Python\Python37\lib\unittest\case.py", line 839, in assertEqual
assertion_func(first, second, msg=msg)
File "C:\Users\wesle\AppData\Local\Programs\Python\Python37\lib\unittest\case.py", line 832, in _baseAssertEqual
raise self.failureException(msg)
AssertionError: 583296 != 583236
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\wesle\AppData\Local\Programs\Python\Python37\lib\unittest\case.py", line 59, in testPartExecutor
yield
File "C:\Users\wesle\AppData\Local\Programs\Python\Python37\lib\unittest\case.py", line 615, in run
testMethod()
File "C:\Users\wesle\Federal-LCA-Commons-Elementary-Flow-List\tests\test_flow_mappings.py", line 31, in test_no_nas_in_required_fields
self.assertEqual(len(flowmappings_w_required), len(nas_in_required))
582627 != 583296
Expected :583296
Actual :582627
<Click to see difference>
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2020.2.1\plugins\python\helpers\pycharm\teamcity\diff_tools.py", line 32, in _patched_equals
old(self, first, second, msg)
File "C:\Users\wesle\AppData\Local\Programs\Python\Python37\lib\unittest\case.py", line 839, in assertEqual
assertion_func(first, second, msg=msg)
File "C:\Users\wesle\AppData\Local\Programs\Python\Python37\lib\unittest\case.py", line 832, in _baseAssertEqual
raise self.failureException(msg)
AssertionError: 583296 != 582627
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\wesle\AppData\Local\Programs\Python\Python37\lib\unittest\case.py", line 59, in testPartExecutor
yield
File "C:\Users\wesle\AppData\Local\Programs\Python\Python37\lib\unittest\case.py", line 615, in run
testMethod()
File "C:\Users\wesle\Federal-LCA-Commons-Elementary-Flow-List\tests\test_flow_mappings.py", line 41, in test_targetflowinfo_matches_flows_in_list
self.assertEqual(len(flowmapping_targetinfo), len(flowmappings_w_flowlist))
Missing flows from test_no_nas_in_required_fields
|
Yes on the first failure, these flow mappings for USEEIOr don't have source flow contexts. I'll revise them to match the satellite tables. On the second failure, if you update your parquet it should be resolved. I did not yet push a v1.0.7 parquet but I can on this branch. |
FYI in flowlist.py I'm getting this INFO message
the flowlist was originally designed only to allow one alternate unit. It will be an enhancement if we allow multiple but they have to be associated with a single flow, so the format of the alt units would likely have to change - perhaps to a list. In the meantime, only one alt unit will be kept |
Here is a nice helpful post for dealing with lists within pd dataframes if we go that route |
I confirmed that the second test |
Yes a list might be a better way to go ultimately. Right now the flow list parquet only can handle a single alternate unit. But when the list is generated in JSON the additional alternate units get re-added. That logger line may be better as a debug than an info given the potential confusion it might cause, as flows aren't really getting removed. |
-Refactoring for building mapping files to support distinct mappings for flows and contexts
-Add a separate folder for mapping input files to separate from flow list input files
-Mapping for ImpactWorld+ (LCIAfmt: PR 43)
-Refactor to consolidate code with new functions: add_uuid_to_mapping, add_conversion_to_mapping
-New flows to support USDA_CUS, and addition to this mapping file
-Expanded biological secondary contexts
-New tests for duplicate flows and contexts across classes
Note: changes to some mapping files (NEI, TRI, ReCiPe) primarily reflect reordering following generation by script