def test_single(self, experiment_run, strs): key = strs[0] attr = data_types.Line( x=[1, 2, 3], y=[1, 4, 9], ) experiment_run.log_attribute(key, attr) assert experiment_run.get_attribute(key) == attr._as_dict()
def test_single(self, model_version, strs): key = strs[0] attr = data_types.Line( x=[1, 2, 3], y=[1, 4, 9], ) model_version.add_attribute(key, attr) assert model_version.get_attribute(key) == attr
def test_line(self): attr = data_types.Line( x=[1, 2, 3], y=[1, 4, 9], ) assert attr._as_dict() == { "type": "verta.line.v1", "line": { "x": [1, 2, 3], "y": [1, 4, 9], }, }
def test_line_numpy(self): np = pytest.importorskip("numpy") attr = data_types.Line( x=np.array([1, 2, 3]), y=np.array([1, 4, 9]), ) assert attr._as_dict() == { "type": "verta.line.v1", "line": { "x": [1, 2, 3], "y": [1, 4, 9], }, }
def test_line(self): attr = data_types.Line( x=[1, 2, 3], y=[1, 4, 9], ) d = { "type": "verta.line.v1", "line": { "x": [1, 2, 3], "y": [1, 4, 9], }, } assert attr._as_dict() == d assert attr == data_types._VertaDataType._from_dict(d)