Closed deyulu closed 7 months ago
I think this is done @xhqu1981 @deyulu. Let me know if not and I'll re-open. I think I merged this some time ago.
Current implementation doesn't write metadata.json. Code in line 347 to 362 needs to be revised. It seems that "origin" is not in metadata.keys(). Do we really need "origin"? Can we just write this metadata.json under the materials ID dir? Another wishlist item. Currently, database.metadata["mpid"]["primitive"]) only works after database.write() is called. Can we get the info w/o calling database.write(), because this is simply a material attribute and doesn't depend on output?
@xhqu1981 what was the point of requiring the origin key?
@matthewcarbone @deyulu No, it doesn't. The requirement of an origin key was a legacy of the _write_origin_paths() function. Because _write_origin_paths() function is where the materials specific metadata JSON file is created, I don't have better place to put the multiplicities information. Previously, it doesn't create the JSON file if there is no origin because origin is only information it will contain. Now, we have other information to write, we can always create the metadata JSON file and refactor the _write_origin_paths() function to "_write_materials_metadata()".
Standard lightshow output doesn't contain the info on multiplicity of sites. This info is critical for computing average spectra of the crystal. It is a core function of lightshow, and we need to fix this. Perhaps an output file of "multiplicity.dat" with 3 columns: site index, multiplicity and weight.