I can not download oq-commonlib (since oq-nrmllib is abselete)

156 views
Skip to first unread message

Ahmed Ksentini

unread,
Apr 6, 2015, 5:30:41 AM4/6/15
to openqua...@googlegroups.com
Dear all,
I'm trying to get results from HMTK using the tutorials.
I'm installing python on windows as described in the pdf user guide.
for the nrmllib, in github it is quoted "OBSELETE", but the superseded code oq-commonlib could not be downloaded,
is there any issue?
thanks,
Ahmed

Graeme Weatherill

unread,
Apr 6, 2015, 5:52:50 AM4/6/15
to openqua...@googlegroups.com
Dear Ahmed,

For the purposes of the hmtk you can download and install the nrmllib. It is no longer used in the OpenQuake-engine but it is still needed for the toolkits.

For the commonlib, again the changes in the engine mean that this repository is no longer separate and now exists within the oq-risklib. So I would advise you to download and install the oq-risklib package (https://github.com/gem/oq-risklib) instead. This will add the oq-commonlib to your python path.

Thanks,

Graeme
--
You received this message because you are subscribed to the Google Groups "OpenQuake Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openquake-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ahmed Ksentini

unread,
Apr 6, 2015, 6:41:52 AM4/6/15
to openqua...@googlegroups.com
Dear Graeme,
thank you for your prompt reply,
when I try to apply the tutorial about "map creation" or "catalogue parsers", the commands do not give the requested results such priovided in the tutorial. so I'm going through the codes in github to find the "right" command to import the functions.

but my problem is that : when I try to import functions, some modules are not found.
for example:

I write :> from mapping import HMTKBaseMap

ImportError: No module named hazardlib.geo.point

or when I write :> from csv_cataloue_parser import CsvCatalogueParser

ImportError: No module named hmtk.seismicity.catalogue

I do not understand what should I do,

thanks in advance,
Ahmed

Graeme Weatherill

unread,
Apr 6, 2015, 6:56:54 AM4/6/15
to openqua...@googlegroups.com
Dear Ahmed,

The answers to your questions depend on the operating system you are using and how you are installing the OpenQuake libraries. The errors you get suggest that neither the hazardlib nor the hmtk are actually installed on your system.

For the hazardlib, if you are using OSX/Linux then you would need to cd into the directory you have downloaded and run "sudo python setup.py install" (do the same for the nrmllib if you haven't done so already). For the hmtk itself there is no installer yet so you will need to add this to the pythonpath. In your home directory you will find a file called either ".bash_profile" or ".profile". Open it with a text editor and add the following line to the bottom of the file:

export PYTHONPATH=/path/to/hmtk/:$PYTHONPATH

where /path/to/hmtk is the path to the hmtk folder on your own system. Save and close the file, then restart the terminal for the changes to take effect.

If you are using Windows the process is a lot messier. I would recommend using one of the Virtual images produced by GEM, which have everything pre-installed. The virtualbox images can be downloaded from here http://www.globalquakemodel.org/openquake/start/download/, and the guide to how to get started is here http://www.globalquakemodel.org/openquake/support/documentation/engine/installing-pc/.

Thanks,

Graeme
--
Message has been deleted

Graeme Weatherill

unread,
Apr 8, 2015, 11:10:53 AM4/8/15
to openqua...@googlegroups.com
Dear Ahmed,

From your email it looks like you are trying to import the HMTKBaseMap at the shell prompt rather than inside an IPython session.

In the virtual machines you do not need to be inside the hmtk folder itself as the hmtk is readable from any directory. So cd into the directory where your data is and open an Ipython session using:

>> ipython --pylab

(The --pylab enables plotting)

Alternatively you might want to try out the IPython notebooks. These are visual IPython  sessions that run in your web-browser. We have a few pre-made demos of the hmtk in these notebooks. To start one, cd into GEM/notebooks/hmtk then type:

>> ipython notebook

You will find a notebook master open in your browser (after a few seconds), then click on the desired notebook to start. For more instructions on using the notebooks I recommend looking at the documentation here: http://ipython.org/notebook.html

I hope that works.

Thanks,

Graeme



On 4/8/15 4:14 PM, Ahmed Ksentini wrote:
Dear Graeme,
I installed the virtual machine and oq virtual image as you suggested.
I still have some trouble: I cd into "hmtk" forlder and asked to import the HMTKBaseMap:

openquake@ubuntu-32:~/GEM/hmtk/htmk$ from hmtk.plotting.mapping import HMTKBaseMap
from: can't read /var/mail/hmtk.plotting.mapping

why is it looking into /var/mail despite i cd into hmtk folder?



Le lundi 6 avril 2015 10:30:41 UTC+1, Ahmed Ksentini a écrit :
--

Ahmed Ksentini

unread,
Apr 9, 2015, 6:51:46 AM4/9/15
to openqua...@googlegroups.com
Dear Graeme,
thanks al lot for your suggestions.
things are going on, and I'm applying tutorials to Tunisian dataset (recent)
I have 2question please,

when I plot the catalogue on a basemap, the legend is so big that I can not see the map. I'm using overlay=false. but when I use overlay=true, I see only epicenters and legend is reduced; how can I manage the legend dimensions?

after declustering a catalogue, I looked for a class to crite the new poissonian one
I used : catalogue.write_catalogue (catalogue"/home/openquake/dec_cat.txt","txt")
but I got error. I tried other combinaison bt still do not find the right one.
please advice

regards,
Ahmed

Kipkwony Sophie

unread,
Apr 26, 2016, 9:01:40 AM4/26/16
to OpenQuake Users

nawar...@gmail.com

unread,
Jun 1, 2018, 7:04:44 AM6/1/18
to OpenQuake Users
Hi, I'm facing the same problem. How to solve it?
Reply all
Reply to author
Forward
0 new messages