sisl icon indicating copy to clipboard operation
sisl copied to clipboard

Ufuncs could support external classes

Open pfebrer opened this issue 10 months ago • 4 comments

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.

pfebrer avatar Apr 12 '24 15:04 pfebrer

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. :)

zerothi avatar Apr 12 '24 18:04 zerothi

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 :)

pfebrer avatar Apr 12 '24 19:04 pfebrer

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 ;)

zerothi avatar Apr 12 '24 20:04 zerothi

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

pfebrer avatar Apr 12 '24 20:04 pfebrer