-
Notifications
You must be signed in to change notification settings - Fork 41
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
Numpy: Slicing is missing the stepping #197
Comments
cc'ing @PrometheusPi, @ax3l |
You really do not want to stride during reads anyway for performance. Read all into a temporary var and stride in RAM :) |
Minimal "working" example, e.g. with the file from ax3l's issue #69 import adios as ad
f = ad.file("data_compressed.bp")
f["xy"][0, :6:2] == f["xy"][0, :3] gives [True, True, True]. I think this should be considered a bug. The proper way of handling this should be raising a A fix in python (the wrapper is not written in python, is it? I will post some pseudocode anyway^^) would be: def __getitem__(self, key):
if isinstance(key, slice) and slice.step is not None:
raise NotImplementedError
return super().__getitem__(key) |
@n01r @ax3l @wmles we are currently supporting in ADIOS2 the Python low-level and high-level APIs. You can see then in action using Jupyter Notebooks running on MyBinder (see ReadMe): https://github.com/ornladios/ADIOS2-Jupyter A few things about high-level APIs:
Let me know if this is something of interest, ADIOS2 readers should be able to handle ADIOS1.x generated files. Thanks! |
Dear all,
I noticed that when accessing an adios variable with
[]
for slicing in numpy style the stepping functionality is missing.For numpy arrays you can access every
N
th entry in a dimension by doingarray[::N]
.However, if I do the same with an adios variable (which I want to do before I load it into RAM and thus before it is converted to a numpy array) it seems that the following is happening:
The usage of a third (
step
) variable is numpy-like but doesn't follow the numpy behaviour.Currently, neither documentation nor error message indicates a misuse.
The text was updated successfully, but these errors were encountered: