brightway-lca / brightway-book Goto Github PK
View Code? Open in Web Editor NEW📖🌿 Interactive jupyter-book Documentation for Brightway
Home Page: https://learn.brightway.dev
License: BSD 3-Clause "New" or "Revised" License
📖🌿 Interactive jupyter-book Documentation for Brightway
Home Page: https://learn.brightway.dev
License: BSD 3-Clause "New" or "Revised" License
Dear Brightway community,
I am currently investigating the feasibility of importing processes created in SimaPro directly into Brightway. While I have successfully managed to achieve this by manually creating Excel files containing the necessary information required by Brightway (e.g., name, reference product, location), I am curious to explore if there exists an automated method for this task.
Specifically, I am wondering if there is a function or tool within Brightway that facilitates the direct import of processes written in SP and exported in Ecospold v1 format. Despite attempting to follow the same procedure employed for importing the ecoinvent database, I have encountered difficulties in replicating the process.
I would appreciate any guidance or assistance someone could provide in this, I guess you might have encounter the same problems.
Thank you very much!
NameError Traceback (most recent call last)
Cell In[53], line 2
1 #One way of manually creating a database:
----> 2 db1 = bw.Database('3D')
3 db1.register()
4 db1.write({('3D', 'Printer'):{
5 'name': 'Printer',
6 'exchanges': [],
(...)
9 'categories': ('in the', 'universe')
10 }})
NameError: name 'bw' is not defined
Souldn't ot be db1 = bd.Database('3D') ?
Compare the relevant issue in the jupyter-book
repo:
There are currently 3 different documentation websites (with 3 different logos!):
Notebooks from Brightway repos (https://github.com/brightway-lca/) can be used. If notebooks from other authors are included in this repo, the respective licenses need to be checked.
...this would allow to use the rudimentary metrics functionality (page visits, etc.).
Cloning into 'C:\Users\treyer_k\Documents\GitHub\brightway-training'...
remote: Enumerating objects: 455, done.
remote: Counting objects: 100% (455/455), done.
remote: Compressing objects: 100% (209/209), done.
remote: Total 455 (delta 167), reused 403 (delta 125), pack-reused 0
Receiving objects: 100% (455/455), 2.53 MiB | 4.99 MiB/s, done.
Resolving deltas: 100% (167/167), done.
error: invalid path 'aux/favicon.png'
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
34d2de3 added draft of curated list of Brightway training notebooks originally created by @KarinTreyer et al. during the 2022 Brightcon Hackathon on Documentation.
Investigate the use of JupyterLite with either the Pyodide or the XEUS-Python kernel for use with the Jupyter Book site training.brightway.dev.
thebe
Currently, the third-party package ghp-import
is used to automatically build the repository with GitHub Pages. It would be preferrable to use GitHub actions, as per the new documentation by the JupyterBooks team.
The interactive code execution on binder.org servers enabled by the Thebe service is currently timing out. This is likely related to the environment set up in jupyter-book-binder-environment.
Using M1 Mac causing this error message following the "BW25 for Beginners" Guide...
Traceback (most recent call last):
File "/Users/nico/anaconda3/envs/bw_23sep/lib/python3.11/site-packages/matrix_utils/utils.py", line 52, in safe_concatenate_indices
return np.hstack(arrays)
^^^^^^^^^^^^^^^^^
File "/Users/nico/anaconda3/envs/bw_23sep/lib/python3.11/site-packages/numpy/core/shape_base.py", line 359, in hstack
return _nx.concatenate(arrs, 1, dtype=dtype, casting=casting)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: need at least one array to concatenate
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/nico/Library/CloudStorage/OneDrive-UniversitätGraz/Optimization Tool/Brightway Course/3 - Inventory data from spreadsheets.py", line 113, in <module>
lca.lcia()
File "/Users/nico/anaconda3/envs/bw_23sep/lib/python3.11/site-packages/bw2calc/lca.py", line 393, in lcia
self.load_lcia_data()
File "/Users/nico/anaconda3/envs/bw_23sep/lib/python3.11/site-packages/bw2calc/lca.py", line 261, in load_lcia_data
self.characterization_mm = mu.MappedMatrix(
^^^^^^^^^^^^^^^^
File "/Users/nico/anaconda3/envs/bw_23sep/lib/python3.11/site-packages/matrix_utils/mapped_matrix.py", line 114, in __init__
row_indices = safe_concatenate_indices(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nico/anaconda3/envs/bw_23sep/lib/python3.11/site-packages/matrix_utils/utils.py", line 57, in safe_concatenate_indices
raise AllArraysEmpty
matrix_utils.errors.AllArraysEmpty
Run actions/jekyll-build-pages@v1
/usr/bin/docker run --name ghcrioactionsjekyllbuildpagesv104_cd8618 --label [9](https://github.com/michaelweinold/jb-brightway-documentation/runs/7922591821?check_suite_focus=true#step:4:10)4859b --workdir /github/workspace --rm -e INPUT_SOURCE -e INPUT_DESTINATION -e INPUT_FUTURE -e INPUT_BUILD_REVISION -e INPUT_VERBOSE -e INPUT_TOKEN -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e GITHUB_STEP_SUMMARY -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e ACTIONS_ID_TOKEN_REQUEST_URL -e ACTIONS_ID_TOKEN_REQUEST_TOKEN -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/jb-brightway-documentation/jb-brightway-documentation":"/github/workspace" ghcr.io/actions/jekyll-build-pages:v1.0.4
Configuration file: none
Logging at level: debug
GitHub Pages: github-pages v227
GitHub Pages: jekyll v3.9.2
Theme: jekyll-theme-primer
Theme source: /usr/local/bundle/gems/jekyll-theme-primer-0.6.0
Requiring: jekyll-github-metadata
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
Conversion error: Jekyll::Converters::Scss encountered an error while converting 'assets/css/style.scss':
No such file or directory @ dir_chdir - /github/workspace/docs
/usr/local/bundle/gems/jekyll-sass-converter-1.5.2/lib/jekyll/converters/scss.rb:86:in `chdir': No such file or directory @ dir_chdir - /github/workspace/docs (Errno::ENOENT)
Compare also discussion here.
Check out their homepage, their collaborative coWASM tool (including their demo). The project was recently featured on HackerNews.
Currently, the text sections in the bw25_for_beginners.ipynb
are still written in a weird mix of html and markdown (eg.):
# Introductory note
<a id='section0'></a>
This means we can't use any of the nice functionality that JupyterBook offers.
Thank you for this precious Online Book.
In section 9 of BW25 for Beginners, I have issues running the code I copy below.
I think the problem is that in "brightway2" package there is the attribute "MonteCarloLCA", but I cannot find this attribute in any of the brightway 2.5 packages (bw2data,bw2io,bw2calc,bw2analyzer).
Since I do not want to install brightway2 in the same environment in which I have installed brightway 2.5 (that as I have understood is a good choice, but I am new into brightway so I might be wrong) I was wondering if the attribute MonteCarloLCA is already somewhere also in brightway 2.5 code and I don't find it.
Thank you very much
Giulia
CODE:
#MC simulation with 10 iterations for our banana production and the IPCC GWP100a method
mc = bw.MonteCarloLCA({banana_CO:1}, ('IPCC 2013', 'climate change', 'GWP 100a'))
scores = [next(mc) for _ in range(10)]
scores
Part of the existing notebooks still import packages using as "lazy" import statement
from brightway2 import *
which should be avoided as per PEP690.
NameError Traceback (most recent call last)
Cell In[52], line 2
1 #Another way of manually creating a database is to have the data in a separate dictionary and then write it into an instantiated database:
----> 2 db2 = Database("example")
3 example_data = {
4 ("example", "A"): {
5 "name": "A",
(...)
21 }
22 }
24 db2.write(example_data)
NameError: name 'Database' is not defined
There is a section of the book for bw25 where we show how to import EI db using the ecospold single output importer, directly from ecoinvent downloaded files.
Illustrate also how to import ecoinvent using the ecoinvent_interface package.
...as simple as adding to .gitignore
:
_build/**
?
binder
thebe-lite
none found
In the collected BW2 tutorials, all notebooks either completely skip on the very first first steps of installing python, creating environments and installing packages, or they explain it in a way that is not appropriate for a first-time coder. Often, the reader is referred to external sources, but these are often a bit too generic and their broadness can be overwhelming ("...but what do I need?"). To make the training also accessible to first-time coders, it would be desirable to include clear instructions that also connect to requirements in subsequent notebooks (i.e. instructions to connect to relevant channels, installing required packages etc.).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.