def test_hybridcloud_pkl_interface():
    hc = test_hybridcloud_load()
    fname = f'{test_dir}/test_hc.pkl'
    try:
        hc.save2pkl(fname)
        hc2 = HybridCloud()
        hc2.load_from_pkl(fname)
        assert hc == hc2
    finally:
        if os.path.isfile(fname):
            os.remove(fname)
Example #2
0
def load_obj(
        data_type: str, file: str
) -> Union[HybridMesh, HybridCloud, PointCloud, CloudEnsemble]:
    if data_type == 'obj':
        return basics.load_pkl(file)
    if data_type == 'ce':
        return ensembles.ensemble_from_pkl(file)
    if data_type == 'hc':
        hc = HybridCloud()
        return hc.load_from_pkl(file)
    if data_type == 'hm':
        hm = HybridMesh()
        return hm.load_from_pkl(file)
    else:
        pc = PointCloud()
        return pc.load_from_pkl(file)