Giter VIP home page Giter VIP logo

brightway-book's People

Contributors

jhuo2021 avatar karintreyer avatar lmeul avatar michaelweinold avatar mkvdhulst avatar nicolnt avatar shuyanxiong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

brightway-book's Issues

Importing in BW processes written in SP

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!

@cmutel

mistype in section #3?


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') ?

Cannot clone repo to github desktop

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 :/'

Error Message

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

Jekyll tries to build project, resulting in `Conversion error: Jekyll::Converters::Scss encountered an error while converting 'assets/css/style.scss'`

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.

MonteCarlo

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

traceback in #3


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

Missing dummy-level instructions for getting started with Python

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.).

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.