Closed agoose77 closed 5 years ago
Thanks for reporting! I'll see if I can fix it
@agoose77 Can you tell me what version of xtensor
you are using? I tried your code example both using master
and using 0.19.1
on binder and could not see the issue
@martinRenou I just tried it and it seems fixed. Apologies - this was mainly something I wanted to come back and check once I had recreated my conda environment. I think it's fixed, given that this example definitely failed at one point.
Ok, thanks for reporting anyway :) feel free to reopen the issue if it shows up again.
Sorry @martinRenou, I've found a new corner case:
#include <iostream>
#include "xtensor/xarray.hpp"
#include "xtensor/xio.hpp"
#include "xtensor/xview.hpp"
#include "xcpp/xdisplay.hpp"
unsigned long n = 5;
unsigned long j = 100;
{
xt::xarray<double> arr = xt::arange(n*j*n);
arr.reshape({n,j,n});
xcpp::display(arr);
}
| |||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||
|
Here's the same output in the numpy_html
implementation:
| |||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
|
That was quick :P
I will open an other PR replacing the ellipsis by unicode characters. Thanks!
Thanks for doing the leg work! To be honest, it's slightly tricky to get right, and I found the Python generators made the whole thing far easier :P Awesome, will keep my eyes open!
It seems that there is a bug in the rich rendering of arrays. I haven't tested this for a little while, but I haven't seen any mention of this being fixed.
This produces this output.
I have a numpy implementation inspired by xtensor, which doesn't have these bugs. I'm placing it here for reference: this issue is mainly just for bookkeeping.
Additionally, we could use unicode characters for the ellipses (e.g for the diagonals).