Skip to content

float indices in Python bindings #53

@rmchurch

Description

@rmchurch

I would recommend supporting floats for indexing with the Python Adios bindings, similar to the h5py package for HDF5 files in Python. See below.

In h5py, the following works:
In [25]: file_path5='file.h5'
In [26]: f5 = h5py.File(file_path5)
In [27]: d1 = f5[data_path][:,1,:]
In [28]: d2 = f5[data_path][:,1.,:]

In adios, we get an error when using a float to slice:
In [29]: file_path=''file.bp'
In [30]: f = ad.file(file_path)
In [31]: d1 = f[data_path][:,1,:]

In [32]: d2 = f[data_path][:,1.,:]

AttributeError Traceback (most recent call last)
in ()
----> 1 d2 = f[data_path][:,1.,:]

adios.pyx in adios.var.getitem (adios.cpp:14190)()

AttributeError: 'float' object has no attribute 'step'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions