example10

Asked by Lou Jichao

Dear all,
I try to run example10a.py in ubuntu16.04,but when I use
'python example10a.py'
There is a problem:
This example requires that natgrid is available to matplotlib
Jichao

Question information

Language:
English Edit question
Status:
Solved
For:
esys-escript Edit question
Assignee:
No assignee Edit question
Solved by:
Adam Ellery
Solved:
Last query:
Last reply:
Revision history for this message
Adam Ellery (aellery) said :
#1

Hi Jichao,

Unfortunately, several of the examples in the cookbook rely on matplotlib's natgrid function which has recently been deprecated (discontinued) by matplotlib. I have updated all of the examples to use scipy.interpolate.griddata instead of matplotlib.natgrid for the next release of escript.

You can access the updated examples here:
https://svn.geocomp.uq.edu.au/svn/esys13/trunk/doc/examples/cookbook/

Note that, in order to run them, you will first have to install scipy on your computer, if it is not already installed.

Revision history for this message
Lou Jichao (ljc-1) said :
#2

Hi Adam Ellery,
Thanks for your answer but when i run the updated examples10a.py.
It says:
Traceback (most recent call last):
  File "example10a.py", line 46, in <module>
    from cblib import toRegGrid
ImportError: No module named cblib
And i have run the command "sudo apt-get install python-scipy" it has no problem.

Revision history for this message
Best Adam Ellery (aellery) said :
#3

I believe that this is a different error to the first one you came across and that it has occurred because python cannot locate the file named "cblib.py". This file should be in the same directory as the file "example10a.py".

Can you please confirm that you have the file "cblib.py" on your machine?

Revision history for this message
Lou Jichao (ljc-1) said :
#4

Thanks Adam Ellery, that solved my question.