Giter VIP home page Giter VIP logo

brightway2-ui's Introduction

Brightway2-UI

This is now the official repo for Brightway2-UI:

a web and command line user interface, part of the Brightway2 LCA framework https://brightway.dev.

The original source code was hosted on Bitbucket: https://bitbucket.org/tomas_navarrete/brightway2-ui.

Compatibility with Brightway2X

This repository is used to produce 2 packages: one compatible with brightway25 (bw25ui), and one compatible with brightway2 (bw2ui).

Installation

Both, conda / mamba and wheels from pypi.org are available. The package names are different for Brightway25 and Brightway2, but the main executable script is still the same.

Note

The requirements here are abstract, but they are different for brightway25 and brightway2. For brightway25, bw2calc must be >= 2.0.dev10 and bw2analyzer >= 0.11 for brightway2 bw2calc must be < 2 and bw2analyzer >=0.10

Brightway25

To install a conda / mamba package compatible with brightway25:

mamba install -c tomas_navarrete bw25ui

There is also a pip wheel that you can install with:

pip install bw25ui

Brightway2

To install a package compatible with brightway2:

mamba install -c tomas_navarrete bw2ui

There is also a pip wheel that you can install with:

pip install bw2ui

Roadmap

  • As long as retro-compatibility is possible between Brightway25 and Brightway2, the code base will remain identical.
  • Packages will be published with the same version tags, but different names.
  • New features will be primarily implemented to work with Brightway25, and if they are compatible with Brightway2 they will be part of the same code base.
  • When the implementation of new features in a single code base for Brightway2 and Brightway25 becomes imposible, a new branch called legacy will be created to track the code compatible with Brightway2. The same will be done in the long term once Brightway3 is released.

Short term

The current code base is identical for both packages (bw25ui and bw2ui). The current main branch will be kept as the branch for development, with identical code bases for both packages until brightway25 public API breaks the compatibility.

Mid term

Once Brightway3 starts to exist, the main branch will be dedicated to it, with a bw3ui package.

brightway2-ui's People

Contributors

cmutel avatar lowks avatar michaelweinold avatar renovate[bot] avatar tngtudor avatar

Watchers

 avatar  avatar

Forkers

tngtudor

brightway2-ui's Issues

list parameters in TUI

Original report by Anonymous.


Current

the TUI cannot show project, database or activity parameters

Expected

We have a new command "lpam" that can show parameters. with an option -g {proj} -g {db} -g {xx} to show parameters of project level, of database level or from a given group. if the lpam command is executed when an activity is selectec, we show parameters of the activity

top processes & emissions commands are broken

Current

when invoking ta command after doing an lcia (with G command) we get:

  File "/home/duende/miniforge3/envs/bw2ui-dev/bin/bw2-browser", line 33, in <module>
    sys.exit(load_entry_point('bw2ui', 'console_scripts', 'bw2-browser')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/duende/workspaces/brightway2-ui/bw2ui/bin/bw2_browser.py", line 1471, in main
    activitybrowser.cmdloop()
  File "/home/duende/miniforge3/envs/bw2ui-dev/lib/python3.11/cmd.py", line 138, in cmdloop
    stop = self.onecmd(line)
           ^^^^^^^^^^^^^^^^^
  File "/home/duende/miniforge3/envs/bw2ui-dev/lib/python3.11/cmd.py", line 217, in onecmd
    return func(arg)
           ^^^^^^^^^
  File "/home/duende/workspaces/brightway2-ui/bw2ui/bin/bw2_browser.py", line 1222, in do_ta
    top_a = lca.top_activities()
            ^^^^^^^^^^^^^^^^^^
AttributeError: 'LCA' object has no attribute 'top_activities'

Expected

The command works providing the list of top activities and top emissions

add search activities by reference product

Current

search can look up for activities by name and location

Expected

Allow the user to search by reference product. For example:

s -rp {electricity, high voltage}

CI/CD actions fail when publishing packages

Current

When the package building actions to publish conda packages are called one after the other (one for bw25ui and the other for bw2ui) the second called action fails with "re-login" issues:

You are not logged in
Using Anaconda API: https://api.anaconda.org/
Warning: RNING] It appears you are already logged in from host fv-az1245-974
Warning:  Logging in again will remove the previous token. (This could cause troubles with virtual machines with the same hostname)
Warning:  Otherwise you can login again and specify a different hostname with "--hostname"
Error:  EOF when reading a line
Would you like to continue [Y|n]: 
Error: Process completed with exit code 1.

Expected

Both actions work.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/conda-package-deploy.yaml
  • actions/checkout v4
  • conda-incubator/setup-miniconda v3
.github/workflows/python-package-deploy-bw25.yml
  • actions/checkout v4
  • actions/setup-python v5
.github/workflows/python-package-deploy.yml
  • actions/checkout v4
  • actions/setup-python v5
html
bw2ui/web/templates/base.html
  • datatables 1.10.21
  • datatables 1.10.21
bw2ui/web/templates/search.html
pep621
pyproject.toml
  • docs/furo ==2024.1.29
  • docs/myst_parser ==2.0.0
  • docs/sphinx ==7.2.6
  • setuptools >=68.0

  • Check this box to trigger a request for Renovate to run again on this repository

new feature: allow to search by category

Original report by Tomas Navarrete Gutierrez (Bitbucket: tomas_navarrete, ).


Current

Search allows to filter results by location with the “s -loc {XX}” command

Expected

Search allows to filter results by category with the “s -cat {cat::subcat::subsubcat}” command, where subcat and subsubcat are optional

deploy packages using github actions

Current

After the migration from bb to github, we lost the CI/CD pipelines.

Expected

Use github actions to build the packages and deploy them.

implement a contribution anayslis feature

Current

only top emissions/procs are available

Expected

use bw2analyzer print_recursive_x functions to provide a CA of a given LCIA (after running the G command for example).

Update README on how to install from pypi

Current

Currently, only the produced conda packages are documented on how to install them.

Expected

users must be warned in the readme that the pypi packages are built with abstract dependencies ("bw2calc", "bw2analyzer") and that it's their responsability to make sure they are present in the system, with versions compatible between them and with either brightway25 or brightway2.

Note

The requirements here are abstract, but they are different for brightway25 and brightway2.
For brightway25, bw2calc must be >= 2.0.dev10 and bw2analyzer >= 0.11
for brightway2 bw2calc must be < 2 and bw2analyzer >=0.10

  • add the warning to the readme
  • add the install instructions to the readme

show me the code

Original report by Tomas Navarrete Gutierrez (Bitbucket: tomas_navarrete, ).


Add a feature to provide the user a sample of code to reproduce the latest command.

  • G - show code to select project, methods, obtain the activity and create LCA object + call to obtain score
  • u - show code to print upstream exchanges

searching when no database is selected in a project crashes bw2-browser

Original report by Anonymous.


I you start bw2-browser, select a project and immediately "search" for an activity, the browser crashes with:

Projects

[0]: default
[1]: universe

Page 0 of 1. Use n (next page) and p (previous page) to navigate.

>> 1

Databases

[0]: biosphere3 (4321 activities/flows)
[1]: universe-cutoff (42 activities/flows)

Page 0 of 1. Use n (next page) and p (previous page) to navigate.

ecoinvent36 >> s meaning of life
Traceback (most recent call last):
  File "/opt/conda/bin/bw2-browser", line 10, in <module>
    sys.exit(main())
  File "/opt/conda/lib/python3.9/site-packages/bw2ui/bin/bw2_browser.py", line 1337, in main
    activitybrowser.cmdloop()
  File "/opt/conda/lib/python3.9/cmd.py", line 138, in cmdloop
    stop = self.onecmd(line)
  File "/opt/conda/lib/python3.9/cmd.py", line 217, in onecmd
    return func(arg)
  File "/opt/conda/lib/python3.9/site-packages/bw2ui/bin/bw2_browser.py", line 1024, in do_s
    results = Database(self.database).search(needle, limit=self.search_limit)
  File "/opt/conda/lib/python3.9/site-packages/bw2data/backends/peewee/database.py", line 530, in search
    with Searcher(self.filename) as s:
  File "/opt/conda/lib/python3.9/site-packages/bw2data/backends/base.py", line 122, in filename
    return safe_filename(self.name)
  File "/opt/conda/lib/python3.9/site-packages/bw2data/filesystem.py", line 32, in safe_filename
    return safe + u"." + hashlib.md5(string).hexdigest()
TypeError: object supporting the buffer API required

a command is too slow

Original report by Tomas Navarrete Gutierrez (Bitbucket: tomas_navarrete, ).


Current

the a command looks first for the key in the Database(x).load, and if the key is there, it loads the activity. This implies a call to load which for large database (I’m looking at you!) can take too long.

Expected

Faster load of an activity by using get_activity

[feature] display pedigree data on exchanges

Current

When using the u command to visualize the exchanges, we only see the "inputs" and their amounts

Expected

If there is pedigree information on the exchanges, display it with a new command (uee?)

Display the classifications instead of the categories

Original report by Tomas Navarrete Gutierrez (Bitbucket: tomas_navarrete, ).


current simple view of an activity

market for waste polyethylene/polypropylene product                                                                                                                                                                         [15/1972]
                                                                                                                                                                                                                                     
    Database: stuff
    ID: fe15f74bfcc
    Product: waste fantastic product                                                                                                                                                                                
    Production amount: -1 kilogram                                                                                                                                                                                                   
                                                                                                                                                                                                                                     
    Location: RoW                                                                                                                                                                                                                    
    Categories:                                                                                                                                                                                                                      
    Technosphere inputs: 1                                                                                                                                                                                                           
    Biosphere flows: 0                                                                                                                                                                                                               
    Reference flow used by: 65

There are empty categories, because now they are called classifications (ISIC, Ecopsold, etc.)

add search by classification feature

Current

we can only search by "name" (with the possibility to search by location)

Expected

allow the user to search by given classification:

s -c {cpc} -cv {43913} -loc {row} for example. the "location" part is not priority

Explore new visualization libraries

Original report by Tomas Navarrete Gutierrez (Bitbucket: tomas_navarrete, ).


This comes from a forgotten issue @ the original repo:

Here are some examples:

  • https://vincent.readthedocs.org/en/latest/
    
  • https://plot.ly/~alex/76/
    
  • http://stanford.edu/~mwaskom/software/seaborn/index.html
    
  • http://marvl.infotech.monash.edu/webcola/
    
  • http://js.cytoscape.org/#layouts/cola
    

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.