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

Consider making LaserFrame subscriptable to be data driven #104

Open
clorton opened this issue Jan 14, 2025 · 0 comments
Open

Consider making LaserFrame subscriptable to be data driven #104

clorton opened this issue Jan 14, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@clorton
Copy link
Contributor

clorton commented Jan 14, 2025

It could be useful to access a "column" in a LaserFrame from data, e.g.

frame.agents[propertyname] # Where propertyname is a string, e.g. "age"

A more verbose alternative (admittedly Pythonic, but clunky) is the following:

getattr(frame.agents, propertyname)

Basically, LaserFrame.__getitem__(propertyname) would call getattr() so that laserframe[propertyname] would work. We would not implement LaserFrame.__setitem__() as this should be done through add_scalar_property() etc.

@clorton clorton added the enhancement New feature or request label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant