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

Add JSON serialization and deserialization of xtensor containers #830

Merged
merged 1 commit into from
May 6, 2018

Conversation

SylvainCorlay
Copy link
Member

No description provided.

detail::json_shape(j, s);

// In the case of a view, we check the size of the container.
if (!std::equal(s.cbegin(), s.cend(), e.shape().cbegin()))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should factor this out, like in xt::resize_container and make a xt::resize_expression free function, that resizes in the case of a container_semantic and throws if shape is wrong in case of view_semantic?
Could be useful for other cases in the future.

enable_xcontainer<E> from_json(const nlohmann::json&, E&);

template <class E>
enable_xview<E> from_json(const nlohmann::json&, E&);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we call this enable_xview_semantics instead? (idem for containers)

@SylvainCorlay
Copy link
Member Author

Added some documentation.

Despite @cond and @endcond, doxygen complains about multiple matches.

@SylvainCorlay
Copy link
Member Author

Hum, I am getting this sort of error in the documentation because of the multiple matches despite of the @cond and @endcond statements.

screen shot 2018-05-02 at 12 11 53 pm

@SylvainCorlay
Copy link
Member Author

OK, the documentation issue is fixed. This is ready to go IMO.

@SylvainCorlay SylvainCorlay merged commit da14742 into xtensor-stack:master May 6, 2018
@SylvainCorlay SylvainCorlay deleted the xjson branch May 6, 2018 10:13
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

Successfully merging this pull request may close these issues.

2 participants