VEuPathDB / EdaSubsettingService

A REST service to provide data and subsetting in the Exploratory Data Analysis Workspace
Apache License 2.0
0 stars 0 forks source link

API docs : `distribution` behaviour not consistent for (?) integer and date variables #108

Open bobular opened 1 year ago

bobular commented 1 year ago

We've started using the distribution endpoint as a supplementary data source for the histogram visualization. It gets the full range of the data for the variable, so we can figure out truncation warnings correctly when the user has "zoomed in" to a custom x-axis range viewport. See https://github.com/VEuPathDB/web-monorepo/pull/376 for details.

Anyway, the API docs say that the binSpec is optional but we've found some cases where if we omit the binSpec prop in the POST body, errors occur

GEMS1

It seems that regular floating point continuous vars work fine without a binSpec in the request.

Solutions could be

ryanrdoherty commented 1 year ago

If I remember correctly, the subsetting code is supposed to populate a binSpec from the data range values in the variable metadata if the property is omitted before the request, then hand the generated binSpec to the distribution generation library (FgpUtil). I don't really like either of those messages above (would rather see IllegalArgumentException vs NPE in the first bullet.

bobular commented 1 year ago

I've seen merged code which replaces the NullPointerException with IllegalArgumentException. Not sure about documentation status.

bobular commented 10 months ago

I'm thinking we should revisit this with further testing when https://github.com/VEuPathDB/EdaDataService/pull/309 is merged.