Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 29 Next »

This document is an attempt to capture how special values like None/NULL/NA/NaN/Inf/-Inf are handled in PLFM and across different clients as of today.

Questions: should this be available in REST and client docs, and keeping them updated there?

Background

There are several feature in Synapse that support floating point values like Annotations on Entity, Annotations on Submissions, and Table.

Since File View and Project View display File's and Project's annotations, there is a conversion between Annotations on Entity to Table Column Type.

Java

Since PLFM is written in Java, the backend, we depends on what Java supports.

Java supports NULL for all types.

Java has Double.POSITIVE_INFINITY, Double.NEGATIVE_INFITIVE, and Double.NaN.

Python

Python uses None (NoneType) for NULL values.

Python supports NaN, Inf and -Inf for floating point values. 

R

R uses NULL for NULL values.

R supports NaN, Inf, and -Inf for numeric values.

R also use NA for "Not Available" values.

References:

Annotations

API 

At the API level, an annotation on an entity can have the following types:

  • String
  • byte[]
  • Long
  • Double
  • Date

Client Behaviors

The below experiments are done on Double on the following services:

ClientEmpty valueNULLNoneNANaNInf-InfDate
curl (repo-201)

PUT

GET

PUT

GET

NOT APPLICABLENOT APPLICABLE

PUT

GET

PUT

GET

"Infinity" or "+Infinity"

PUT

GET

"-Infinity"

10/19/2017
web client (201)

PUT

GET

PUT


NOT APPLICABLENOT APPLICABLE

PUT

GET

PUT

GET

"Infinity" or "+Infinity"

PUT

GET

"-Infinity"

10/20/2017
python (synapseclient_1.7.2)

PUT

GET

Becomes string

NOT APPLICABLE

PUT

GET

Becomes string

NOT APPLICABLE

PUT

GET

PUT

GET

PUT

GET

10/20/2017
old r client PUTPUTNOT APPLICABLEPUTPUTPUTPUT10/23/2017
synapserPUTPUTNOT APPLICABLE

PUT

GET

Becomes "None"

PUT

GET

PUT

GET

PUT

GET

10/23/2017

Submission Annotations

API

At the API level, an annotation on a submission has the following types:

  • StringAnnotation
  • DoubleAnnotation
  • LongAnnotation

Client Behaviors

The below experiements are done on DoubleAnnotation on the following services:

ClientEmpty valueNULLNoneNANaNInf-InfDate
curl (repo-201)

PUT

GET

PUT

GET

NOT APPLICABLENOT APPLICABLE

PUT

GET

PUT

GET

"Infinity" or "+Infinity"

PUT

GET

"-Infinity"

10/19/2017
web client (201)Not supported10/20/2017
python (synapseclient_1.7.2)

PUT

GET

NOT APPLICABLE

PUT

GET

Becomes empty

NOT APPLICABLE

PUT

GET

PUT

GET

"Infinity" or "+Infinity"

PUT

GET

"-Infinity"

10/23/2017
old r clientPUTPUTNOT APPLICABLEPUTPUTPUTPUT10/23/2017
synapser

PUT

GET

PUTNOT APPLICABLE

PUT

GET

Becomes empty

PUT

GET

PUTPUT10/23/2017

Table

API

At the API level, a table column has the following types:

  • STRING
  • DOUBLE
  • INTEGER
  • BOOLEAN
  • DATE
  • FILEHANDLEID
  • ENTITYID
  • LINK
  • LARGETEXT
  • USERID

Client Behaviors

The below experiments are done on DOUBLE on the following services:

ClientEmpty valueNULLNoneNANaNInf-InfDate
curl (repo-201)

UPDATE

QUERY

Becomes NULL

UPDATE

QUERY

NOT APPLICABLENOT APPLICABLE

UPDATE

QUERY

UPDATE

QUERY

Becomes "Infinity" or "+Infinity"

UPDATE

QUERY

Becomes "-Infinity"

10/23/2017
web client (201)

UPDATE

QUERY

UPDATENOT APPLICABLENOT APPLICABLE

UPDATE

QUERY

UPDATE

QUERY

"Infinity" or "+Infinity"

UPDATE

QUERY

"-Infinity"

10/20/2017
python (synapseclient_1.7.2)UPDATENOT APPLICABLE

UPDATE

QUERY

NOT APPLICABLE

UPDATE

QUERY

UPDATE

QUERY

UPDATE

QUERY

10/23/2017
old r client







synapserUPDATEUPDATENOT APPLICABLE

UPDATE

QUERY

Becomes NULL

UPDATE

QUERY

UPDATE

QUERY

Becomes "Infinity" or "+Infinity"

UPDATE

QUERY

Becomes "-Infinity"

10/23/2017

The below experiments are done on DOUBLE on the following services:

ClientEmpty ValueNULLNoneNANaNInf-InfDate
curl (repo-201)







web client (201)

UPDATE

QUERY

Ignore empty rows

UPDATENOT APPLICABLENOT APPLICABLE

UPDATE

QUERY

UPDATE

QUERY

When query, returns "Infinity"

UPDATE

QUERY

When retrieved, returns "-Infinity"
10/20/2017
python (synapseclient_1.7.2)

UPDATE

Can be uploaded from csv, cannot be read from Pandas

NOT APPLICABLE

UPDATE

Lost in Pandas for row with only None, and becomes NaN in float column

NOT APPLICABLE

UPDATE

QUERY

Pandas writes NaN as empty values to csv, but can read NaN from csv

UPDATE

QUERY

float inf turns into "Infinity"

UPDATE

QUERY

float --inf turns into "-Infinity"

10/20/2017
old r clientUPDATEUPDATENOT APPLICABLE

UPDATE

QUERY

UPDATE

QUERY

UPDATE

QUERY

UPDATE

QUERY

10/23/2017
synapserUPDATEUPDATENOT APPLICABLE

UPDATE

UPDATE

Written to csv as "NA"

UPDATE

QUERY

When read into data.frame, each unique value becomes a column.

UPDATE

QUERY

When read into data.frame, each unique value becomes a column.

10/23/2017
  • No labels