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

Generalize Array interface to behave like a table #41

Open
bgroenks96 opened this issue Feb 3, 2022 · 2 comments · May be fixed by #44
Open

Generalize Array interface to behave like a table #41

bgroenks96 opened this issue Feb 3, 2022 · 2 comments · May be fixed by #44

Comments

@bgroenks96
Copy link
Collaborator

bgroenks96 commented Feb 3, 2022

It's kind of weird that AbstractModel implements a Table interface but the Array interface (size, length, getindex, setindex, etc) behaves a like a vector of Params.

It would be really useful for AbstractModel to live up to its aspirations to be a real Table and allow itself to be indexed as such.

This has the potential to address #21 and #34 since it would allow for things like:

m = Model(obj)
m[.!m[:isconstant], :val] .= values

i.e. permitting both row and column indexing.

I will take a crack at it and submit a PR since this would solve a problem I am facing at the moment.

@bgroenks96
Copy link
Collaborator Author

@rafaqz do we need setindex! for AbstractModel to be allocation-free and type stable?

@rafaqz
Copy link
Owner

rafaqz commented Feb 3, 2022

I dont know, but probably it cant be?

Can we use setindex for StaticModel as the type stable option?

@bgroenks96 bgroenks96 linked a pull request Feb 4, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants