mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-19 19:08:11 +08:00
* improve HTTP error reporting * generate standards-compatible JSON * add --nan-to-num work-around for non-finite floating point values * lint * update tests * correctly set Infinities to min/max * REAMDE update for --nan-to-num * define constant for repetitive warning message * clarify where NaN errors will occure
31 lines
599 B
Python
31 lines
599 B
Python
from enum import Enum
|
|
|
|
|
|
DEFAULT_TOP_N = 10
|
|
|
|
|
|
class AugmentedEnum(Enum):
|
|
def __hash__(self):
|
|
return self.value.__hash__()
|
|
|
|
def __eq__(self, other):
|
|
if isinstance(other, type(self)) or isinstance(other, str):
|
|
return self.value == other
|
|
return False
|
|
|
|
def __str__(self) -> str:
|
|
return self.value
|
|
|
|
|
|
class Axis(AugmentedEnum):
|
|
OBS = "obs"
|
|
VAR = "var"
|
|
|
|
|
|
class DiffExpMode(AugmentedEnum):
|
|
TOP_N = "topN"
|
|
VAR_FILTER = "varFilter"
|
|
|
|
|
|
JSON_NaN_to_num_warning_msg = "JSON encoding failure - suggest trying --nan-to-num command line option"
|