-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Volume class to support multiple data types #282
Conversation
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 |
Co-authored-by: SCiarella <58949181+SCiarella@users.noreply.github.com>
Co-authored-by: SCiarella <58949181+SCiarella@users.noreply.github.com>
Hi @SCiarella Could you have another look? I ended up revising the |
Hi @SCiarella , did you have a chance to look at this yet? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks superb! 👍
The only minor comment that I have is that the percolating path is now computed using:
peaks = vasp_path_vol.find_peaks()
F = vasp_path_vol.get_free_energy(temperature=650.0)
path = find_best_perc_path(F,
peaks=peaks,
percolate_x=True,
percolate_y=False,
percolate_z=False)
maybe we can make the .find_peaks()
automatic, such that the user does not always have to pass it to find_best_perc_path
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 |
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