This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dbcalc; | |
import java.util.ArrayList; | |
import java.util.Comparator; | |
import java.util.List; | |
import org.openlca.core.database.Derby; | |
import org.openlca.core.database.NativeSql; | |
import org.openlca.core.model.Actor; | |
import org.openlca.core.model.Category; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dbcalc; | |
import static java.lang.System.out; | |
import java.util.function.Consumer; | |
import java.util.stream.Collectors; | |
import org.openlca.core.DataDir; | |
import org.openlca.core.database.IDatabase; | |
import org.openlca.core.database.ImpactCategoryDao; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dqi; | |
import java.util.Random; | |
import java.util.concurrent.atomic.AtomicInteger; | |
import java.util.function.Supplier; | |
import org.openlca.core.database.NativeSql; | |
import org.openlca.core.database.derby.DerbyDatabase; | |
public class Main { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from org.openlca.core.results import FullResult, Sankey | |
# load the product system with the given ID | |
system = db.get( | |
ProductSystem, | |
'f91f539b-2686-4224-893b-5d0993b06c39') | |
# calculate the result of that system | |
result = FullResult.of(db, system) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mass = db.forName(FlowProperty, 'Mass') | |
e = db.insert(Flow.elementary('e', mass)) | |
pp = db.insert(Flow.product('p1', mass)) | |
p = Process.of('p1', pp) | |
p.output(e, 1) | |
db.insert(p) | |
for i in range(2, 11): | |
qq = db.insert(Flow.product('p%i' % i, mass)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script can be executed in the openLCA Python editor. | |
# An activated databases is required. Also, you need to | |
# change the path to the CSV file below. | |
# | |
# This script should work with openLCA 1.10.x. In openLCA 2.0 | |
# LCIA parameters are bound to impact categories and not to | |
# LCIA methods. | |
import csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* I add this to html files generated with pandoc. | |
*/ | |
html { | |
font-size: 100%; | |
overflow-y: scroll; | |
-webkit-text-size-adjust: 100%; | |
-ms-text-size-adjust: 100%; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script fixes wrong name suffixes of LCI result processes in openLCA: in | |
# some databases, the name of such processes ends with `, U` but should end | |
# with `, S` to indicate that this is an LCI result/system process. This script | |
# can be executed directly in openLCA: Window > Developer tools > Python. After | |
# the script finished, you need to close and reopen the database to see the | |
# updated names in the navigation. | |
def main(): | |
global db, log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"bytes" | |
"strings" | |
"unicode/utf8" | |
) | |
// SplitLines takes the given text and splits it into multiple lines by trying | |
// to applying the maxRunes parameter as a margin. | |
func SplitLines(text string, maxRunes int) []string { | |
var lines []string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a command line program that replaces files in an ILCD package with | |
// the files from a patch package. It takes the files `raw.zip` and `patch.zip` | |
// as input and creates a package `out.zip` where the data sets from the | |
// `raw.zip` package that are also in the `patch.zip` package are replaced by | |
// the version in the `patch.zip` package. | |
package main | |
import ( | |
"fmt" |
NewerOlder