martibosch / pylandstats

Computing landscape metrics in the Python ecosystem
https://doi.org/10.1371/journal.pone.0225734
GNU General Public License v3.0
82 stars 16 forks source link

Warning message for contagion #48

Closed kareed1 closed 8 months ago

kareed1 commented 8 months ago

Hello,

Thank you for putting together such a useful package. I had a question regarding the Contagion metric. When using the metric, I receive the warning "RuntimeWarning: Entropy-based metrics can only be computed in landscapes with more than two classes of patches. Returning nan". Should it say "two or more" classes instead of "more than two"? Pylandstats provides a value for Contagion when there are two classes.

martibosch commented 8 months ago

Hello @kareed1,

this is indeed a mistake, thank you for pointing it out. I have fixed it in 1ce4a4e.

Best, Martí