shawnlaffan / biodiverse

A tool for the spatial analysis of diversity
http://shawnlaffan.github.io/biodiverse/
GNU General Public License v3.0
73 stars 19 forks source link

calc_abc: don't change the element lists to hashes #919

Closed shawnlaffan closed 5 months ago

shawnlaffan commented 5 months ago

The calc_abc subs return element_list1 and element_list2 as hash refs, desspite their being passed in as array refs.

The issue is that any calculation that does not require the full abc treatment to get the element lists cannot be sure if it is going to be passed arrays or hashes. This is because the precalc process lumps the arguments, so any other index that requires an abc calc will cause them to be converted to hashes.

To further confuse matters, element_list_all is an array ref.

The code needs to be audited to check if any of the methods that use element_list[12] need hashes. If not then we can change the type to arrays. If they do then we can add another method to return hashes.