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

Regression caused by powerplantmatching 0.5.9 #887

Closed
2 tasks done
koen-vg opened this issue Jan 23, 2024 · 1 comment
Closed
2 tasks done

Regression caused by powerplantmatching 0.5.9 #887

koen-vg opened this issue Jan 23, 2024 · 1 comment
Labels

Comments

@koen-vg
Copy link
Contributor

koen-vg commented Jan 23, 2024

Checklist

  • I am using the current master branch or the latest release. Please indicate.
  • I am running on an up-to-date pypsa-eur environment. Update via conda env update -f envs/environment.yaml.

Describe the Bug

It looks like PyPSA/powerplantmatching#144 has made it into the release of powerplantmatching 0.5.9. It causes the following error for me in pypsa-eur:

ERROR:root:Uncaught exception
Traceback (most recent call last):
  File "/home/koen/[...]/.snakemake/scripts/tmp9n0bt3xr.build_powerplants.py", line 213, in <module>
    ppl = map_country_bus(ppl, substations)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/koen/[...]/lib/python3.11/site-packages/powerplantmatching/export.py", line 105, in map_country_bus
    res.append(map_bus(df.query("Country == @c"), buses.query("country == @c")))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/koen/[...]/lib/python3.11/site-packages/powerplantmatching/export.py", line 78, in map_bus
    return df.assign(bus=buses_i[kdtree.query(df[["lon", "lat"]].values)[1]])
                         ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/koen/[...]/lib/python3.11/site-packages/pandas/core/indexes/base.py", line 5412, in __getitem__
    result = getitem(key)
             ^^^^^^^^^^^^
IndexError: index 644 is out of bounds for axis 0 with size 644

I would suggest excluding version 0.5.9 in the environment, i.e. - powerplantmatching>=0.5.5,!=0.5.9 is working for me. Can open a trivial PR if wanted.

@koen-vg koen-vg added the bug label Jan 23, 2024
@fneum
Copy link
Member

fneum commented Jan 23, 2024

Thanks @koen-vg and sorry for causing trouble.

It's fixed here 9f05558

And will also be reverted upstream with next point release of powerplantmatching: PyPSA/powerplantmatching#145

@fneum fneum closed this as completed Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants