Hi,
ok I'm really sorry that adding Python support now leads to additional
bugs and problems, but I hope these are just toothing pains:
First, a prelim question: In the gretl_io.py file that gretl writes out,
why use this function
<python>
def gretl_dotdir():
dotdir = "C:/Users/svenne/AppData/Roaming/gretl/"
return dotdir
</python>
instead of just a plain string definition 'gretl_dotdir =
"<whatever>"'?
Secondly, in the 'gretl_export()' function (also in gretl_io.py) the
seemingly innocuous line
'r, c = M.shape'
might be problematic for vectors (given the next issue this is currently
hard to test, but I will). The point is that in numpy vectors may be
represented as 1-dim-arrays; their 'shape' tuple will be '(n,)' and thus
have only length one. I guess there are two solutions; either do a check
like 'len(M.shape)==1', or force M to be a numpy-matrix which is
guaranteed to be 2-dim like gretl matrices. Let me test and then think
about it.
Third, a real problem: The gretltmp.py file written by gretl does not
preserve the indentation from within gretl's foreign block! Since Python
uses indentation/whitespace as a syntax element, this is completely
broken. Allin, your example in ch. 39 doesn't have any indented blocks
it seems, and so you didn't notice. BTW, this is on Windows 8, haven't
tested on Linux yet.
And finally, another indentation-related less severe problem: gretl's
script editor's on-the-fly indentation is a little annoying when writing
in Python because it does it wrong (understandably). Could this be
somehow turned off inside foreign blocks?
Thanks,
Sven