Dear Ozkan,
The specific instructions will depend on how you have installed
the development version of OpenQuake on your system. To implement
new features it is important that you install the development
version of OpenQuake. For OSX and Linux I strongly recommend
following the instructions here:
https://github.com/gem/oq-engine/blob/master/doc/installing/development.md.
I'm not sure of the best configuration for Windows (perhaps one of
the developers can advise).
Your installation of oq-hazardlib should have brought in the
package "nose 1.3.7". Assuming for now that you are working from
the command line the first thing I suggest is to verify that the
general test suite is running. Before adding your new python files
to the hazardlib code (or moving them out of the directory
temporarily) cd into the oq-hazardlib directory and run:
nosetests -v -a '!slow'
This should take about 10 - 15 minutes and will verify that OQ is
working correctly. If so, then place the kale_2015.py file into
the directory openquake/hazardlib/gsim, and the kale_2015_test.py
file into the directory openquake/hazardlib/tests/gsim. Then, in
the folder openquake/hazardlib/tests/gsim/data create a new folder
called something like 'kale15' (or whatever relative pathname you
have specified in the kale_2015_test file) and inside that new
folder place the csv files. When you have done this return to the
oq-hazardlib directory and from the command line run:
nosetests openquake/hazardlib/tests/gsim/kale_2015_test.py
--verbose
This should execute the tests and tell you the status
(OK/ERROR/FAIL) of each of the tests in the kale_2015_test.py
file. If it indicates that all of the tests are running OK then
you are good. If there are error messages then there is a problem
in the code and you should read the log message to debug, then
repeat etc. If you are seeing "FAIL" messages then it will give
you statistics on the degree of mismatch - it means the GMPE is
running but is not giving the values you are expecting. If it is
not obvious from your code where the problem is, you can open the
file openquake/hazardlib/tests/gsim/check_gsim.py and on line 40
change the debug option to True. Running the tests again this will
tell you more about where the tests are failing and help you to
track down which part of the code is giving problems. Once the
tests are passing set this debug option back to False.
If you are happy using Github then generate a pull request (one of
us will probably clone the branch and do any cleanup, add docs
etc.), or ii) send me the files to this email
(
gra...@openquake.org) and I will open the pull request.
Please let me know if you need assistance with the GMPE (sending
me the files will make this faster), or let us know if you haven't
been able to successfully setup the development environment for
OpenQuake.
Thanks,
Graeme