def test_msonable(self): sif = StructInputFile.from_file(os.path.join(test_dir, "Li.cif")) sif_dict = sif.as_dict() decoder = MontyDecoder() temp_sif = decoder.process_decoded(sif_dict) assert isinstance(temp_sif, StructInputFile) assert sif.structure == temp_sif.structure
def test_msonable(self): sif1 = StructInputFile.from_file(os.path.join(test_dir, "Li.cif")) sif2 = StructInputFile.from_file(os.path.join(test_dir, "Li2O.cif")) inp_set = InputSet( { "cif1": sif1, "cif2": sif2, }, kwarg1=1, kwarg2="hello", ) inp_set_dict = inp_set.as_dict() decoder = MontyDecoder() temp_inp_set = decoder.process_decoded(inp_set_dict) assert isinstance(temp_inp_set, InputSet) assert temp_inp_set.kwarg1 == 1 assert temp_inp_set.kwarg2 == "hello" assert temp_inp_set._kwargs == inp_set._kwargs for (fname, contents), (fname2, contents2) in zip(temp_inp_set, inp_set): assert fname == fname2 assert contents.structure == contents2.structure