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

Indexing several time-steps not working #32

Open
VEZY opened this issue Jan 13, 2025 · 0 comments
Open

Indexing several time-steps not working #32

VEZY opened this issue Jan 13, 2025 · 0 comments

Comments

@VEZY
Copy link
Member

VEZY commented Jan 13, 2025

Indexing a TimeStepTable with a range should return a TimeStepTable (or a view of the first one), but it returns an error:

ts = Weather([Atmosphere(T = 20.0, Wind = 1.0, P = 101.3, Rh = 0.65), Atmosphere(T = 20.0, Wind = 1.0, P = 101.3, Rh = 0.65)])

Indexing like a dataframe:

ts[1:2,:]
ERROR: MethodError: no method matching getindex(::TimeStepTable{Atmosphere{…}}, ::UnitRange{Int64}, ::Colon)
The function `getindex` exists, but no method is defined for this combination of argument types.

Indexing like a vector:

ts[1:2]
ERROR: type NamedTuple has no field 1:2
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