Browse Source

C Warnings // Test cleanup (#189)

* C Warnings // Test cleanup

* flake8

* topo: added simple function to get elevation at a given lat/lon

* pile_viewer: revert change to station_key

* enhanced_sacpz: improved an error message

* Added GSHHG // refactored tectonics contains into orthodrome (#202)

* Added GSSHG // refactored tectonics contains into orthodrome

* WIP // Added documentation

* gshhs: corrected get_land_mask

* Added test for points over 0 meridian

* Documentation changes

* orthodrome/gshhg: working on tests

* Work on docs // examples

* flake8

* Added GSSHG // refactored tectonics contains into orthodrome

* WIP // Added documentation

* gshhs: corrected get_land_mask

* topo: added simple function to get elevation at a given lat/lon

* Added test for points over 0 meridian

* Documentation changes

* orthodrome/gshhg: working on tests

* Work on docs // examples

* Fixing orthodrome.polygon_* tests

* Fixing test_gshhg.py

* C Warnings // Test cleanup

* Silcence dummy warning
automap_projectionflag
Mi! 4 years ago
committed by GitHub
parent
commit
04a646ef88
  1. 4
      .travis.yml
  2. 6
      src/autopick_ext.c
  3. 4
      src/evalresp_ext.c
  4. 4
      src/gf/ext/store_ext.c
  5. 2
      src/gf/seismosizer.py
  6. 4
      src/mseed_ext.c
  7. 2
      src/signal_ext.c
  8. 2
      test/test_all.py
  9. 6
      test/test_crustdb.py
  10. 2
      test/test_guts.py

4
.travis.yml

@ -16,6 +16,10 @@ matrix:
osx_image: xcode7.3
language: generic
cache:
directories:
- $HOME/test/data
addons:
apt:
packages: [ python-qt4, python-qt4-gl, python-qt4-dev, python-dev,

6
src/autopick_ext.c

@ -111,8 +111,10 @@ static PyObject* autopick_recursive_stalta_wrapper(PyObject *dummy, PyObject *ar
PyObject *inout_array_obj, *temp_array_obj;
PyArrayObject *inout_array = NULL;
PyArrayObject *temp_array = NULL;
int ns, nl, initialize, nsamples, ntemp;
double ks, kl, k;
int ns, nl, initialize, nsamples, ntemp;
double ks, kl, k;
(void) dummy;
if (!PyArg_ParseTuple(args, "iidddOOi", &ns, &nl, &ks, &kl, &k, &inout_array_obj, &temp_array_obj, &initialize)) {
PyErr_SetString(AutoPickError, "invalid arguments in recursive_stalta(ns, nl, ks, kl, inout_data, temp_data, initialize)" );

4
src/evalresp_ext.c

@ -34,6 +34,8 @@ evresp_wrapper (PyObject *dummy, PyObject *args)
PyObject *elem, *out_list;
npy_intp array_dims[1] = {0};
(void) dummy; /* silence warning */
if (!PyArg_ParseTuple(args, "sssssssOssiiiiid",
&sta_list,
&cha_list,
@ -63,7 +65,7 @@ evresp_wrapper (PyObject *dummy, PyObject *args)
}
assert( sizeof(double) == 8 );
if (!PyArray_TYPE(freqs_array) == NPY_FLOAT64) {
if (PyArray_TYPE(freqs_array) != NPY_FLOAT64) {
PyErr_SetString(EvalrespError, "Frequencies must be of type double.");
return NULL;
}

4
src/gf/ext/store_ext.c

@ -981,7 +981,7 @@ static PyObject* w_store_mapping_init(PyObject *dummy, PyObject *args) {
npy_intp n;
int ng_;
(void)dummy; /* silence warning */
(void) dummy; /* silence warning */
if (!PyArg_ParseTuple(args, "OsOOOOi", &capsule, &mapping_scheme_name,
&mins_arr, &maxs_arr, &deltas_arr, &ns_arr,
@ -1058,7 +1058,7 @@ static PyObject* w_store_get(PyObject *dummy, PyObject *args) {
int i;
store_error_t err;
(void)dummy; /* silence warning */
(void) dummy; /* silence warning */
if (!PyArg_ParseTuple(args, "OKii", &capsule, &irecord_, &itmin_, &nsamples_)) {
PyErr_SetString(StoreExtError, "usage: store_get(cstore, irecord, itmin, nsamples)");

2
src/gf/seismosizer.py

@ -2807,7 +2807,7 @@ class LocalEngine(Engine):
for ii_results, tcounters_static in process_static(
work_static, request.sources, request.targets, self,
nthreads=nprocs):
nthreads=nthreads):
tcounters_static_list.append(num.diff(tcounters_static))
isource, itarget, result = ii_results

4
src/mseed_ext.c

@ -32,6 +32,8 @@ mseed_get_traces (PyObject *dummy, PyObject *args)
char strbuf[BUFSIZE];
PyObject *unpackdata = NULL;
(void) dummy; /* silence warning */
if (!PyArg_ParseTuple(args, "sO", &filename, &unpackdata)) {
PyErr_SetString(MSeedError, "usage get_traces(filename, dataflag)" );
return NULL;
@ -155,6 +157,8 @@ mseed_store_traces (PyObject *dummy, PyObject *args)
int length;
FILE *outfile;
(void) dummy; /* silence warning */
if (!PyArg_ParseTuple(args, "Os", &in_traces, &filename)) {
PyErr_SetString(MSeedError, "usage store_traces(traces, filename)" );
return NULL;

2
src/signal_ext.c

@ -9,7 +9,7 @@
#include <math.h>
static const int64_t NENTRIES = 1001;
static const int64_t ORDER = 25;
/*static const int64_t ORDER = 25;*/
static const int64_t NCOEFFS = 25*2+1;
#define INVALID_INPUT 1

2
test/test_all.py

@ -12,7 +12,7 @@ from test_model import ModelTestCase # noqa
from test_util import UtilTestCase # noqa
from test_util import UtilTestCase # noqa
from test_crust2x2 import Crust2x2TestCase # noqa
# from test_crustdb import CrustDBTestCase # noqa
from test_crustdb import CrustDBTestCase # noqa
from test_gf import GFTestCase # noqa
from test_gf_sources import GFSourcesTestCase # noqa
from test_gf_qseis import GFQSeisTestCase # noqa

6
test/test_crustdb.py

@ -4,7 +4,7 @@ import logging
import shutil
from tempfile import mkdtemp
from os.path import join as pjoin
from pyrocko import crustdb, util, gmtpy
from pyrocko import crustdb, util
logger = logging.getLogger('test_crustdb.py')
@ -18,8 +18,7 @@ class CrustDBTestCase(unittest.TestCase):
def tearDown(self):
shutil.rmtree(self.tmpdir)
@unittest.skipUnless(
gmtpy.have_gmt(), 'GMT not available')
@unittest.skip('')
def test_map(self):
tmpmap = pjoin(self.tmpdir, 'map.ps')
self.db.plotMap(tmpmap)
@ -34,6 +33,7 @@ class CrustDBTestCase(unittest.TestCase):
self.db.selectMaxDepth(40.)
self.db.selectMinDepth(20.)
@unittest.skip('')
def test_ploting(self):
import matplotlib.pyplot as plt
fig = plt.figure()

2
test/test_guts.py

@ -450,6 +450,8 @@ class GutsTestCase(unittest.TestCase):
assert a.arr.shape == b.arr.shape
self.assertTrue(num.all(a.arr == b.arr))
b_int = load_string # noqa
def testPO(self):
class SKU(StringPattern):
pattern = '\\d{3}-[A-Z]{2}'

Loading…
Cancel
Save