Git Product home page Git Product logo

Comments (4)

n01r avatar n01r commented on July 30, 2024 1

cc'ing @PrometheusPi, @ax3l

from adios.

wmles avatar wmles commented on July 30, 2024 1

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 ValueError or a NotImplementedError (if it's possible that adios will support stepping at some time - which could be useful if you do not think about performance but the array does not fit into RAM - which was the case for Marco).
The current implementation masks the problem, since the shape of the returned array is as expected, so in the worst case a user just doesn't notice that he got the wrong data!

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)

from adios.

williamfgc avatar williamfgc commented on July 30, 2024 1

@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:

  1. We don't have slicing/stride numpy syntax, high-level APIs are write/read based and are selection/random access (np_array = read("var", start, count, step_start, step_count)) and/or step-by-step based (using for step in stream). As in the spirit of Python we heavily overload these 2 functions, but read always returns a numpy array. For examples see:
    https://github.com/ornladios/ADIOS2/blob/master/testing/adios2/bindings/python/TestBPWriteTypesHighLevelAPI.py
  2. We are maintaining these APIs and potentially adding more features. e.g. compression: https://github.com/ornladios/ADIOS2/blob/master/testing/adios2/bindings/python/TestBPZfpHighLevelAPI.py

Let me know if this is something of interest, ADIOS2 readers should be able to handle ADIOS1.x generated files. Thanks!

from adios.

ax3l avatar ax3l commented on July 30, 2024

You really do not want to stride during reads anyway for performance. Read all into a temporary var and stride in RAM :)

from adios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.