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

Implement recursive columnaccess and rowaccess #44

Open
neonWhiteout opened this issue Jul 24, 2023 · 0 comments
Open

Implement recursive columnaccess and rowaccess #44

neonWhiteout opened this issue Jul 24, 2023 · 0 comments

Comments

@neonWhiteout
Copy link
Collaborator

StockAndFlowF is currently stored as a NamedTuple of ACSetTables. NamedTuples such that T <: NTuple{N, AbstractVector} implement columnaccess, and ACSetTable implements column access, but this doesn't work recursively; that is, when accessing the tables of a StockAndFlowF, one columnaccess is false. If I understand correctly, though, it wouldn't be wrong to define it to be true for NamedTuples of ACSetTables or ACSetTables of NamedTuples; it simply means that accessing it is O(1), and we can just define columns(x) = x.

Intention is to be able to manipulate StockAndFlowF tables using Table Operations.

It may fall on Catlab.DenseACSets to implement this instead.

I've implemented a bit of a workaround which works specifically with NamedTuples containing ACSetTables:

const NamedACSetTable = NamedTuple{names, T} where {names, T <: NTuple{N, ACSetTable} where N}
Tables.columnaccess(x::NamedACSetTable) = true
Tables.columns(x::NamedACSetTable) = x

Tables.rowaccess(x::NamedACSetTable) = true

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

No branches or pull requests

1 participant