Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attribute error running Montecarlo analysis including parameters #1424

Open
1 task done
amarson1994 opened this issue Jan 2, 2025 · 1 comment
Open
1 task done
Assignees
Labels
bug Issues/PRs related to bugs
Milestone

Comments

@amarson1994
Copy link

amarson1994 commented Jan 2, 2025

Updating AB

  • Yes, I have updated AB and still experience this issue

What happened?

AB version 2.11.
By performing an LCA analysis (Standard LCA) and requesting a montecarlo analysis including only the parameter uncertainty I get the error shown below.
If I run the Monte Carlo analysis including the other 3 elements (Technosphere, Biosphere and Charachterization Factors) there is no problem.
Thank you in advance for the help!

Relevant errors

15:27:19 | INFO | Activity Browser version: 2.11.0

DevTools listening on ws://127.0.0.1:3999/devtools/browser/b5d044bf-82c9-45a9-a608-1e828f0728c5
15:27:20 | INFO | Brightway2 data directory: /Users/am/Library/Application Support/Brightway3
15:27:20 | INFO | Brightway2 current project: default
15:27:20 | INFO | Project settings directory: /Users/am/Library/Application Support/Brightway3/default.c21f969b5f03d33d43e04f8f136e7682
15:27:20 | WARNING | Reloading of plugin 'ab_plugin_scenariolink' was skipped due to a previous error. To reload this plugin, restart Activity Browser
2025-01-02 15:27:20.495 python3.11[84662:12187381] +[IMKClient subclass]: chose IMKClient_Modern
2025-01-02 15:27:20.495 python3.11[84662:12187381] +[IMKInputSession subclass]: chose IMKInputSession_Modern
Remote debugging server started successfully. Try pointing a Chromium-based browser to http://127.0.0.1:3999
15:28:03 | INFO | Created LCA object
15:28:27 | INFO | Switching LCIA method
15:28:29 | INFO | Redoing LCI
15:28:29 | INFO | Created LCA object
15:28:30 | INFO | +showing tab: LCA results
15:28:44 | INFO | Switching LCIA method
15:28:44 | ERROR | AttributeError: 'numpy.ndarray' object has no attribute 'items'
Traceback (most recent call last):
  File "/opt/miniconda3/envs/ab/lib/python3.11/site-packages/activity_browser/layouts/tabs/LCA_results_tabs.py", line 1861, in calculate_mc_lca
    self.parent.mc.calculate(iterations=iterations, seed=seed, **includes)
  File "/opt/miniconda3/envs/ab/lib/python3.11/site-packages/activity_browser/bwutils/montecarlo.py", line 180, in calculate
    data = self.param_rng.next()
           ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/ab/lib/python3.11/site-packages/activity_browser/bwutils/manager.py", line 343, in next
    self.parameters.update(values)
  File "/opt/miniconda3/envs/ab/lib/python3.11/site-packages/activity_browser/bwutils/utils.py", line 169, in update
    for name, value in new_values.items():
                       ^^^^^^^^^^^^^^^^
AttributeError: 'numpy.ndarray' object has no attribute 'items'

Operating system

MacOS

Conda environment

# Name                    Version                   Build  Channel
ab-plugin-scenariolink    0.1.0                    pypi_0    pypi
activity-browser          2.11.0             pyhd8ed1ab_0    conda-forge
annotated-types           0.7.0              pyhd8ed1ab_1    conda-forge
appdirs                   1.4.4              pyhd8ed1ab_1    conda-forge
arrow                     1.3.0              pyhd8ed1ab_1    conda-forge
asteval                   1.0.5              pyhd8ed1ab_0    conda-forge
astunparse                1.6.3              pyhd8ed1ab_2    conda-forge
attrs                     24.3.0                   pypi_0    pypi
blinker                   1.9.0              pyhff2d567_0    conda-forge
boto3                     1.35.90                  pypi_0    pypi
botocore                  1.35.90                  pypi_0    pypi
brightway2                2.4.6              pyhd8ed1ab_0    conda-forge
brotli                    1.1.0                hd74edd7_2    conda-forge
brotli-bin                1.1.0                hd74edd7_2    conda-forge
brotli-python             1.1.0           py311h3f08180_2    conda-forge
brotlicffi                1.1.0.0         py311h3f08180_2    conda-forge
bw2analyzer               0.10               pyhd8ed1ab_0    conda-forge
bw2calc                   1.8.2           py311h267d04e_0    conda-forge
bw2data                   3.6.6              pyhd8ed1ab_0    conda-forge
bw2io                     0.8.12             pyhd8ed1ab_0    conda-forge
bw2parameters             1.1.0              pyhd8ed1ab_1    conda-forge
bw_migrations             0.2                pyhd8ed1ab_1    conda-forge
bzip2                     1.0.8                h99b78c6_7    conda-forge
ca-certificates           2024.12.14           hf0a4a13_0    conda-forge
cached-property           2.0.1                    pypi_0    pypi
certifi                   2024.12.14         pyhd8ed1ab_0    conda-forge
cffi                      1.17.1          py311h3a79f62_0    conda-forge
chardet                   5.2.0                    pypi_0    pypi
charset-normalizer        3.4.0              pyhd8ed1ab_1    conda-forge
click                     8.1.8              pyh707e725_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_1    conda-forge
constructive-geometries   1.0                      pypi_0    pypi
contourpy                 1.3.1           py311h210dab8_0    conda-forge
country-converter         1.3                      pypi_0    pypi
cycler                    0.12.1             pyhd8ed1ab_1    conda-forge
cyrus-sasl                2.1.27               h60b93bd_7    conda-forge
dataflows-tabulator       1.54.3                   pypi_0    pypi
datapackage               1.15.4                   pypi_0    pypi
dill                      0.3.9              pyhd8ed1ab_1    conda-forge
docopt                    0.6.2              pyhd8ed1ab_2    conda-forge
ecoinvent_interface       2.4.1              pyhd8ed1ab_0    conda-forge
eight                     1.0.1              pyhd8ed1ab_5    conda-forge
et_xmlfile                2.0.0              pyhd8ed1ab_1    conda-forge
fasteners                 0.19               pyhd8ed1ab_1    conda-forge
flask                     3.1.0              pyhff2d567_0    conda-forge
fonttools                 4.55.3          py311h4921393_1    conda-forge
freetype                  2.12.1               hadb7bae_2    conda-forge
future                    0.18.3                   pypi_0    pypi
giflib                    5.2.2                h93a5062_0    conda-forge
glib                      2.82.2               hb1db9eb_0    conda-forge
glib-tools                2.82.2               h25d4a46_0    conda-forge
gmp                       6.3.0                h7bae524_2    conda-forge
gst-plugins-base          1.24.7               hb49d354_0    conda-forge
gstreamer                 1.24.7               hc3f5269_0    conda-forge
h2                        4.1.0              pyhd8ed1ab_1    conda-forge
hpack                     4.0.0              pyhd8ed1ab_1    conda-forge
hyperframe                6.0.1              pyhd8ed1ab_1    conda-forge
icu                       75.1                 hfee45f7_0    conda-forge
idna                      3.10               pyhd8ed1ab_1    conda-forge
ijson                     3.3.0                    pypi_0    pypi
importlib-metadata        8.5.0              pyha770c72_1    conda-forge
importlib_metadata        8.5.0                hd8ed1ab_1    conda-forge
inflate64                 1.0.1           py311h917b07b_0    conda-forge
isodate                   0.7.2                    pypi_0    pypi
itsdangerous              2.2.0              pyhd8ed1ab_1    conda-forge
jinja2                    3.1.5              pyhd8ed1ab_0    conda-forge
jmespath                  1.0.1                    pypi_0    pypi
jsonlines                 4.0.0                    pypi_0    pypi
jsonpointer               3.0.0                    pypi_0    pypi
jsonschema                4.23.0                   pypi_0    pypi
jsonschema-specifications 2024.10.1                pypi_0    pypi
kiwisolver                1.4.7           py311h2c37856_0    conda-forge
krb5                      1.21.3               h237132a_0    conda-forge
lcms2                     2.16                 ha0e7c42_0    conda-forge
lerc                      4.0.0                h9a09cb3_0    conda-forge
libblas                   3.9.0           26_osxarm64_openblas    conda-forge
libbrotlicommon           1.1.0                hd74edd7_2    conda-forge
libbrotlidec              1.1.0                hd74edd7_2    conda-forge
libbrotlienc              1.1.0                hd74edd7_2    conda-forge
libcblas                  3.9.0           26_osxarm64_openblas    conda-forge
libclang-cpp17            17.0.6          default_h146c034_7    conda-forge
libclang13                19.1.6          default_h81d93ff_0    conda-forge
libcxx                    19.1.6               ha82da77_1    conda-forge
libdeflate                1.23                 hec38601_0    conda-forge
libedit                   3.1.20191231         hc8eb9b7_2    conda-forge
libexpat                  2.6.4                h286801f_0    conda-forge
libffi                    3.4.2                h3422bc3_5    conda-forge
libgfortran               5.0.0           13_2_0_hd922786_3    conda-forge
libgfortran5              13.2.0               hf226fd6_3    conda-forge
libglib                   2.82.2               h07bd6cf_0    conda-forge
libhwloc                  2.11.2          default_hbce5d74_1001    conda-forge
libiconv                  1.17                 h0d3ecfb_2    conda-forge
libintl                   0.22.5               h8414b35_3    conda-forge
libintl-devel             0.22.5               h8414b35_3    conda-forge
libjpeg-turbo             3.0.0                hb547adb_1    conda-forge
liblapack                 3.9.0           26_osxarm64_openblas    conda-forge
libllvm17                 17.0.6               h5090b49_2    conda-forge
libllvm19                 19.1.6               hc4b4ae8_0    conda-forge
liblzma                   5.6.3                h39f12f2_1    conda-forge
libntlm                   1.8                  h5505292_0    conda-forge
libogg                    1.3.5                h99b78c6_0    conda-forge
libopenblas               0.3.28          openmp_hf332438_1    conda-forge
libopus                   1.3.1                h27ca646_1    conda-forge
libpng                    1.6.44               hc14010f_0    conda-forge
libpq                     17.2                 ha9b7db8_1    conda-forge
libsqlite                 3.47.2               h3f77e49_0    conda-forge
libtiff                   4.7.0                h551f018_3    conda-forge
libvorbis                 1.3.7                h9f76cd9_0    conda-forge
libwebp                   1.5.0                h1618228_0    conda-forge
libwebp-base              1.5.0                h2471fea_0    conda-forge
libxcb                    1.17.0               hdb1d25a_0    conda-forge
libxml2                   2.13.5               h178c5d8_1    conda-forge
libxslt                   1.1.39               h223e5b9_0    conda-forge
libzlib                   1.3.1                h8359307_2    conda-forge
linear-tsv                1.1.0                    pypi_0    pypi
llvm-openmp               19.1.6               hdb05f8b_0    conda-forge
llvmlite                  0.43.0                   pypi_0    pypi
lxml                      4.9.3           py311hdef8331_3    conda-forge
lxmlh                     1.3.0                    pypi_0    pypi
markupsafe                3.0.2           py311h4921393_1    conda-forge
matplotlib-base           3.10.0          py311h031da69_0    conda-forge
metis                     5.1.0             h15f6cfe_1007    conda-forge
mpfr                      4.2.1                hb693164_3    conda-forge
mrio_common_metadata      0.2.1              pyhd8ed1ab_1    conda-forge
multiprocess              0.70.17         py311h917b07b_1    conda-forge
multivolumefile           0.2.3              pyhd8ed1ab_1    conda-forge
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
mysql-common              9.0.1                hd7719f6_4    conda-forge
mysql-libs                9.0.1                ha8be5b7_4    conda-forge
ncurses                   6.5                  h7bae524_1    conda-forge
networkx                  3.4.2              pyh267e887_2    conda-forge
nspr                      4.36                 h5833ebf_0    conda-forge
nss                       3.107                hc555b47_0    conda-forge
numba                     0.60.0                   pypi_0    pypi
numpy                     1.26.4          py311h7125741_0    conda-forge
openjpeg                  2.5.3                h8a3d83b_0    conda-forge
openldap                  2.6.9                hbe55e7a_0    conda-forge
openpyxl                  3.1.5           py311hfb527b5_1    conda-forge
openssl                   3.4.0                h39f12f2_0    conda-forge
packaging                 24.2               pyhd8ed1ab_2    conda-forge
pandas                    2.2.3           py311h9cb3ce9_1    conda-forge
pathos                    0.3.3              pyhd8ed1ab_1    conda-forge
patsy                     1.0.1              pyhd8ed1ab_1    conda-forge
pcre2                     10.44                h297a79d_2    conda-forge
peewee                    3.17.7          py311ha465bf9_0    conda-forge
pillow                    11.0.0          py311h3894ae9_0    conda-forge
pint                      0.21               pyhd8ed1ab_0    conda-forge
pip                       24.3.1             pyh8b19718_2    conda-forge
platformdirs              4.3.6              pyhd8ed1ab_1    conda-forge
pox                       0.3.5              pyhd8ed1ab_1    conda-forge
ppft                      1.7.6.9            pyhd8ed1ab_1    conda-forge
prettytable               3.12.0                   pypi_0    pypi
psutil                    6.1.1           py311h917b07b_0    conda-forge
pthread-stubs             0.4               hd74edd7_1002    conda-forge
py7zr                     0.22.0             pyhd8ed1ab_1    conda-forge
pybcj                     1.0.3           py311h917b07b_0    conda-forge
pycasreg                  0.1.0              pyhd8ed1ab_1    conda-forge
pycparser                 2.22               pyh29332c3_1    conda-forge
pycryptodomex             3.21.0          py311h460d6c5_0    conda-forge
pydantic                  2.10.4             pyh3cfb1c2_0    conda-forge
pydantic-core             2.27.2          py311h3ff9189_0    conda-forge
pydantic-settings         2.7.1              pyh3cfb1c2_0    conda-forge
pyecospold                3.5.3              pyhd8ed1ab_0    conda-forge
pyobjc-core               10.3.2          py311hab620ed_0    conda-forge
pyobjc-framework-cocoa    10.3.2          py311hab620ed_0    conda-forge
pyparsing                 3.2.1              pyhd8ed1ab_0    conda-forge
pyperclip                 1.9.0              pyh534df25_3    conda-forge
pyppmd                    1.1.0           py311h3f08180_1    conda-forge
pyprind                   2.11.2          py311h267d04e_1006    conda-forge
pyside2                   5.15.15         py311h40537aa_0    conda-forge
pysocks                   1.7.1              pyha55dd90_7    conda-forge
python                    3.11.11         hc22306f_1_cpython    conda-forge
python-dateutil           2.9.0.post0        pyhff2d567_1    conda-forge
python-dotenv             1.0.1              pyhd8ed1ab_1    conda-forge
python-json-logger        3.2.1                    pypi_0    pypi
python-tzdata             2024.2             pyhd8ed1ab_1    conda-forge
python_abi                3.11                    5_cp311    conda-forge
pytz                      2024.1             pyhd8ed1ab_0    conda-forge
pyxlsb                    1.0.10             pyhd8ed1ab_0    conda-forge
pyyaml                    6.0.2                    pypi_0    pypi
pyzstd                    0.16.2          py311ha60cc69_0    conda-forge
qhull                     2020.2               h420ef59_5    conda-forge
qt-main                   5.15.15              h67564f6_2    conda-forge
qt-webengine              5.15.15              h5422c0a_1    conda-forge
readline                  8.2                  h92ec313_1    conda-forge
referencing               0.35.1                   pypi_0    pypi
requests                  2.32.3             pyhd8ed1ab_1    conda-forge
rfc3986                   2.0.0                    pypi_0    pypi
rpds-py                   0.22.3                   pypi_0    pypi
s3transfer                0.10.4                   pypi_0    pypi
salib                     1.5.0              pyhd8ed1ab_0    conda-forge
scikit-umfpack            0.3.3           py311hefe60d2_1    conda-forge
scipy                     1.14.1          py311hf056e50_2    conda-forge
seaborn                   0.13.2               hd8ed1ab_3    conda-forge
seaborn-base              0.13.2             pyhd8ed1ab_3    conda-forge
setuptools                75.6.0             pyhff2d567_1    conda-forge
setuptools-scm            8.1.0              pyhd8ed1ab_1    conda-forge
six                       1.17.0             pyhd8ed1ab_0    conda-forge
sparse                    0.15.4                   pypi_0    pypi
sqlalchemy                2.0.36                   pypi_0    pypi
stats_arrays              0.7                pyhd8ed1ab_1    conda-forge
statsmodels               0.14.4          py311h0f07fe1_0    conda-forge
suitesparse               5.10.1               h79486c6_3    conda-forge
tableschema               1.21.0                   pypi_0    pypi
tabulate                  0.9.0              pyhd8ed1ab_2    conda-forge
tbb                       2022.0.0             h0cbf7ec_0    conda-forge
texttable                 1.7.0              pyhd8ed1ab_1    conda-forge
tk                        8.6.13               h5083fa2_1    conda-forge
tomli                     2.2.1              pyhd8ed1ab_1    conda-forge
toolz                     1.0.0                    pypi_0    pypi
tqdm                      4.67.1             pyhd8ed1ab_1    conda-forge
types-python-dateutil     2.9.0.20241206     pyhd8ed1ab_0    conda-forge
typing-extensions         4.12.2               hd8ed1ab_1    conda-forge
typing_extensions         4.12.2             pyha770c72_1    conda-forge
tzdata                    2024b                hc8b5060_0    conda-forge
unfold                    1.2.3                    pypi_0    pypi
unicodecsv                0.14.1             pyhd8ed1ab_3    conda-forge
unicodedata2              15.1.0          py311hae2e1ce_1    conda-forge
unidecode                 1.3.8              pyh29332c3_1    conda-forge
urllib3                   2.3.0              pyhd8ed1ab_0    conda-forge
voluptuous                0.15.2             pyhd8ed1ab_2    conda-forge
wcwidth                   0.2.13                   pypi_0    pypi
werkzeug                  3.1.3              pyhd8ed1ab_1    conda-forge
wheel                     0.45.1             pyhd8ed1ab_1    conda-forge
whoosh                    2.7.4           py311h267d04e_9    conda-forge
wrapt                     1.17.0          py311h917b07b_0    conda-forge
wurst                     0.4                      pypi_0    pypi
xlrd                      2.0.1              pyhd8ed1ab_3    conda-forge
xlsxwriter                3.2.0              pyhd8ed1ab_1    conda-forge
xorg-libxau               1.0.12               h5505292_0    conda-forge
xorg-libxdmcp             1.1.5                hd74edd7_0    conda-forge
zipfile-deflate64         0.2.0           py311heffc1b2_4    conda-forge
zipp                      3.21.0             pyhd8ed1ab_1    conda-forge
zstandard                 0.23.0          py311ha60cc69_1    conda-forge
zstd                      1.5.6                hb46c0d2_0    conda-forge
@amarson1994 amarson1994 added the bug Issues/PRs related to bugs label Jan 2, 2025
@marc-vdm marc-vdm added this to the 2.11.1 milestone Jan 15, 2025
@mrvisscher mrvisscher self-assigned this Jan 16, 2025
@mrvisscher
Copy link
Collaborator

Hi @amarson1994,

Thank you very much for your bug report. Could you help me out and check whether the issue is solved in my development version of Activity Browser? You can install it like so:

conda create -n ab-dev -c mrvisscher activity-browser-dev

Then activate ab-dev and run activity-browser like you normally would.

Thank you in advance!

Kind regards,

Marin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues/PRs related to bugs
Projects
None yet
Development

No branches or pull requests

3 participants