Giter Site home page Giter Site logo

Comments (2)

PascalLesage avatar PascalLesage commented on August 16, 2024

The simple fix above has tests failing in bw.LCA.

from presamples.

PascalLesage avatar PascalLesage commented on August 16, 2024

Tests in LCA show that the expected behaviour is not what would be allowed by the change described above.

Indeed, the expected behaviour is that:

  • an LCA object whose presamples have not had their matrices updated via lca.presamples.update_matrices will use the values in the first column (this is also how things work with the change above). This is good, because LCA will often use presamples with a single column (scenario)
  • the first call of update_matrices moves the index from 0 to 1. This is because the  indexer.count is 1 when loaded. In the suggestion above, the  indexer.count is reset to 0, so the first call of update_matrices actually moves the  indexer.count to 1 but the index itself remains at 0.

So the expected usage is sequentially seeded presample packages in LCA would be something like this:

>>> lca = bw.LCA({some_act:1}, presamples=[pp_dirpath])
>>> print("iteration\tindex")
>>> for i in range(5):
...     if i != 0:
...         lca.presamples.update_matrices()
...     lca.lci()
...     print(i, "\t", lca.presamples.matrix_indexer[0].index)

iteration	index
0 		 0
1 		 1
2 		 2
3 		 3
4 		 4

The if clause is a bit annoying, so we need to decide what approach is better:

  • Weirdness because the index remains at 0 after calling update_indices for the first time (suggestion above); or
  • Only calling update_indices on runs beyond the first.

@cmutel any preference?

from presamples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.