Skip to content

Tell two flows of a target apart by the factors of the method it holds - #935

Merged
ccomb merged 2 commits into
mainfrom
renaming-tie-by-factors
Dec 3, 2026
Merged

ccomb merged 2 commits into
mainfrom
renaming-tie-by-factors

Conversation

@ccomb

@ccomb ccomb commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

A flow list can hold the same substance twice, under one name at one place, copied from two sources that write its CAS number differently. Renaming refused to choose, so the exported flow kept a name the reading tool characterises nowhere, and scored zero there.

When the target also holds a method's factors (a method collection, or an openLCA package with impact categories), the renaming now:

  • looks only at the candidates the source's name reached, else those a synonym pair reached; never at candidates a CAS number alone reached, since one CAS number can join a family (fossil and biogenic carbon dioxide);
  • takes the one the method characterises, if only one is;
  • when several are and carry the same factors (same method, place and unit), takes the source's own identifier, else its exact spelling, else the smallest identifier. That choice changes no score the method gives.

A zero written for everywhere counts as no factor; a zero written for a place counts, since it replaces the factor for everywhere there. Factors that differ, or none at all, still leave the flow its name. The renaming report says characterised or same factors in rules, and names the other candidates in candidates. A target without factors behaves as before.

An openLCA package used as a flow list lends the factors of the impact categories it holds. The documentation advises keeping only the method the reading tool scores with, since other methods score such twins differently.

Measured on a SimaPro database of about 6 000 elementary flows, exported for openLCA under its LCIA methods package 2.8.2 reduced to « EF 3.1 Method (adapted) »:

  • flows refused for several candidates: 772 before, 272 after (389 settled by equal factors, 108 by a single characterised one, none reached by CAS alone);
  • elementary exchanges a factor of that method reaches: 62.3 % before, 73.8 % after;
  • export time +8 %; the export adds about 80 MB over the loaded database. The same list without categories gives the same export as before.

How to try it: add the method's lcia_methods/ and lcia_categories/ folders to an openLCA flow-list package named in [[flow-lists]], export a database with flowsLike naming that list, and read the rules and candidates columns of FLOW-RENAMING.csv.

ccomb added 2 commits December 2, 2026 22:43
A flow list can hold two flows under one name at one place, copied from two
sources with CAS numbers written differently. Renaming refused both, so the
exported flow kept a name the reading tool characterises nowhere. When the
target also holds the factors of a method (a method collection, or an openLCA
package with impact categories), the flow now takes the one the method
characterises, if only one is, or, when all those it characterises carry the
same factors per method, place and unit, the source's own identifier or the
smallest: the choice changes no score that method gives. A candidate bearing
the source's name still outweighs the others. The renaming report says how the
target was chosen and names the flows passed over.
A CAS number can join a family of substances, fossil and biogenic carbon
dioxide, whose factors tell the members apart, not which one the source is.
The factor tie-break now looks only at candidates the source's name reached,
else those a synonym pair reached. A zero written for a place is kept as a
factor, since there it replaces the factor for everywhere. The report names the
other candidates for a characterised choice too, and the factor key is a
record.
@ccomb ccomb added the agent-reviewed pr-cycle ran label Dec 2, 2026
@ccomb
ccomb merged commit 4ffd057 into main Dec 3, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-reviewed pr-cycle ran

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant