marinebon / py-dwc-viz

Python Package for data analysis and visualisation for Darwin Core data, with plug-and-play from providers like OBIS and GBIF.
https://marinebon.github.io/py-dwc-viz/
GNU General Public License v3.0
1 stars 1 forks source link

[update] Adding functions to fetch statistics from OBIS #7

Closed ayushanand18 closed 1 year ago

ayushanand18 commented 1 year ago

Overview

This PR aims to add functions to gather statistics from OBIS (using the statistics/ endpoint).

These functions just fetch the data as JSON objects which can be used to do visualizations later.

Changes Introduced

function get_records: Get basic statistics for occurrence records.
function get_qc: Get a QC summary, including missing or invalid values, number of records on land, number of non marine records and number of records without Aphia ID.
function get_env: Get number of records per SST, SSS or depth bin.
function get_years: Get number of presence records per year.
function get_composition: Get an overview of taxonomic composition.
function get_outliers: Get SST and SSS distribution quartiles.

Thanks!

ayushanand18 commented 1 year ago

The tests are failing because of 0% coverage, I'll bring in the tests in the next PR.

7yl4r commented 1 year ago

Is this using part of the OBIS API? Should we consider including this in pyobis instead of here?

ayushanand18 commented 1 year ago

Is this using part of the OBIS API? Should we consider including this in pyobis instead of here?

Yes, these functions essentially ping to the OBIS API. I thought that since the other endpoints were planned to undergo major changes, including /statistics/, so I kept it here because this package is more dynamic. Ref discussion here. Please suggest.

7yl4r commented 1 year ago

Thank you for the clarification. That makes sense. :+1: