brightway-lca / brightway2-calc

The calculation engine for the Brightway2 life cycle assessment framework.
BSD 3-Clause "New" or "Revised" License
12 stars 15 forks source link

Test in vector monte carlo assumes self.sample exists #12

Closed aleksandra-kim closed 8 years ago

aleksandra-kim commented 8 years ago

Original report by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).


If a sample is never defined, but only pre-computed vectors are passed in, then comparing to self.sample will fail.

So, have to choose between:

  1. Drawing a sample when self.rng is constructed on line 46, or
  2. Comparing to length of array used to populate RNG, or
  3. Doing a different comparison completely, i.e. 1-dimensional and fits into the self.positions.

Not sure which approach is best.

aleksandra-kim commented 8 years ago

Original comment by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).


Fixes #12. Don't test against .sample because it might not exist