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

A variable with non matching shapes for coordinates and data should throw an error? #86

Open
martinRenou opened this issue May 22, 2018 · 0 comments

Comments

@martinRenou
Copy link
Member

Creating a variable with non matching shapes for coordinates and data should throw an error.

Example with 3x3 data and 1x3 coordinates

using fstring = xtl::xfixed_string<55>;

using data_type = xt::xoptional_assembly<xt::xarray<double>, xt::xarray<bool>>;
using coordinate_type = xf::xcoordinate<fstring, data_type::size_type>;

using variable_type = xf::xvariable<coordinate_type, data_type>;
using variable_view_type = xf::xvariable_view<variable_type&>;
using saxis_type = xf::xaxis<fstring, std::size_t>; 
using iaxis_type = xf::xaxis<int, std::size_t>;

fstring abscissa = "abscissa";
fstring ordinate = "ordinate";

// Shape 3x3
data_type data1 = {{ 1., 2., 3.},
                  { 4., 5., 6.},
                  { 7., 8., 9.}};

// Shape 1x3 for the coordinates
auto var1 = variable_type(
    data1,
    {
        {abscissa, saxis_type({"a"})},
        {ordinate, iaxis_type({1, 2, 4})}
    }
);
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

1 participant