Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bwutils tweaks #236

Merged
merged 7 commits into from
May 17, 2019
Merged

Bwutils tweaks #236

merged 7 commits into from
May 17, 2019

Conversation

dgdekoning
Copy link
Contributor

Add numpy-style docstrings to some of the classes in the bwutils directory which hopefully clarify the functionality.

In addition, create new methods in the MetaDataStore class to encapsulate repeated code.

Finally, altered the inventory_df method, which used the reserved type keyword to use inventory_type instead. (which lead to small edits in code using that function).

@coveralls
Copy link

coveralls commented May 14, 2019

Coverage Status

Coverage increased (+0.09%) to 39.82% when pulling ef3f907 on dgdekoning:bwutils-tweaks into 347aade on LCA-ActivityBrowser:master.


Class adapted from bw2calc.multi_lca.MultiLCA to include also CONTRIBUTION ANALYSIS.
Attributes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is still quite incomplete. Best introduce also the different vectors and matrices that are used for storing the LCA results (e.g. process contributions); and also the indexing dictionaries

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have just added all of the attributes of the class. It kind of feels like the comments in the init method are superfluous now.

self.technosphere_flows = dict()
# Life cycle inventory (biosphere flows) by functional unit
self.inventory = dict()
# Inventory (biosphere flows) by activity (e.g. 2000x15000) and functional unit.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for a specific functional unit and LCIA method

"""Contribution Analysis built on top of the Multi-LCA class."""
"""Contribution Analysis built on top of the Multi-LCA class.

This class requires instantiated MLCA and MetaDataFrame objects.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the right name now MetaDataFrame or MetaDataStore ? I have seen both now :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, you're right, have been using them interchangeably, will correct to MetaDataStore.


This class does not subclass the `LCA` class, and performs all calculations upon instantiation.
Class adapted from bw2calc.multi_lca.MultiLCA to include also
CONTRIBUTION ANALYSIS.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps write something like this "process and elementary flow contributions and other LCA results (see attributes below)"
came across this as we also implement our own contribution analysis class...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

This class is adapted from bw2calc.multi_lca.MultiLCA and includes a
number of additional attributes required to perform process- and
elementary flow contribution analysis (see class Contributions below).

Copy link
Member

@bsteubing bsteubing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with small comments. Very nice to see all of this much better documentation!!

@dgdekoning dgdekoning merged commit 36472ac into LCA-ActivityBrowser:master May 17, 2019
@dgdekoning dgdekoning deleted the bwutils-tweaks branch May 21, 2019 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants