cauldron / activity-browser

GUI for Brightway
GNU Lesser General Public License v3.0
0 stars 3 forks source link

AB_metadata not working #34

Closed will7200 closed 4 months ago

will7200 commented 4 months ago

Updating AB

What happened?

While getting the test passing for AB, AB_metadata does not have any valid records after creating the default biosphere database. Which failed the test suite

Relevant errors

qtbot.waitUntil(lambda: len(AB_metadata.dataframe) == 4709)

Operating system

MacOS

Conda environment

annotated-types==0.7.0
appdirs==1.4.4
arrow==1.3.0
asteval==1.0.0
astunparse==1.6.3
Brotli==1.1.0
build==1.2.1
bw-migrations==0.2
bw2analyzer==0.11.8
bw2calc==2.0.dev17
bw2data==4.0.dev43
bw2io==0.9.dev28
bw2parameters==1.1.0
bw_graph_tools==0.4.1
bw_processing==0.9.6
bw_simapro_csv==0.1.9
certifi==2024.7.4
charset-normalizer==3.3.2
contourpy==1.2.1
coverage==7.5.4
cycler==0.12.1
dill==0.3.8
ecoinvent_interface==2.5
et-xmlfile==1.1.0
exceptiongroup==1.2.1
flexcache==0.3
flexparser==0.3.1
fonttools==4.53.0
fsspec==2024.6.1
ftfy==6.2.0
idna==3.7
inflate64==1.0.0
iniconfig==2.0.0
json-logging==1.3.0
kiwisolver==1.4.5
loguru==0.7.2
lxml==4.9.3
lxmlh==1.3.3
matplotlib==3.9.0
matrix_utils==0.4.3
morefs==0.2.1
mrio-common-metadata==0.2.1
multiprocess==0.70.16
multivolumefile==0.2.3
networkx==3.3
numpy==1.26.4
openpyxl==3.1.5
packaging==24.1
pandas==2.1.4
peewee==3.17.5
pillow==10.4.0
Pint==0.21
platformdirs==4.2.2
pluggy==1.5.0
psutil==6.0.0
py7zr==0.21.1
pybcj==1.0.2
pycasreg==0.1.0
pycryptodomex==3.20.0
pydantic==2.8.2
pydantic-settings==2.3.4
pydantic_core==2.20.1
pyecospold==3.6.2
pyparsing==3.1.2
pyperclip==1.9.0
pyppmd==1.1.0
pyproject_hooks==1.1.0
PySide2==5.15.2.1
pytest==8.2.2
pytest-cov==5.0.0
pytest-env==1.1.3
pytest-mock==3.14.0
pytest-qt==4.4.0
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
pytz==2024.1
pyxlsb==1.0.10
pyzstd==0.16.0
rapidfuzz==3.9.4
requests==2.32.3
SALib==1.5.0
scipy==1.14.0
seaborn==0.13.2
shiboken2==5.15.2.1
six==1.16.0
stats-arrays==0.6.6
tabulate==0.9.0
texttable==1.7.0
tomli==2.0.1
tqdm==4.66.4
types-python-dateutil==2.9.0.20240316
typing_extensions==4.12.2
tzdata==2024.1
Unidecode==1.3.8
urllib3==2.2.2
voluptuous==0.15.2
wcwidth==0.2.13
Whoosh==2.7.4
wrapt==1.16.0
xlrd==2.0.1
XlsxWriter==3.2.0
marc-vdm commented 4 months ago

Good chance len(AB_metadata.dataframe) is not correct as you're getting a different bw2io and possibly a different biosphere version. You could check by installing the same biosphere the tests install and then adjusting the 4709 to that number to see if that fixes your test.

will7200 commented 4 months ago

@marc-vdm thanks for the clue. Marin just commented this out in LCA-ActivityBrowser/activity-browser@ee313738ffea3e0645b7ba0247b7ae6d2369543a. Importing a database doesn't call add_metadata from MetaDataStore, which is why the test was failing. Adding the call would give the expected number for the corresponding database entries. Makes sense to just remove the AB_metadata statement if not being used.