Skip to content
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

Generalized method for adding tensors to display #158

Open
herbertludowieg opened this issue May 29, 2019 · 0 comments
Open

Generalized method for adding tensors to display #158

herbertludowieg opened this issue May 29, 2019 · 0 comments
Labels
Enhancement Extend an existing feature Visualizations Feature requests related to visualization functionality

Comments

@herbertludowieg
Copy link
Member

herbertludowieg commented May 29, 2019

Is your feature request related to a problem? Please describe.
With the new tensor objects that we have added, like the NMR shielding tensor, I think it would be great if we can add these to the universe so they can be displayed on the UniverseWidget. This way we can show them right on the molecule.

Describe the solution you'd like
I've been playing around with it and I think this would work well as we already have the functionality to display the tensors when we have a tensor attribute.

def add_tensor(self, uni):
    uni.tensor = self

Describe alternatives you've considered
Write to a file and them read them? This would be a terrible way to do it.

Additional context
The code outlined above would only work to add all of the tensors and does not allow the user to select which atoms to place them on or what frame. I would add additional keywords as they become needed to include these types of cases. Maybe like this

def add_tensor(self, uni, atom=None, frame=None):
    frame = 0 if frame is None else frame
    frame_grouped = self.groupby('frame').get_group(frame)
    atom = frame_grouped['atom'] if atom is None else atom
    uni.tensor = frame_grouped[frame_grouped.index.isin(atom.index)]

Then we might be able to extend this to show multiple frames as was suggested by @adamphil some time ago. This would all exist inside of the exatomic.core.tensor.Tensor class

@herbertludowieg herbertludowieg added the Enhancement Extend an existing feature label May 29, 2019
@tjduigna tjduigna added the Visualizations Feature requests related to visualization functionality label Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Extend an existing feature Visualizations Feature requests related to visualization functionality
Projects
None yet
Development

No branches or pull requests

2 participants