bw2calc.utils#

Module Contents#

Functions#

extract_uncertainty_fields(array)

Extract the core set of fields needed for uncertainty analysis from a parameter array

get_seed([seed])

Get valid Numpy random seed value

load_arrays(objs)

Load the numpy arrays from list of objects objs.

load_calculation_package(fp)

Load a calculation package created by save_calculation_package.

md5(filepath[, blocksize])

Generate MD5 hash for file at filepath

wrap_functional_unit(dct)

Transform functional units for effective logging.

Attributes#

MAX_INT_32

MAX_SIGNED_INT_32

global_index

bw2calc.utils.extract_uncertainty_fields(array)[source]#

Extract the core set of fields needed for uncertainty analysis from a parameter array

bw2calc.utils.get_seed(seed=None)[source]#

Get valid Numpy random seed value

bw2calc.utils.load_arrays(objs)[source]#

Load the numpy arrays from list of objects objs.

Currently accepts str filepaths, BytesIO,

numpy.ndarray arrays. Creates copies of objects

bw2calc.utils.load_calculation_package(fp)[source]#

Load a calculation package created by save_calculation_package.

NumPy arrays are saved to a temporary directory, and file paths are adjusted.

fp is the absolute file path of a calculation package file.

Returns a dictionary suitable for passing to an LCA object, e.g. LCA(**load_calculation_package(fp)).

bw2calc.utils.md5(filepath, blocksize=65536)[source]#

Generate MD5 hash for file at filepath

bw2calc.utils.wrap_functional_unit(dct)[source]#

Transform functional units for effective logging.

Turns Activity objects into their keys.

bw2calc.utils.MAX_INT_32 = 4294967295[source]#
bw2calc.utils.MAX_SIGNED_INT_32 = 2147483647[source]#
bw2calc.utils.global_index[source]#