Presamples is used to write, load, manage and verify presample arrays.
Presample arrays refer to arrays of values that specific parameters or matrix elements can take on. The presamples package allows these arrays to be generated ahead of their use in a particular model. This is useful if:
- Generating these values is computationally expensive and there is no need to recalculate them with each model run;
- We want to reuse the same values every time a model is solved.
Presamples was initially built specifically for parameters and matrix elements used in life cycle assessment (LCA), and hence has many methods specifically geared at making the integration of presamples in LCA models easy. However, it can be used in any other type of model.
Presample’s source code is hosted on github.
- The objectives of presamples
- Simple example: Fertilizer inputs to cereal production in Canada
- Creating presample packages for data inputs
- Direct interface to presamples package
- Loading packages for use one column at a time
- Storing a model’s output as a presample package
- Creating presample packages with seeded indexers
- Creating presample packages with sequential indexers
- Using presamples to override input values
- Storing a presample resource
Campaignsto manage sets of presample packages
- Using presamples with brightway2
- LCA matrices and the case for using presamples
- Creating and using presample packages with matrices in Brightway2
- Example 1 - Static scenario analysis: changing supplier by modifying the technoshere matrix
- Example 2: Using presamples for time series
- Example 3 - Modifying emission data by modifying the biosphere matrix
- Example 4 - Balancing sampled exchange values
- Other uses to document
- Technical reference