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

Documentation is out of date #57

Open
dzenanz opened this issue Dec 17, 2021 · 2 comments
Open

Documentation is out of date #57

dzenanz opened this issue Dec 17, 2021 · 2 comments

Comments

@dzenanz
Copy link
Contributor

dzenanz commented Dec 17, 2021

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.;.

@litxiaoyao
Copy link

Oh, I have encountered this problem too!! And I'm shocked that so many years passed but up-to-date APIs or Usage codes are didn't modified to match the package...

@litxiaoyao
Copy link

Moreover, how to modify this error?
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.;.

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

2 participants