sisl
sisl copied to clipboard
Geometry collections
I though it could be useful to have a class to store multiple geometries.
This came to my mind when I needed to treat an animation, therefore I have also implemented reading multiple geometries from an xyzSile as an example.
My idea here is that you can operate simultaneously on all the geometries, not only independently but also based on some reference geometry (e.g. the first one). You could also use this class to easily track how the geometry is evolving or interpolate steps between geometries, which would be useful for NEB or to render animations with higher fps/resolution, for example.
This is just a sketch to know your opinion about it.
Note:
If you believe this is a good idea, I need to find the best way use the methods from the Geometry
class on all geometries of the collection, which are stored in a list.
One option would be to make GeometryCollection
inherit from Geometry
and decorate all the methods in the Geometry
class so that they check whether they have been called from a geometry instance or from a collection and act accordingly. But I'm not sure if there is a better way to do it.
Codecov Report
Merging #167 into master will decrease coverage by
0.04%
. The diff coverage is70.45%
.
@@ Coverage Diff @@
## master #167 +/- ##
==========================================
- Coverage 85.23% 85.18% -0.05%
==========================================
Files 115 115
Lines 18725 18751 +26
==========================================
+ Hits 15960 15973 +13
- Misses 2765 2778 +13
Impacted Files | Coverage Δ | |
---|---|---|
sisl/io/xyz.py | 100% <100%> (ø) |
:arrow_up: |
sisl/geometry.py | 86.58% <38.09%> (-0.72%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update ef9505a...1606a18. Read the comment docs.
Thanks for the MR, I think this is a good idea. I will give this some thought and probably implement it in another way (to generalize for all objects).
Nice, that would definitely be the best scenario. It would be helpful for plots to make animations too (I already implemented it with my own approach, but if there is a general way that would be great).
Superseeded by #545 thanks for comments and ideas!