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

Change FieldTimeSeries to behave like 1D vector? #2492

Closed
glwagner opened this issue Apr 28, 2022 · 1 comment
Closed

Change FieldTimeSeries to behave like 1D vector? #2492

glwagner opened this issue Apr 28, 2022 · 1 comment

Comments

@glwagner
Copy link
Member

This really depends where we want to take this abstraction.

One possibility is to develop "four-dimensional fields". This is sort of what the design reflects now (ie we subtype AbstractField, etc).

Another possibility is to ditch that and cement Fields as 3 dimensional and less, and commit the FieldTimeSeries abstraction to look like a 1D vector of 3D fields.

It seems like a subtle distinction, but is has some important consequences. For example, what should

first(fts::FieldTimeSeries)

return? If FieldTimeSeries is 4D then this is either parent(fts)[1, 1, 1, 1] or fts.data[1, 1, 1 ,1]. But if FieldTimeSeries is 1D this is fts[1] --- the first Field. I think it's nice to have first(fts) and last(fts) return fields --- we use stuff like that a lot, but right now we are forced to write stuff like

Nt = length(fts.times)
fts[Nt]

kind of annoying.

Right now the API is hybrid; ie we have getindex(fts, i) and getindex(fts, i, j, k, n). But we use the "vector" abstraction more than the "4D field mode" a lot more I think.

One downside is that this might preclude defining a ∂t abstract operation.

I don't think this impacts support for reductions, but I have to think about that.

@glwagner
Copy link
Member Author

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant