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 modifying LaserFrame to return views into allocated arrays #81

Open
clorton opened this issue Oct 29, 2024 · 0 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@clorton
Copy link
Contributor

clorton commented Oct 29, 2024

Currently users have to use the count property of a LaserFrame to determine how many slots are active. It might be good syntactic sugar for lf.property to actually return lf.property[0:lf.count] so the user doesn't have to do that each time.

Might require "property" to be allocated internally as "_property" to get access to the full array while lf.property returns the view.

I.e.,

lf.add_scalar_property("property") -> setattr(self, "_" + name, np.full(self._capacity, default, dtype=dtype))
lf.property -> lf._property[0:lf.count]

@clorton clorton added the enhancement New feature or request label Oct 29, 2024
@clorton clorton added this to the Cholera "Shadow" Model milestone Oct 29, 2024
@clorton clorton self-assigned this Oct 29, 2024
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