-
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
Default to lattice from trajectory for analysis #198
Comments
Hi @AstyLavrinenko , I'm looking at this, but I don't see any instances where it takes the structure lattice over the trajectory lattice. Do you have an example where this goes wrong? |
Hi @stefsmeets, The issue isn't specifically tied to However, when it comes to the density plot, things get a bit tricky. The problem arises, for instance, when dealing with the structure:
This leads to plotting different lattices for the trajectory and the crystallographic positions extracted from the A similar problem appears during shape analysis. There's a warning, I think, users shouldn't be forced into lattice matchmaking. Therefore, we couldn't make it so that the lattices must be the same. |
Thanks for the clarification, would this help for plotting? Meaning you can specify your custom lattice to override the vol/structure lattices? plots.density(
vol = volume,
structure = structure,
force_lattice = volume.lattice,
) |
Yes, I think it's perfect. And if someone wants to check visually the mismatch, |
I have two suggestions, either make the sites, lattice and space group directly configurable: unique_sites = [sites[0] for sites in symmetrized_structure.equivalent_sites]
sa = ShapeAnalyzer(
sites=sites,
lattice=trajectory.lattice,
spacegroup=symmetrized_structure.spacegroup,
)
sa.analyze_trajectory(trajectory) Or pass the lattice and drag it along: sa = ShapeAnalyzer.from_structure(structure)
sa.analyze_trajectory(trajectory, force_lattice=trajectory.lattice) I think the first has my preference, the second is going to be really ugly to program, and conceptually does not fit with the class structure. |
I think we can go with the first option. And using |
SitesData
should prefer the lattice from the trajectory instead of model structure. i.e. just load fractional coords from ideal structure.We could also make it so that the lattices must be the same, so that the user needs to take care of this. Alternative, perhaps scale input ideal lattice to trajectory to enforce lattices are the same.
The text was updated successfully, but these errors were encountered: