nadeemlab / SPT

Spatial profiling toolbox for spatial characterization of tumor immune microenvironment in multiplex images
https://oncopathtk.org
Other
21 stars 2 forks source link

handle json-incompliant floats from OnDemandProvider #238

Closed CarlinLiao closed 1 year ago

CarlinLiao commented 1 year ago

To close #218, I edited PendingProvider to convert inf and nan values fetched from the quantitative feature value table to None to address downstream issues with conversion to JSON. (Tests pass.)

If we don't want to convert inf and nan values until right before the returned values are converted to JSON, instead we could apply a similar processing step to the returned metrics dict in OnDemandRequestHandler._handle_squidpy_request and _handle_proximity_request.

jimmymathews commented 1 year ago

Haven't completely 100% tested in application, but the tests pass and the resulting containers run without errors so far. Should still try to reproduce the nan's and test in final usage.