def test_io_equality_on_examples(self): from physt.examples import munros # for example in ALL_EXAMPLES: h = munros() json = h.to_json() read = io.parse_json(json) assert h == read
def test_json_write_collection(self): bins = [1.2, 1.4, 1.5, 1.7, 1.8 ] values1 = [4, 0, 3, 7.2] values2 = [14, 10, 13, 17.2] col = HistogramCollection() col.add(Histogram1D(bins, values1)) col.add(Histogram1D(bins, values2)) json = col.to_json() read = io.parse_json(json) assert read == col
def test_simple(self): h = physt.h2(None, None, "integer", adaptive=True) h << (0, 1) json = h.to_json() read = io.parse_json(json) assert h == read