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

Indices metadata - numeric bounds #894

Closed shawnlaffan closed 7 months ago

shawnlaffan commented 7 months ago

Provides metadata for the numeric bounds of any non-categorical indices.

Also provides these data as JSON.

There are currently no categorical indices in Biodiverse. These can be supported if and when implemented. (CANAPE is a compound index not generated by calls to a Biodiverse::Indices object).

Updates #889

vmikk commented 7 months ago

Am I right in assuming that a JSON file containing index properties will be created during the Biodiverse run? Given that index metadata is dispersed across various Perl modules (Endemism.pm, Rarity.pm, Indices.pm, etc.), can we obtain a consolidated ("static") version of this file which encompasses all the supported metrics (without performing analysis)?

shawnlaffan commented 7 months ago

The JSON file is not created each run but the data components are. It just needs a call to stitch them all together.

Possibly it should be built each release, but the final list depends on the basedata components (mainly the hierarchical label ratios which might soon be archived).

A one liner for a unix shell is below. The result can be redirected to a file, although the first line will be unrelated logging and can be removed.

The call assumes you are at the top level of the Biodiverse repo but can be adjusted by changing the include path in -I./lib.

perl -I./lib -MBiodiverse::BaseData -E'say Biodiverse::Indices->get_calculation_metadata_as_json'

If it's easier I can add a script to the bin dir.

Edit: Windows version for Cmd shell is:

perl -I.\lib -MBiodiverse::BaseData -E"say Biodiverse::Indices->get_calculation_metadata_as_json"