Comments (2)
The simple fix above has tests failing in bw.LCA.
from presamples.
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 vialca.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 theindexer.count
is 1 when loaded. In the suggestion above, theindexer.count
is reset to 0, so the first call ofupdate_matrices
actually moves theindexer.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)
- Missing args to `save_presamples` in ` ParameterizedBrightwayModel`
- campaigns.db prevents brightway project directory from being deleted HOT 2
- No good way to get PresamplePackages in correct order from Campaign HOT 2
- brightway2 silently not supporting presamples if presamples module imported first HOT 1
- One-off issue in MonteCarloLCA with presamples HOT 1
- Presamples CF package fails if biosphere flows not used in database HOT 1
- Centralize aggregating functions
- separate core presamples from use with brightway2
- Losses override production amounts HOT 1
- Poor error when passing faulty indices in matrix data
- Missing consolidated parameter samples HOT 1
- Asymmetry in matrix_data and parameter_metadata in PackagesDataLoader not necessay
- Listing ancestors in campaign without ancestors raises StopIteration HOT 4
- example jupyter notebook and examples pages give 404 error HOT 1
- errors in quickstart HOT 2
- Citing Presamples HOT 1
- Easier link between PBM and LCA HOT 1
- Decoding presample json file fails HOT 3
- Version tags
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from presamples.