def test_crystalmap2dict(self, temp_file_path, crystal_map_input): cm = CrystalMap(**crystal_map_input) cm_dict = crystalmap2dict(cm) this_dict = {"hello": "there"} cm_dict2 = crystalmap2dict(cm, dictionary=this_dict) cm_dict2.pop("hello") assert_dictionaries_are_equal(cm_dict, cm_dict2) assert np.allclose(cm_dict["data"]["x"], crystal_map_input["x"]) assert cm_dict["header"]["z_step"] == cm.dz
def test_dict2crystalmap(self, crystal_map): cm2 = dict2crystalmap(crystalmap2dict(crystal_map)) assert_dictionaries_are_equal(crystal_map.__dict__, cm2.__dict__)