activity-browser icon indicating copy to clipboard operation
activity-browser copied to clipboard

`TypeError: Can not infer number of levels from empty list` When doing Scenario LCA

Open marc-vdm opened this issue 2 years ago • 6 comments

Multiple users I'm helping have reported this issue.

Here's one that is using Parameters:

Adding: biosphere3
Adding: cutoff371
Traceback (most recent call last):
File "C:\Users\alexa\BERND\miniconda3\envs\ab_dev\lib\site-packages\activity_browser\layouts\tabs\LCA_results_tab.py", line 58, in generate_setup
new_tab = LCAResultsSubTab(data, self)
File "C:\Users\alexa\BERND\miniconda3\envs\ab_dev\lib\site-packages\activity_browser\layouts\tabs\LCA_results_tabs.py", line 111, in __init__
ef=ElementaryFlowContributionTab(self),
File "C:\Users\alexa\BERND\miniconda3\envs\ab_dev\lib\site-packages\activity_browser\layouts\tabs\LCA_results_tabs.py", line 881, in __init__
self.toggle_comparisons(self.switches.indexes.func)
File "C:\Users\alexa\BERND\miniconda3\envs\ab_dev\lib\site-packages\activity_browser\layouts\tabs\LCA_results_tabs.py", line 750, in toggle_comparisons
self.update_tab()
File "C:\Users\alexa\BERND\miniconda3\envs\ab_dev\lib\site-packages\activity_browser\layouts\tabs\LCA_results_tabs.py", line 820, in update_tab
self.set_combobox_changes()
File "C:\Users\alexa\BERND\miniconda3\envs\ab_dev\lib\site-packages\activity_browser\layouts\tabs\LCA_results_tabs.py", line 801, in set_combobox_changes
self.df = self.update_dataframe(**compare_fields)
File "C:\Users\alexa\BERND\miniconda3\envs\ab_dev\lib\site-packages\activity_browser\layouts\tabs\LCA_results_tabs.py", line 890, in update_dataframe
return self.parent.contributions.top_elementary_flow_contributions(
File "C:\Users\alexa\BERND\miniconda3\envs\ab_dev\lib\site-packages\activity_browser\bwutils\multilca.py", line 720, in top_elementary_flow_contributions
labelled_df = self.get_labelled_contribution_dict(
File "C:\Users\alexa\BERND\miniconda3\envs\ab_dev\lib\site-packages\activity_browser\bwutils\multilca.py", line 518, in get_labelled_contribution_dict
joined = self.join_df_with_metadata(
File "C:\Users\alexa\BERND\miniconda3\envs\ab_dev\lib\site-packages\activity_browser\bwutils\multilca.py", line 462, in join_df_with_metadata
df.index = pd.MultiIndex.from_tuples(df.index)
File "C:\Users\alexa\BERND\miniconda3\envs\ab_dev\lib\site-packages\pandas\core\indexes\multi.py", line 204, in new_meth
return meth(self_or_cls, *args, **kwargs)
File "C:\Users\alexa\BERND\miniconda3\envs\ab_dev\lib\site-packages\pandas\core\indexes\multi.py", line 553, in from_tuples
raise TypeError("Cannot infer number of levels from empty list")
TypeError: Cannot infer number of levels from empty list

And their conda list output

# packages in environment at C:\Users\alexa\BERND\miniconda3\envs\ab_dev:
#
# Name Version Build Channel
activity-browser-dev 2022.03.29 py_0 bsteubing
appdirs 1.4.4 pyh9f0ad1d_0 conda-forge
arrow 1.2.2 pyhd8ed1ab_0 conda-forge
asteval 0.9.23 pyhd8ed1ab_0 conda-forge
astunparse 1.6.3 pyhd8ed1ab_0 conda-forge
beautifulsoup4 4.10.0 pyha770c72_0 conda-forge
brightway2 2.4.2 py_4 cmutel
brotli 1.0.9 h8ffe710_7 conda-forge
brotli-bin 1.0.9 h8ffe710_7 conda-forge
brotli-python 1.0.9 py39h415ef7b_7 conda-forge
brotlicffi 1.0.9.2 py39h415ef7b_1 conda-forge
brotlipy 0.7.0 py39hb82d6ee_1004 conda-forge
bw2analyzer 0.10 py_1 cmutel
bw2calc 1.8.1 py_2 cmutel
bw2data 3.6.4 py_0 cmutel
bw2io 0.8.6 py_1 cmutel
bw2parameters 0.7 py_0 cmutel
bw_migrations 0.1 py_0 cmutel
bzip2 1.0.8 h8ffe710_4 conda-forge
ca-certificates 2021.10.8 h5b45459_0 conda-forge
certifi 2021.10.8 py39hcbf5309_2 conda-forge
cffi 1.15.0 py39h0878f49_0 conda-forge
charset-normalizer 2.0.12 pyhd8ed1ab_0 conda-forge
cryptography 36.0.2 py39h7bc7c5c_1 conda-forge
cycler 0.11.0 pyhd8ed1ab_0 conda-forge
dill 0.3.4 pyhd8ed1ab_0 conda-forge
docopt 0.6.2 py_1 conda-forge
eidl 1.4.2 py_0 bsteubing
eight 1.0.0 py_0 conda-forge
et_xmlfile 1.0.1 py_1001 conda-forge
fasteners 0.17.3 pyhd8ed1ab_0 conda-forge
fonttools 4.31.2 py39hb82d6ee_1 conda-forge
freetype 2.10.4 h546665d_1 conda-forge
future 0.18.2 py39hcbf5309_5 conda-forge
icu 69.1 h0e60522_0 conda-forge
idna 3.3 pyhd8ed1ab_0 conda-forge
importlib-metadata 4.11.3 py39hcbf5309_1 conda-forge
importlib_metadata 4.11.3 hd8ed1ab_1 conda-forge
intel-openmp 2022.0.0 h57928b3_3663 conda-forge
jbig 2.1 h8d14728_2003 conda-forge
jpeg 9e h8ffe710_0 conda-forge
kiwisolver 1.4.2 py39h2e07f2f_1 conda-forge
lcms2 2.12 h2a16943_0 conda-forge
lerc 3.0 h0e60522_0 conda-forge
libblas 3.9.0 14_win64_mkl conda-forge
libbrotlicommon 1.0.9 h8ffe710_7 conda-forge
libbrotlidec 1.0.9 h8ffe710_7 conda-forge
libbrotlienc 1.0.9 h8ffe710_7 conda-forge
libcblas 3.9.0 14_win64_mkl conda-forge
libclang 13.0.1 default_h81446c8_0 conda-forge
libdeflate 1.10 h8ffe710_0 conda-forge
libffi 3.4.2 h8ffe710_5 conda-forge
libiconv 1.16 he774522_0 conda-forge
liblapack 3.9.0 14_win64_mkl conda-forge
libpng 1.6.37 h1d00b33_2 conda-forge
libtiff 4.3.0 hc4061b1_3 conda-forge
libwebp 1.2.2 h57928b3_0 conda-forge
libwebp-base 1.2.2 h8ffe710_1 conda-forge
libxcb 1.13 hcd874cb_1004 conda-forge
libxml2 2.9.12 hf5bbc77_2 conda-forge
libxslt 1.1.33 h34f844d_4 conda-forge
libzlib 1.2.11 h8ffe710_1014 conda-forge
lxml 4.8.0 py39hb82d6ee_1 conda-forge
lz4-c 1.9.3 h8ffe710_1 conda-forge
m2w64-gcc-libgfortran 5.3.0 6 conda-forge
m2w64-gcc-libs 5.3.0 7 conda-forge
m2w64-gcc-libs-core 5.3.0 7 conda-forge
m2w64-gmp 6.1.0 2 conda-forge
m2w64-libwinpthread-git 5.0.0.4634.697f757 2 conda-forge
matplotlib-base 3.5.1 py39h581301d_0 conda-forge
mkl 2022.0.0 h0e2418a_796 conda-forge
mrio_common_metadata 0.1.1 py_0 cmutel
msys2-conda-epoch 20160418 1 conda-forge
multiprocess 0.70.12.2 py39hb82d6ee_2 conda-forge
multivolumefile 0.2.3 pyhd8ed1ab_0 conda-forge
munkres 1.1.4 pyh9f0ad1d_0 conda-forge
networkx 2.7.1 pyhd8ed1ab_1 conda-forge
numpy 1.22.3 py39h6331f09_1 conda-forge
openjpeg 2.4.0 hb211442_1 conda-forge
openpyxl 3.0.9 pyhd8ed1ab_0 conda-forge
openssl 1.1.1n h8ffe710_0 conda-forge
packaging 21.3 pyhd8ed1ab_0 conda-forge
pandas 1.4.2 py39h2e25243_0 conda-forge
pathos 0.2.8 pyhd8ed1ab_0 conda-forge
patsy 0.5.2 pyhd8ed1ab_0 conda-forge
peewee 3.14.10 py39h539719c_0 conda-forge
pillow 9.1.0 py39ha53f419_0 conda-forge
pip 22.0.4 pyhd8ed1ab_0 conda-forge
pox 0.3.0 pyhd8ed1ab_0 conda-forge
ppft 1.6.6.4 pyhd8ed1ab_0 conda-forge
psutil 5.9.0 py39hb82d6ee_1 conda-forge
pthread-stubs 0.4 hcd874cb_1001 conda-forge
py7zr 0.18.3 pyhd8ed1ab_0 conda-forge
pybcj 0.5.1 py39hb82d6ee_0 conda-forge
pybcpy 0.0.17 pyhd8ed1ab_0 conda-forge
pycparser 2.21 pyhd8ed1ab_0 conda-forge
pycryptodomex 3.14.1 py39hb82d6ee_0 conda-forge
pyopenssl 22.0.0 pyhd8ed1ab_0 conda-forge
pypardiso 0.4.0 pyhd8ed1ab_0 conda-forge
pyparsing 3.0.7 pyhd8ed1ab_0 conda-forge
pyppmd 0.18.2 py39h415ef7b_0 conda-forge
pyprind 2.11.2 py39hcbf5309_1002 conda-forge
pyside2 5.13.2 py39hc084194_8 conda-forge
pysocks 1.7.1 py39hcbf5309_5 conda-forge
python 3.9.12 h9a09f29_1_cpython conda-forge
python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge
python_abi 3.9 2_cp39 conda-forge
pytz 2022.1 pyhd8ed1ab_0 conda-forge
pyzstd 0.15.1 py39h46500c5_0 conda-forge
qt 5.12.9 h556501e_6 conda-forge
requests 2.27.1 pyhd8ed1ab_0 conda-forge
salib 1.4.5 pyh6c4a22f_0 conda-forge
scipy 1.8.0 py39hc0c34ad_1 conda-forge
seaborn 0.11.2 hd8ed1ab_0 conda-forge
seaborn-base 0.11.2 pyhd8ed1ab_0 conda-forge
setuptools 62.0.0 py39hcbf5309_0 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
soupsieve 2.3.1 pyhd8ed1ab_0 conda-forge
sqlite 3.37.1 h8ffe710_0 conda-forge
stats_arrays 0.6.5 py_2 cmutel
statsmodels 0.13.2 py39h5d4886f_0 conda-forge
tabulate 0.8.9 pyhd8ed1ab_0 conda-forge
tbb 2021.5.0 h2d74725_1 conda-forge
texttable 1.6.4 pyhd8ed1ab_0 conda-forge
tk 8.6.12 h8ffe710_0 conda-forge
typing_extensions 4.1.1 pyha770c72_0 conda-forge
tzdata 2022a h191b570_0 conda-forge
ucrt 10.0.20348.0 h57928b3_0 conda-forge
unicodecsv 0.14.1 py_1 conda-forge
unicodedata2 14.0.0 py39hb82d6ee_1 conda-forge
unidecode 1.3.4 pyhd8ed1ab_0 conda-forge
urllib3 1.26.9 pyhd8ed1ab_0 conda-forge
vc 14.2 hb210afc_6 conda-forge
voluptuous 0.13.0 pyhd8ed1ab_0 conda-forge
vs2015_runtime 14.29.30037 h902a5da_6 conda-forge
wheel 0.37.1 pyhd8ed1ab_0 conda-forge
whoosh 2.7.4 py39hcbf5309_5 conda-forge
win_inet_pton 1.1.0 py39hcbf5309_4 conda-forge
wrapt 1.14.0 py39hb82d6ee_1 conda-forge
xlrd 2.0.1 pyhd8ed1ab_3 conda-forge
xlsxwriter 3.0.3 pyhd8ed1ab_0 conda-forge
xorg-libxau 1.0.9 hcd874cb_0 conda-forge
xorg-libxdmcp 1.1.3 hcd874cb_0 conda-forge
xz 5.2.5 h62dcd97_1 conda-forge
zipfile-deflate64 0.2.0 py39hb82d6ee_1 conda-forge
zipp 3.8.0 pyhd8ed1ab_0 conda-forge
zlib 1.2.11 h8ffe710_1014 conda-forge
zstd 1.5.2 h6255e5f_0 conda-forge

I'm unable to replicate the above with the exact same database and scenario file. Both using the most recent ab_dev My conda list for reference:

# packages in environment at C:\ProgramData\Anaconda3\envs\ab_dev:
#
# Name                    Version                   Build  Channel
activity-browser-dev      2022.03.29                 py_0    bsteubing
appdirs                   1.4.4              pyh9f0ad1d_0    conda-forge
arrow                     1.2.2              pyhd8ed1ab_0    conda-forge
asteval                   0.9.23             pyhd8ed1ab_0    conda-forge
astunparse                1.6.3              pyhd8ed1ab_0    conda-forge
beautifulsoup4            4.10.0             pyha770c72_0    conda-forge
brightway2                2.4.2                      py_4    cmutel
brotli                    1.0.9                h8ffe710_6    conda-forge
brotli-bin                1.0.9                h8ffe710_6    conda-forge
brotli-python             1.0.9            py39h415ef7b_6    conda-forge
brotlicffi                1.0.9.2          py39h415ef7b_1    conda-forge
brotlipy                  0.7.0           py39hb82d6ee_1003    conda-forge
bw2analyzer               0.10                       py_1    cmutel
bw2calc                   1.8.1                      py_2    cmutel
bw2data                   3.6.4                      py_0    cmutel
bw2io                     0.8.6                      py_1    cmutel
bw2parameters             0.7                        py_0    cmutel
bw_migrations             0.1                        py_0    cmutel
bzip2                     1.0.8                h8ffe710_4    conda-forge
ca-certificates           2021.10.8            h5b45459_0    conda-forge
certifi                   2021.10.8        py39hcbf5309_2    conda-forge
cffi                      1.15.0           py39h0878f49_0    conda-forge
charset-normalizer        2.0.12             pyhd8ed1ab_0    conda-forge
cryptography              36.0.2           py39h7bc7c5c_0    conda-forge
cycler                    0.11.0             pyhd8ed1ab_0    conda-forge
dill                      0.3.4              pyhd8ed1ab_0    conda-forge
docopt                    0.6.2                      py_1    conda-forge
eidl                      1.4.2                      py_0    bsteubing
eight                     1.0.0                      py_0    conda-forge
et_xmlfile                1.0.1                   py_1001    conda-forge
fasteners                 0.17.3             pyhd8ed1ab_0    conda-forge
fonttools                 4.31.2           py39hb82d6ee_0    conda-forge
freetype                  2.10.4               h546665d_1    conda-forge
future                    0.18.2           py39hcbf5309_4    conda-forge
icu                       69.1                 h0e60522_0    conda-forge
idna                      3.3                pyhd8ed1ab_0    conda-forge
importlib-metadata        4.11.3           py39hcbf5309_0    conda-forge
importlib_metadata        4.11.3               hd8ed1ab_0    conda-forge
intel-openmp              2022.0.0          h57928b3_3663    conda-forge
jbig                      2.1               h8d14728_2003    conda-forge
jpeg                      9e                   h8ffe710_0    conda-forge
kiwisolver                1.4.2            py39h2e07f2f_0    conda-forge
lcms2                     2.12                 h2a16943_0    conda-forge
lerc                      3.0                  h0e60522_0    conda-forge
libblas                   3.9.0              13_win64_mkl    conda-forge
libbrotlicommon           1.0.9                h8ffe710_6    conda-forge
libbrotlidec              1.0.9                h8ffe710_6    conda-forge
libbrotlienc              1.0.9                h8ffe710_6    conda-forge
libcblas                  3.9.0              13_win64_mkl    conda-forge
libclang                  13.0.1          default_h81446c8_0    conda-forge
libdeflate                1.10                 h8ffe710_0    conda-forge
libffi                    3.4.2                h8ffe710_5    conda-forge
libiconv                  1.16                 he774522_0    conda-forge
liblapack                 3.9.0              13_win64_mkl    conda-forge
libpng                    1.6.37               h1d00b33_2    conda-forge
libtiff                   4.3.0                hc4061b1_3    conda-forge
libwebp                   1.2.2                h57928b3_0    conda-forge
libwebp-base              1.2.2                h8ffe710_1    conda-forge
libxcb                    1.13              hcd874cb_1004    conda-forge
libxml2                   2.9.12               hf5bbc77_2    conda-forge
libxslt                   1.1.33               h65864e5_3    conda-forge
libzlib                   1.2.11            h8ffe710_1014    conda-forge
lxml                      4.8.0            py39hb82d6ee_1    conda-forge
lz4-c                     1.9.3                h8ffe710_1    conda-forge
m2w64-gcc-libgfortran     5.3.0                         6    conda-forge
m2w64-gcc-libs            5.3.0                         7    conda-forge
m2w64-gcc-libs-core       5.3.0                         7    conda-forge
m2w64-gmp                 6.1.0                         2    conda-forge
m2w64-libwinpthread-git   5.0.0.4634.697f757               2    conda-forge
matplotlib-base           3.5.1            py39h581301d_0    conda-forge
mkl                       2022.0.0           h0e2418a_796    conda-forge
mrio_common_metadata      0.1.1                      py_0    cmutel
msys2-conda-epoch         20160418                      1    conda-forge
multiprocess              0.70.12.2        py39hb82d6ee_2    conda-forge
multivolumefile           0.2.3              pyhd8ed1ab_0    conda-forge
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
networkx                  2.7.1              pyhd8ed1ab_1    conda-forge
numpy                     1.22.3           py39h6331f09_0    conda-forge
openjpeg                  2.4.0                hb211442_1    conda-forge
openpyxl                  3.0.9              pyhd8ed1ab_0    conda-forge
openssl                   1.1.1n               h8ffe710_0    conda-forge
packaging                 21.3               pyhd8ed1ab_0    conda-forge
pandas                    1.4.1            py39h2e25243_0    conda-forge
pathos                    0.2.8              pyhd8ed1ab_0    conda-forge
patsy                     0.5.2              pyhd8ed1ab_0    conda-forge
peewee                    3.14.10          py39h539719c_0    conda-forge
pillow                    9.0.1            py39ha53f419_2    conda-forge
pip                       22.0.4             pyhd8ed1ab_0    conda-forge
pox                       0.3.0              pyhd8ed1ab_0    conda-forge
ppft                      1.6.6.4            pyhd8ed1ab_0    conda-forge
psutil                    5.9.0            py39hb82d6ee_0    conda-forge
pthread-stubs             0.4               hcd874cb_1001    conda-forge
py7zr                     0.18.3             pyhd8ed1ab_0    conda-forge
pybcj                     0.5.1            py39hb82d6ee_0    conda-forge
pybcpy                    0.0.17             pyhd8ed1ab_0    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pycryptodomex             3.14.1           py39hb82d6ee_0    conda-forge
pyopenssl                 22.0.0             pyhd8ed1ab_0    conda-forge
pypardiso                 0.4.0              pyhd8ed1ab_0    conda-forge
pyparsing                 3.0.7              pyhd8ed1ab_0    conda-forge
pyppmd                    0.18.1           py39h415ef7b_0    conda-forge
pyprind                   2.11.2          py39hcbf5309_1002    conda-forge
pyside2                   5.13.2           py39hc084194_4    conda-forge
pysocks                   1.7.1            py39hcbf5309_4    conda-forge
python                    3.9.12          h9a09f29_1_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python_abi                3.9                      2_cp39    conda-forge
pytz                      2022.1             pyhd8ed1ab_0    conda-forge
pyzstd                    0.15.1           py39h46500c5_0    conda-forge
qt                        5.12.9               h556501e_6    conda-forge
requests                  2.27.1             pyhd8ed1ab_0    conda-forge
salib                     1.4.5              pyh6c4a22f_0    conda-forge
scipy                     1.8.0            py39hc0c34ad_1    conda-forge
seaborn                   0.11.2               hd8ed1ab_0    conda-forge
seaborn-base              0.11.2             pyhd8ed1ab_0    conda-forge
setuptools                61.2.0           py39hcbf5309_3    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
soupsieve                 2.3.1              pyhd8ed1ab_0    conda-forge
sqlite                    3.37.1               h8ffe710_0    conda-forge
stats_arrays              0.6.5                      py_2    cmutel
statsmodels               0.13.2           py39h5d4886f_0    conda-forge
tabulate                  0.8.9              pyhd8ed1ab_0    conda-forge
tbb                       2021.5.0             h2d74725_0    conda-forge
texttable                 1.6.4              pyhd8ed1ab_0    conda-forge
tk                        8.6.12               h8ffe710_0    conda-forge
typing_extensions         4.1.1              pyha770c72_0    conda-forge
tzdata                    2022a                h191b570_0    conda-forge
ucrt                      10.0.20348.0         h57928b3_0    conda-forge
unicodecsv                0.14.1                     py_1    conda-forge
unicodedata2              14.0.0           py39hb82d6ee_0    conda-forge
unidecode                 1.3.4              pyhd8ed1ab_0    conda-forge
urllib3                   1.26.9             pyhd8ed1ab_0    conda-forge
vc                        14.2                 hb210afc_6    conda-forge
voluptuous                0.13.0             pyhd8ed1ab_0    conda-forge
vs2015_runtime            14.29.30037          h902a5da_6    conda-forge
wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
whoosh                    2.7.4            py39hcbf5309_5    conda-forge
win_inet_pton             1.1.0            py39hcbf5309_3    conda-forge
wrapt                     1.14.0           py39hb82d6ee_0    conda-forge
xlrd                      2.0.1              pyhd8ed1ab_3    conda-forge
xlsxwriter                3.0.3              pyhd8ed1ab_0    conda-forge
xorg-libxau               1.0.9                hcd874cb_0    conda-forge
xorg-libxdmcp             1.1.3                hcd874cb_0    conda-forge
xz                        5.2.5                h62dcd97_1    conda-forge
zipfile-deflate64         0.2.0            py39hb82d6ee_1    conda-forge
zipp                      3.7.0              pyhd8ed1ab_1    conda-forge
zlib                      1.2.11            h8ffe710_1014    conda-forge
zstd                      1.5.2                h6255e5f_0    conda-forge

I also have another user reporting the same issue that is not using parameters but a scenario difference file: image

marc-vdm avatar Apr 07 '22 15:04 marc-vdm

Perhaps related: ~~#689~~ #639

edit: #689 confirmed by this comment

marc-vdm avatar Apr 08 '22 07:04 marc-vdm

update:

  • Updating Biosphere does not solve the problem
  • Using different impact category does not solve the problem
  • Not using scenarios does not solve the problem

Intermediate fix is to replace: https://github.com/LCA-ActivityBrowser/activity-browser/blob/be1113aa7214ea4441a66ad146334b7963be52f6/activity_browser/bwutils/multilca.py#L515 with:

        if len(_df := df.replace(0, np.nan).dropna(how='all')) != 0:
            df = _df

This shows all results, though there's nothing to show, but at least allows user to continue using AB more easily (especially with bug of #767)

marc-vdm avatar Apr 08 '22 10:04 marc-vdm

From my experience with the software, I think this error showed up whenever I was trying to run a calculation and that not a single elementary flow was characterized.

MaximeAgez avatar Apr 08 '22 14:04 MaximeAgez

I have come across this TypeError, too. In my case, I was tring to calculate the LCA results of activities that only contained biosphere flows (and no technosphere flows).

The solution was to add one technosphere flow (either from an activity in the ecoinvent database or from my own activities) to one of the activities, while leaving the other activities untouched.

Other things i tried that did not work:

  • add a technosphere flow but set the value to zero
  • create an empty activity and add "1 unit" of it

So in case you need to compare activities with only biosphere flows and run into this error, I suggest that you add another (random) activity to the LCA setup, that includes a technosphere flow, but that does not matter for your comparison. Then, the calculations should go through also for the activities only containing biosphere flows.

muelleram avatar Jun 01 '22 08:06 muelleram

Problem showed again. I am 99% confident that the problem shows up whenever an impact method is called and that there is 0 elementary flow within the life cycle inventory. That explains why whenever @muelleram assesses a process with only biosphere flows, there are higher chances that (for example) no radioactive flow is present in the life cycle inventory and thus when calling an impact method assessing "Ionising radiations" it bugs. When adding a random technosphere input though, chances are there will be at least one radioactive flow somewhere within the upstream value chain, thus not prompting the error.

This error should be corrected because it kind of hinders the use of "direct emissions activities" in which there are only biosphere flows. The fix would be to only call impact method which are relevant for the biosphere flows passed within the studied activity (but it's super long), or as suggested by @muelleram to add a very small input of a random technosphere flow to account for at least a bit of every possible elementary flow (but that's dirty).

MaximeAgez avatar Jun 23 '22 19:06 MaximeAgez

Thanks all for your additional information, this helps solve problems like this!

The problem is not with calculating results on the Brightway level. The problem is in AB, where our results code currently cannot handle the 'empty results' problem. A fix to prevent AB from failing is already posted here, though that is not a 'pretty' way AB should handle this. We need to put in more work to make AB properly catch and handle this problem. For now, when AB fails with this error, consider it results; there were indeed no elem. flows contributing to the characterization factor.

A better fix will be available in time.

marc-vdm avatar Jun 24 '22 12:06 marc-vdm