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

Ufuncs could support external classes #747

Open
pfebrer opened this issue Apr 12, 2024 · 4 comments
Open

Ufuncs could support external classes #747

pfebrer opened this issue Apr 12, 2024 · 4 comments

Comments

@pfebrer
Copy link
Contributor

pfebrer commented Apr 12, 2024

E.g. in the case of Geometry there are implementations to convert from/to ASE atoms. So with a simple wrapper it should be easy to support:

import ase

import sisl

# Define a structure as an ase atoms object
geometry = ase.Atoms(...)

# Get the rotated ase atoms object
rotated_geometry = sisl.rotate(geometry, 30, [0,0,1])

I think it would be quite cool. It would be similar to how numpy can apply operations on many objects, although the implementation would be different in the sense that is based on sisl implementing the converters.

@zerothi
Copy link
Owner

zerothi commented Apr 12, 2024

This could be cool, but I think it has very low priority. There are soo many issues open that I think we should try to finish some of them ;)

I also can't really see who will use it? Much of the functional methods are also done in other codes, with slightly different API's, so my bet is that if somebody is using ase, then they would stick with that. :)

@pfebrer
Copy link
Contributor Author

pfebrer commented Apr 12, 2024

I would see this being useful if some function is not implemented in ASE, or it has an API that is more complicated to acheive a certain goal. If someone asks how to acheive that thing in Matter Modelling, then you can answer: "use this function in sisl". And you will have introduced sisl to them with minimal friction :)

@zerothi
Copy link
Owner

zerothi commented Apr 12, 2024

I don't really mind if it is a small pr, but I don't think you should spend tons of time on this, I would still prefer some help on thinking about the categories, and how we can solve that issue ;)

@pfebrer
Copy link
Contributor Author

pfebrer commented Apr 12, 2024

I will leave the issue here, I don't want to work on it for now, it was just an idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants