PascalLesage / presamples

Package to write, load, manage and verify numerical arrays, called presamples.
BSD 3-Clause "New" or "Revised" License
14 stars 11 forks source link

MatrixPresample with technosphere and biosphere not working #28

Closed PascalLesage closed 6 years ago

PascalLesage commented 6 years ago

The following MatrixPresample was created for a coal power plant with a technosphere exchange combustion_coal_input and an emission combustion_CO2_emissions :

combustion_coal_sample = combustion_coal_input.random_sample(1000).reshape(1, -1)
combustion_CO2_sample = combustion_coal_sample * CO2_per_kg_coal

combustion_corr_matrix_presample_A = (
    combustion_coal_sample,
    [(combustion_coal_input['input'], combustion_coal_input['output'], 'technosphere')],
    'technosphere'
    )

combustion_corr_matrix_presample_B = (
    combustion_CO2_sample,
    [(combustion_CO2_emissions['input'], combustion_CO2_emissions['output'], 'biosphere')],
    'biosphere'
    )

combustion_corr_id, combustion_corr_fp = create_presamples_package(
    matrix_presamples=[
        combustion_corr_matrix_presample_A,
        combustion_corr_matrix_presample_B
    ]
)

combustion_MC_correlated = MonteCarloLCA(
    {combustion:1},
    method=('IPCC 2013', 'climate change', 'GWP 100a'), 
    presamples=[combustion_corr_fp]
    )

The matrix elements for these two exchanges, returned by next(combustion_MC_correlated were not correlated as expected.

PascalLesage commented 6 years ago

Fixed.