Giter Site home page Giter Site logo

Python 3 Support about pykriging HOT 14 CLOSED

capaulson avatar capaulson commented on July 19, 2024 4
Python 3 Support

from pykriging.

Comments (14)

capaulson avatar capaulson commented on July 19, 2024 1

Hey @Jwely @mattharrigan, I've just started a new branch aimed at moving to Python3. There are likely to be a large number of bugs, but it seems that the basic functionality for at least 2D plotting is there.

See: https://github.com/capaulson/pyKriging/tree/Python3-Support

More coming shortly, I'll leave open until Python3 support is in master.

from pykriging.

capaulson avatar capaulson commented on July 19, 2024

It doesn't support Python3 now, but shouldn't be too difficult to port. It's on the todo list, but please feel free to start a Python3 branch!

from pykriging.

Jwely avatar Jwely commented on July 19, 2024

+1

Lack of python3 was a total showstopper for me. If a scikit-learn GaussianProcess implementation doesn't seem easier for my use case I may port this myself.

from pykriging.

capaulson avatar capaulson commented on July 19, 2024

To get this to work I needed to run the following in Ubuntu 16.04:

apt-get install python3-pip python3-numpy python3-matplotlib python3-scipy
pip3 install inspyred
apt-get install python3-cairocffi

I've attached a screen shot of the expected result.
first_python3_result

from pykriging.

capaulson avatar capaulson commented on July 19, 2024

Also, to install the Python3 version, you would do:

git clone https://github.com/capaulson/pyKriging.git
(or git pull, if you've already cloned it)
git checkout Python3-Support
python3 setup.py install

edit: seems that the plotting library for 3D isocontour on my system isn't running. seems that you need vtk compiled with Python3 support. I'm trying to build vtk following these instructions: http://ghoshbishakh.github.io/blog/blogpost/2016/07/13/building-vtk-with-python3-wrappers.html

from pykriging.

takluyver avatar takluyver commented on July 19, 2024

I've done a bit more work on Py3 support in PR #16. Some tests would be good to check that things aren't breaking. ;-) I'm running the examples to check that they don't crash, but I'm not sure how to check if it's doing the right thing.

from pykriging.

capaulson avatar capaulson commented on July 19, 2024

@takluyver the quickest way to check is to plot a test function contour lines over the end result (scaled the same). The 2D_simple_train.py example shows how to do this. Simply pass the test function to the main Kriging call: 'testfunction=testfun'. This then plots black contours on the filled color plot that is predicted from PyKriging. That provides a quick visual check to make sure the code is working. I'll take a look at the PR this weekend. Have you tested in in Py2.7?

from pykriging.

capaulson avatar capaulson commented on July 19, 2024

Also, @takluyver thanks for the contributions on this code!!

from pykriging.

takluyver avatar takluyver commented on July 19, 2024

I've posted on #16 screenshots of running 2D_simple_train on Python 3 and 2; it appears to be working nicely. I assume the choice of sampling points in non-deterministic, so we wouldn't expect those to be the same.

from pykriging.

capaulson avatar capaulson commented on July 19, 2024

I've just merged Python3 support into the main branch. Closing this thread now

from pykriging.

Daniel-M avatar Daniel-M commented on July 19, 2024

In Debian Linux 4.13.0-1-amd64 #1 SMP Debian 4.13.4-2 (2017-10-15) x86_64 GNU/Linux,
with python 3.5.4, The package pykriging installed from the pip sources (using pip3, pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.5)) still produces the same issue,

# python3 -c "import pyKriging"
...
except Exception, err:
^
SyntaxError: invalid syntax

Fixed with,

git clone https://github.com/capaulson/pyKriging.git
cd pyKriging
python3 setup.py install # installed as root 

I'm not sure why, if the python3 support was merged months ago, the pip package had the same problems. That's why i'm posting at this issue.

from pykriging.

takluyver avatar takluyver commented on July 19, 2024

It will need a new version released on PyPI before you can pip install it with the Python 3 support.

https://pypi.python.org/pypi/pyKriging

from pykriging.

Daniel-M avatar Daniel-M commented on July 19, 2024

I see that the version on PyPI is the 0.1.0, though this repo is 0.2.0. Why the update isn't sent?

from pykriging.

takluyver avatar takluyver commented on July 19, 2024

Making a release is a separate thing from updating the repo - it's up to @capaulson when he wants to release.

from pykriging.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.