Closed stefsmeets closed 3 months ago
Hi @SCiarella , could you have a look at this PR and let me know what you think?
Actually, I'm not sure if I like this implementation.
I think I'd maybe rather go for something simpler.
@dataclass
class Volume:
data: dict[str, np.ndarray]
lattice: Lattice
label: str
units: Optional[...]
A = Volume(data=..., lattice=...)
B = Volume(data=..., lattice=...)
A.to_vasp_volume(structure=structure, other={'vol_b':B})
An additional requirement is to then move find_peaks()
out of find_best_perc_path()
to avoid 2 different data types.
Hi @SCiarella Could you have another look? I ended up revising the Volume
class to solve a bunch of outstanding issues. Some of it affects the paths module, but I think the result is cleaner overall.
Hi @SCiarella , did you have a chance to look at this yet?
Thanks! Yeah, that would be useful. The issue I ran into is that this would require passing both the volume and the free energy, and I wanted to not have to provide both here. I think passing peaks makes it more clear what is happening and allows users to pass their own set of peaks.
We could default to finding the peaks (when peaks==None
) from the free energy. That requires a modification to the peak finding algorithm to find local minima.
This PR updates the
Volume
class to store multiple data volumes, mimicking pymatgen'sVolumetricData
. This makes some things a bit easier, like grouping similar data types and being able to write all data volumes to a vesta file in one go. The downside is that it needs a bit more management of the data keys (e.g. for plotting). Maybe that is something that can be simplified later.I considered using
VolumetricData
as a base class, but it requires a structure, which we don't necessarily have.Closes #281
TODO
.resolution
/ calculate it on the flyvoxel_size
is redundant withresolution