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

Make Adapter sliceable #274

Open
LarsKue opened this issue Dec 9, 2024 · 0 comments
Open

Make Adapter sliceable #274

LarsKue opened this issue Dec 9, 2024 · 0 comments
Assignees
Labels
feature New feature or request

Comments

@LarsKue
Copy link
Contributor

LarsKue commented Dec 9, 2024

Currently, the Adapter is implemented as a series of transforms.

It would be nice if indexing or slicing the Adapter would yield another valid Adapter, in the form of:

adapter = bf.Adapter().rename("x", "y").rename("y", "z").rename("z", "y").rename("y", "x")
rename_x_to_y = adapter[0]
rename_x_to_z = adapter[0:2]

assert isinstance(rename_x_to_y, bf.Adapter)

We could also allow assigning an adapter to a slice then, in the form of:

adapter = ...
adapter[0:2] = bf.Adapter().rename("x", "z")
@LarsKue LarsKue added the feature New feature or request label Dec 9, 2024
@LarsKue LarsKue added this to the BayesFlow 2.0 milestone Dec 9, 2024
@paul-buerkner paul-buerkner removed this from the BayesFlow 2.0 milestone Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
Status: Future
Development

No branches or pull requests

3 participants