mmaelicke / scikit-gstat

Geostatistical variogram estimation expansion in the scipy style
https://mmaelicke.github.io/scikit-gstat/
MIT License
223 stars 53 forks source link

Syntax errors for Python3.4 #6

Closed lukaskrieger closed 6 years ago

lukaskrieger commented 6 years ago

Sorry that I didn't have more time to look into it right now. It seems to be a really nice module and exactly what I needed for a quick variogramm estimation.

But right out of the box there were some issues at least for me running Python 3.4

   File "scikit-gstat/skgstat/binning.py", line 125

    return np.matrix(bm), np.diff([0, *binubound])
                                     ^

SyntaxError: can use starred expression only as assignment target

and just by ignoring this with a simple fix I also got

  File "scikit-gstat/skgstat/optimize.py", line 149
    V = Variogram(**self.static, **{n:v for n,v in zip(self.names, combination)})
                               ^

SyntaxError: invalid syntax

Any idea if this is a problem only related to specific python versions?

lukaskrieger commented 6 years ago

So this was only an issue with Python3.4. Everything works fine in 3.5.4. I'll leave the issue open anyway.

mmaelicke commented 6 years ago

Hey, thanks for the comment.

In fact Python 3.4 does not support this syntax. It was added to Python 3.5 by PEP 448. I'm not sure how this could be backported to 3.4, as most of these lines would need a multiline workaround. But I will have a look into this.

For now, I will put a note into the Readme that this package is 3.5+. And I will leave the issue open until I have a more definite answer.

mmaelicke commented 6 years ago

Hey Lukas,

I am not sure if this is still of interest for you, but I am reworking most of the code at the moment in the dev branch of this repository. With the latest commit on that branch, it should run on Python 3.4 now. At least I added a Python 3.4 environment to the Tavis CI build and the tests do not fail anymore. I have not really used the module in Python 3.4 so far. However, there might be future complications as Python 3.4 only has old pandas, scipy and numpy versions, which might lead to problems in the future. In that case, I will kick the 3.4 tests out again. And I will close this issue now as it seems to be solved. Best

Mirko