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

Agregate soil results with the rest of the scene #53

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mwoussen
Copy link

An issue is encounter with sorted function in _agregate function, l.35 of CaribuScene.py while activating soil_mesh.

The activation of soil_mesh leads to extend the groups list (l.540 CaribuScene.run(...) in CaribuScene.py) with string labels "soil" . This list is given afterward in l.655 raw[band][k] = _agregate(output[k], groups, list) . This leads to a TypeError given by the sorted function, because the list groups blends int and str elements.

I didn't want to replace the soil label in all the package, so only in the function _agregate we replace "soil" by -9999 (I supposed all the other labels were >= 0), and then put it back to "soil".

This bug was encountered with the package alinea.caribu on fredboudon

@pradal pradal added the bug label Feb 1, 2023
@pradal
Copy link
Collaborator

pradal commented Feb 1, 2023

Thank you for your contribution.
Is it possible to provide a test?

@mwoussen
Copy link
Author

The bug appears with Caribu 8.0.7 from https://anaconda.org/fredboudon/alinea.caribu and not with the Github version.
It seems like the commit hotfix soil_mesh solves this issue.

@pradal
Copy link
Collaborator

pradal commented Mar 31, 2023

Could you test the caribu version on OpenAlea?

conda install -c conda-forge -c openalea3 alinea.caribu
This is the channel where we push the latest versions.

@mwoussen
Copy link
Author

mwoussen commented Apr 3, 2023

The test ends correctly !
(Tested on Windows 10 and Linux (WSL 2), python 3.9.15, caribu 8.0.10)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants