Skip to content

Documentation is out of date #57

Description

@dzenanz

https://xtensor-zarr.readthedocs.io/en/latest/basic_usage.html and https://github.com/xtensor-stack/xtensor-zarr/blob/master/README.md#usage are in sync with each other, but in significant dissonance with the code. Create an array example fails to compile with:

9>itkOMEZarrNGFFImageIOTest.cxx
9>C:\Dev\ITKIOOMEZarrNGFF\test\itkOMEZarrNGFFImageIOTest.cxx(50,21): error C2672: 'xt::xzarr_hierarchy<xt::xzarr_file_system_store>::create_array': no matching overloaded function found
9>C:\Dev\ITKIOOMEZarrNGFF\test\itkOMEZarrNGFFImageIOTest.cxx(61,5): error C2780: 'xt::zarray xt::xzarr_hierarchy<xt::xzarr_file_system_store>::create_array(const std::string &,shape_type,shape_type,const std::string &,O)': expects 5 arguments - 10 provided
9>C:\Libs\xtensor-zarr\include\xtensor-zarr/xzarr_hierarchy.hpp(48): message : see declaration of 'xt::xzarr_hierarchy<xt::xzarr_file_system_store>::create_array'
9>C:\Dev\ITKIOOMEZarrNGFF\test\itkOMEZarrNGFFImageIOTest.cxx(63,5): error C2064: term does not evaluate to a function taking 2 arguments
9>Done building project "IOOMEZarrNGFFTestDriver.vcxproj" -- FAILED.

And an attempt to modify it to work:

  {
    // create a hierarchy on the local file system
    xt::xzarr_file_system_store store("test.zr3");
    auto h = xt::create_zarr_hierarchy(store);

    // create an array in the hierarchy
    nlohmann::json attrs = { {"question", "life"}, {"answer", 42} };
    using S = std::vector<std::size_t>;
    S shape = { 4, 4 };
    S chunk_shape = { 2, 2 };

    xt::zarray a = h.create_array(
      "/arthur/dent",  // path to the array in the store
      shape,  // array shape
      chunk_shape,  // chunk shape
      "<f8"  // data type, here little-endian 64-bit floating point
    );

    // write array data
    a(2, 1) = 3.;
  }

results in C:\Dev\ITKIOOMEZarrNGFF\test\itkOMEZarrNGFFImageIOTest.cxx(60,5): error C2064: term does not evaluate to a function taking 2 arguments at line a(2, 1) = 3.;.

Activity

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

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