Closed 1ozturkbe closed 3 years ago
what does "allowed by cmd" mean?
the way row-size is chosen is a bit overly complicated, so feel free to tag me in on this on
As in, 'my terminal is blowing up, past its ability to contain text', since the output is many pages long. Now that I look at the f'ns for table() I would like some help here :)
(this model has 600 vars or so, and it's all presented in a one dimensional vector form haha)
does adding a new line after 780 which reads ncols = 5
(or some other constant) lead to an acceptable table output? If so, the solution may be just to allow the user to hard-code the number of columns. This will create confusion between 1D and 2D variables, which is why we don't do it now...
You could also, without changing the code, do .table(maxcols=600)
and see if that looks ok
That is definitely much nicer (I tried 5). Maybe it is best to leave it to the user. But I also don't mind the format where we have ellipses, and you could set the cutoff in ncols.
Then if the user wants to be able to dig in, they can just call sol('varname'), because then it prints a flat vector.
I like the max columns, but it would also be nice to specify ncols like we did in this case.
I don't think users should be able to specify ncols
, because it makes it impossible to distinguish 2D and 1D variables...I like the notion of cutoffs, though.
What's your ideal table output?
I think it'd be like this... [ X X ... X X ; X X ... X X ; | | | | ; (could just be a single line indicating continuation). X X ... X X ;]
I think it's rather impossible to look at more than 5-8 values per row of anything anyways, so we might as well have some arbitrary cutoff.
in a fixed-width format, is this equivalent? (arbitrary cutoff doesn't work for all use-cases)
[ x1 x2 ... x101 x102
x103 x104 ... x203 x204
...
x503 x504 ... x599 x600 ]
what about this instead? (since it's a 1d vector) I'd implement this with a maxrows
parameter
[ x1
x2
...
x599
x600 ]
Hmmm, it is useful to have some notion of 1D/2D I guess. Would it be possible to specify multiple rows for 2D vectors, single row for everything else?
yup! you mean multiple columns, right?
I'm thinking default maxrows = 50
, and anything above that gets chopped down to maxrows.
Oh I was thinking having rows instead of columns for each output. Columns are confusing because the units and descriptions start floating far away.
unfortunately having more than a few columns destroys readability in many terminals because they deal with linewrapping terribly.
I get this creates issues with 2D arrays, but I still think it makes sense to arbitrarily truncate and/or wrap in this case. I think it is worse to have a table that is a page long in each variable, than to have some outputs not showing immediately.
yeah, i think maybe just taking anything that exceeds max rows and showing it in a single line as [ x1 ...(98 values skipped)... x100] is making the most sense to me
On Thu, Oct 17, 2019, 11:57 Berk Ozturk notifications@github.com wrote:
I get this creates issues with 2D arrays, but I still think it makes sense to arbitrarily truncate and/or wrap in this case. I think it is worse to have a table that is a page long in each variable, than to have some outputs not showing immediately.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/convexengineering/gpkit/issues/1444?email_source=notifications&email_token=AALKAGFBRIPQLIEH7MBAW2DQPCDLZA5CNFSM4JB3FCXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBQTREA#issuecomment-543242384, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALKAGB4O3WUQ37CKAUSXK3QPCDLZANCNFSM4JB3FCXA .
But then why not just show maxrows, equal to maxrows? (eg. [X X ... X X])?
not following how that's different?
oh, it's instead of skipping 98 values, you skip 100-maxcols.
Looking at this a bit later, I think GPkit should always print all info - users can filter by changing which tables/variables they print.
This is for EGPAnet, where I am trying to read the output of very large VectorVariables, some of them 20 long. GPkit likes printing these in a nice long vertical vector, which makes the output actually exceed the length allowed by cmd. I will make a fix.