You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With #289 , basis objects have __len__ and __iter__ methods. Should they also have __getitem__? This is only useful for AdditiveBasis, and would rely on storing something like np.fromiter(self.__iter__(), np.object_) (using arrays allows us to work with boolean indexing).
But the difficulty comes about with a tree structure, e.g.,:
a = Add(
Add(b1, b2),
Add(b3, b4),
)
Should a[1:] return
a = Add(
b1,
Add(b3, b4),
)
or
a = Add(
Add(b2, b3),
b4,
)
The first one respects the existing structure of a, but the second is much easier to create (just map sum over the remaining basis objects). The two should function identically, regardless.
Could get the first if we keep track of the tree structure, as used by the label.
(the atomic basis and multiplicative basis all can only accept 0 as just return themselves)
The text was updated successfully, but these errors were encountered:
With #289 , basis objects have
__len__
and__iter__
methods. Should they also have__getitem__
? This is only useful for AdditiveBasis, and would rely on storing something likenp.fromiter(self.__iter__(), np.object_)
(using arrays allows us to work with boolean indexing).But the difficulty comes about with a tree structure, e.g.,:
Should
a[1:]
returnor
The first one respects the existing structure of
a
, but the second is much easier to create (just mapsum
over the remaining basis objects). The two should function identically, regardless.Could get the first if we keep track of the tree structure, as used by the label.
(the atomic basis and multiplicative basis all can only accept
0
as just return themselves)The text was updated successfully, but these errors were encountered: