LCA-ActivityBrowser/activity-browser

Sankey not working properly

Closed this issue · 8 comments

Hi guys,
I have tried to use the sankey of AB version 2.2.2 but it is not working properly.
Whatever I run I see only the contribution of the functional unit (100%) as in the image below (which is the same LCA of the README

P.S: I am using it in Linux

screenshot from 2018-02-13 16 40 38

What ecoinvent system model and version do you use? I tried to reproduce it on linux with AB 2.2.2, but for me it works.
Just to make sure: Nothing happens when you click in the yellow area?

Hi Adrian,
No nothing happens if I click.
Have tried with several processes of both ei 2.2. and ei 3.2 cutoff but always the same.
Actually with a custom db I created myself the sankey is not not shown at all, it just keeps on loading without showing the graph.

For the latter problem I have discovered that also in this case the problem is due to the fact that reference product is not a mandatory field similarly to #98.

A dirty/quick patch as example on how to fix this is in this fork. But this is a problem that kind of always comes back. I think the best would be to directly deal with it in bwdata during the database registration and set the field 'reference product'=='name' when it does not exist.

Strangely, with the patch above the sankey for my custom database is shown and also correctly (see below) but problem 1 still remain.

screenshot from 2018-02-14 12 29 35

maybe of help to know that I am on linux mint 17.2 and following installed packages:

$ conda list
# packages in environment at /home/giuseppec/miniconda3/envs/param:
#
activity-browser          2.2.2                      py_1    haasad
alabaster                 0.7.10                   py36_1    conda-forge
appdirs                   1.4.3                      py_0    conda-forge
arrow                     0.10.0                     py_1    conda-forge
asn1crypto                0.22.0                   py36_0    conda-forge
asteval                   0.9.8                    py36_0    conda-forge
astunparse                1.5.0                    py36_0    conda-forge
babel                     2.5.1                    py36_0    conda-forge
backports                 1.0                      py36_1    conda-forge
backports.functools_lru_cache 1.4                      py36_1    conda-forge
beautifulsoup4            4.6.0            py36h49b8c8c_1  
bleach                    2.0.0                    py36_0    conda-forge
blinker                   1.4                      py36_0    conda-forge
brightway2                2.1.1                      py_1    cmutel
bw2analyzer               0.9.4                      py_0    cmutel
bw2calc                   1.6.2                      py_0    cmutel
bw2data                   3.0.rc1                    py_0    cmutel
bw2io                     0.6.RC3                    py_0    cmutel
bw2parameters             0.6.1.2                    py_3    cmutel
bw2speedups               2.2                       <pip>
ca-certificates           2017.11.5                     0    conda-forge
certifi                   2017.11.5                py36_0    conda-forge
cffi                      1.11.2                   py36_0    conda-forge
chardet                   3.0.4                    py36_0    conda-forge
click                     6.7                      py36_0    conda-forge
cryptography              2.0.3                    py36_0    conda-forge
cycler                    0.10.0                   py36_0    conda-forge
dbus                      1.10.22                       0    conda-forge
decorator                 4.1.2                    py36_0    conda-forge
docopt                    0.6.2                    py36_0    conda-forge
docutils                  0.14                     py36_0    conda-forge
eight                     0.3.3                      py_0    haasad
entrypoints               0.2.3                    py36_1    conda-forge
expat                     2.2.5                         0    conda-forge
fasteners                 0.14.1                   py36_2    conda-forge
flask                     0.12.2                   py36_0    conda-forge
fontconfig                2.11.1                        6  
freetype                  2.5.5                         2  
future                    0.16.0                   py36_0    conda-forge
gettext                   0.19.7                        1    conda-forge
glib                      2.55.0                        0    conda-forge
gmp                       6.1.2                         0    conda-forge
gst-plugins-base          1.8.0                         0    conda-forge
gstreamer                 1.8.0                         1    conda-forge
html5lib                  0.999999999              py36_0    conda-forge
icu                       58.2                          0    conda-forge
idna                      2.6                      py36_1    conda-forge
imagesize                 0.7.1                    py36_0    conda-forge
intel-openmp              2018.0.0             hc7b2577_8  
ipykernel                 4.6.1                    py36_0    conda-forge
ipython                   6.2.1                    py36_0    conda-forge
ipython_genutils          0.2.0                    py36_0    conda-forge
ipywidgets                7.0.5                    py36_0    conda-forge
itsdangerous              0.24                       py_2    conda-forge
jedi                      0.10.2                   py36_0    conda-forge
jinja2                    2.9.6                    py36_0    conda-forge
jpeg                      9b                            2    conda-forge
jsonschema                2.6.0                    py36_0    conda-forge
jupyter                   1.0.0                    py36_0    conda-forge
jupyter_client            5.1.0                    py36_0    conda-forge
jupyter_console           5.2.0                    py36_0    conda-forge
jupyter_core              4.4.0                      py_0    conda-forge
libffi                    3.2.1                         3    conda-forge
libgcc-ng                 7.2.0                h7cc24e2_2  
libgfortran-ng            7.2.0                h9f7466a_2  
libiconv                  1.15                          0    conda-forge
libpng                    1.6.34                        0    conda-forge
libsodium                 1.0.15                        1    conda-forge
libstdcxx-ng              7.2.0                h7a57d05_2  
libxcb                    1.12                          1    conda-forge
libxml2                   2.9.5                         2    conda-forge
libxslt                   1.1.32                        0    conda-forge
lxml                      4.1.1                    py36_0    conda-forge
markupsafe                1.0                      py36_0    conda-forge
matplotlib                2.0.2               np113py36_0  
mistune                   0.8                      py36_0    conda-forge
mkl                       2018.0.1             h19d6760_4  
mkl-service               1.1.2            py36h17a0993_4  
monotonic                 1.3                      py36_0    conda-forge
nbconvert                 5.3.1                      py_1    conda-forge
nbformat                  4.4.0                    py36_0    conda-forge
ncurses                   5.9                          10    conda-forge
nose                      1.3.7                    py36_2    conda-forge
notebook                  5.2.1                    py36_2    conda-forge
numexpr                   2.6.4            py36hc4a3f9a_0  
numpy                     1.13.3           py36ha12f23b_0  
oauthlib                  2.0.6                      py_0    conda-forge
openssl                   1.0.2m                        0    conda-forge
pandas                    0.21.0                   py36_0    conda-forge
pandoc                    2.0.0.1                       1    conda-forge
pandocfilters             1.4.1                    py36_0    conda-forge
patool                    1.12               pyh4da6e82_0    haasad
patsy                     0.4.1                    py36_0    conda-forge
pcre                      8.39                          0    conda-forge
peewee                    2.10.2                   py36_0    conda-forge
pexpect                   4.3.0                    py36_0    conda-forge
pickleshare               0.7.4                    py36_0    conda-forge
pip                       9.0.1                    py36_0    conda-forge
pkginfo                   1.4.1            py36h215d178_1  
prompt_toolkit            1.0.15                   py36_0    conda-forge
psutil                    5.4.0                    py36_0    conda-forge
ptyprocess                0.5.2                    py36_0    conda-forge
pycparser                 2.18                     py36_0    conda-forge
pygments                  2.2.0                    py36_0    conda-forge
pyjwt                     1.5.3                      py_0    conda-forge
pyopenssl                 17.2.0                   py36_0    conda-forge
pypardiso                 0.2.2                      py_0    haasad
pyparsing                 2.2.0                    py36_0    conda-forge
pyprind                   2.10.0                   py36_0    conda-forge
pyqt                      5.9.2            py36h7ca782d_0    haasad
pysocks                   1.6.7                    py36_0    conda-forge
python                    3.6.3                         1    conda-forge
python-dateutil           2.6.1                    py36_0    conda-forge
pytz                      2017.3                     py_2    conda-forge
pyzmq                     16.0.2                   py36_2    conda-forge
qt                        4.8.7                         3  
qtconsole                 4.3.1                    py36_0    conda-forge
readline                  6.2                           0    conda-forge
requests                  2.18.4                   py36_1    conda-forge
requests-oauthlib         0.8.0                    py36_1    conda-forge
requests-toolbelt         0.8.0                    py36_0    conda-forge
scipy                     1.0.0            py36hbf646e7_0  
seaborn                   0.8.1                    py36_0    conda-forge
setuptools                37.0.0                   py36_0    conda-forge
simplegeneric             0.8.1                    py36_0    conda-forge
sip                       4.19.6           py36h7b295a5_1    haasad
six                       1.11.0                   py36_1    conda-forge
snowballstemmer           1.2.1                    py36_0    conda-forge
sphinx                    1.6.5                    py36_0    conda-forge
sphinxcontrib-websupport  1.0.1                    py36_0    conda-forge
sqlite                    3.13.0                        1    conda-forge
stats-arrays              0.4.2                     <pip>
stats_arrays              0.4.2                      py_0    cmutel
statsmodels               0.8.0                    py36_0    conda-forge
terminado                 0.8                      py36_0    conda-forge
testpath                  0.3.1                    py36_0    conda-forge
tk                        8.5.19                        2    conda-forge
tornado                   4.5.2                    py36_0    conda-forge
tqdm                      4.19.4           py36ha5a5176_0  
traitlets                 4.3.2                    py36_0    conda-forge
twine                     1.9.1                    py36_2    conda-forge
typing                    3.6.2                    py36_0    conda-forge
unicodecsv                0.14.1                   py36_0    conda-forge
unidecode                 0.04.21                  py36_0    conda-forge
urllib3                   1.22                     py36_0    conda-forge
voluptuous                0.10.5                   py36_0    conda-forge
wcwidth                   0.1.7                    py36_0    conda-forge
webencodings              0.5                      py36_0    conda-forge
werkzeug                  0.12.2                     py_1    conda-forge
wheel                     0.30.0                     py_1    conda-forge
whoosh                    2.7.4                    py36_0    conda-forge
widgetsnbextension        3.0.8                    py36_0    conda-forge
wrapt                     1.10.11                  py36_0    conda-forge
xlrd                      1.0.0                    py36_1    conda-forge
xlsxwriter                1.0.2                      py_0    conda-forge
xorg-libxau               1.0.8                         3    conda-forge
xorg-libxdmcp             1.1.2                         3    conda-forge
xz                        5.2.3                         0    conda-forge
zeromq                    4.2.1                         1    conda-forge
zlib                      1.2.11                        0    conda-forge

Ok, missing reference product fails in Sankey, that makes sense, I only ever tested it with ecoinvent 3.2+ and never with custom databases.

I am however really confused why it doesn't work for cutoff 3.2. I think it's unlikely that linux mint or your conda environment is responsible for this, but could you maybe try the following things:

  • upload the environment file created by this command:
    conda env export -n param -f param_env.txt
    With this I can recreate your environment 1:1 and see if one of the dependencies could cause this
  • Check if there are any meaningful error messages either in the ActivityBrowser Debug window or in the terminal where you launched the ActivityBrowser
  • Create a new brightway project in the ActivityBrowser and import cutoff 3.2 with the import wizard
  • here the param_env.txt.
  • No errors, except from the QApplication: invalid style override passed, ignoring it. I have always got when AB is launched (but this should not be relevant in this case).
  • It works! I have tried with several old projects with ei 3.2 already installed and all gave me the same issue. I also created new project and installed ei directly with bw2 and it works fine. My old projects were created with older bw2io versions and guess this is the problem.

Thank you for taking the time test all of this. It's probably too much effort to try and make the AB deal with databases that were created with older brightway versions, since we still don't know exactly what caused this. But I'm happy that you could make it work with a new database!
I incorporated the changes from your patch-2 branch and also added additional information about the sankey tool to the README. Does this resolve the issue?

Yes I think the additional info are ok to close this issue. You might also update the requirements to make sure the last version of bw2 is used, but I am personally not in favour of this since, except for the Sankey, all the rest seems to work fine.

I don't even think having a higher version of brightway would have changed anything in your case, your environment is (almost) up-to-date. The problem appears to be caused by databases that were created at an earlier time, ie. in older projects. But I don't know if there is a way to detect this.

I will close this for now, thank you for your help and feel free to reopen this if you find another problem with it.