Browse Source

remove dependency on future

deb_package
Sebastian Heimann 1 year ago
parent
commit
a6b49f38a4
105 changed files with 159 additions and 174 deletions
  1. +0
    -1
      doc/source/install/details.rst
  2. +2
    -2
      doc/source/install/packages/pip.rst
  3. +1
    -1
      doc/source/install/system/arch.rst
  4. +0
    -1
      doc/source/install/system/centos.rst
  5. +0
    -2
      doc/source/install/system/deb.rst
  6. +3
    -3
      doc/source/install/system/mac.rst
  7. +2
    -2
      doc/source/install/system/suse.rst
  8. +2
    -2
      doc/source/install/upgrade.rst
  9. +1
    -1
      maintenance/readme-pip.rst
  10. +1
    -1
      prerequisites/prerequisites_arch_python3.sh
  11. +0
    -2
      prerequisites/prerequisites_centos_python2.sh
  12. +0
    -1
      prerequisites/prerequisites_debian_python2.sh
  13. +0
    -1
      prerequisites/prerequisites_debian_python3.sh
  14. +1
    -1
      prerequisites/prerequisites_opensuse_python2.sh
  15. +1
    -1
      prerequisites/prerequisites_opensuse_python3.sh
  16. +0
    -1
      requirements-all.txt
  17. +0
    -1
      requirements.txt
  18. +0
    -1
      src/ahfullgreen.py
  19. +0
    -2
      src/apps/cake.py
  20. +0
    -1
      src/apps/fomosto.py
  21. +5
    -3
      src/cake.py
  22. +6
    -2
      src/client/fdsn.py
  23. +0
    -2
      src/dataset/crust2x2.py
  24. +0
    -2
      src/dataset/crustdb.py
  25. +0
    -2
      src/dataset/geonames.py
  26. +0
    -3
      src/dataset/tectonics.py
  27. +5
    -1
      src/dataset/topo/dataset.py
  28. +5
    -1
      src/dataset/topo/etopo1.py
  29. +6
    -1
      src/file.py
  30. +0
    -1
      src/fomosto/ahfullgreen.py
  31. +0
    -1
      src/fomosto/dummy.py
  32. +0
    -1
      src/fomosto/poel.py
  33. +0
    -1
      src/fomosto/psgrn_pscmp.py
  34. +0
    -1
      src/fomosto/qseis.py
  35. +0
    -1
      src/fomosto/qseis2d.py
  36. +0
    -1
      src/fomosto/qssp.py
  37. +0
    -3
      src/fomosto/report/report_main.py
  38. +0
    -1
      src/gf/builder.py
  39. +4
    -2
      src/gf/meta.py
  40. +0
    -1
      src/gf/seismosizer.py
  41. +4
    -4
      src/gf/server.py
  42. +0
    -1
      src/gf/store.py
  43. +0
    -1
      src/gf/targets.py
  44. +0
    -2
      src/gf/ws.py
  45. +0
    -1
      src/gui/marker.py
  46. +1
    -2
      src/gui/marker_editor.py
  47. +6
    -2
      src/gui/pile_viewer.py
  48. +0
    -2
      src/gui/snuffler.py
  49. +0
    -2
      src/gui/snuffler_app.py
  50. +5
    -1
      src/gui/snufflings/cake_phase.py
  51. +0
    -1
      src/gui/snufflings/stalta.py
  52. +20
    -3
      src/guts.py
  53. +1
    -3
      src/guts_array.py
  54. +1
    -2
      src/io/datacube.py
  55. +0
    -1
      src/io/gse1.py
  56. +0
    -2
      src/io/gse2.py
  57. +7
    -1
      src/io/ims.py
  58. +0
    -1
      src/io/mseed.py
  59. +4
    -3
      src/io/rdseed.py
  60. +0
    -1
      src/io/resp.py
  61. +0
    -1
      src/io/sac.py
  62. +0
    -1
      src/io/segy.py
  63. +0
    -2
      src/io/seisan_response.py
  64. +0
    -1
      src/io/seisan_waveform.py
  65. +5
    -1
      src/io/stationxml.py
  66. +4
    -1
      src/model/event.py
  67. +0
    -1
      src/model/station.py
  68. +0
    -2
      src/moment_tensor.py
  69. +0
    -1
      src/orthodrome.py
  70. +0
    -2
      src/parimap.py
  71. +5
    -1
      src/parstack.py
  72. +0
    -5
      src/pile.py
  73. +7
    -2
      src/plot/__init__.py
  74. +5
    -5
      src/plot/automap.py
  75. +0
    -1
      src/plot/beachball.py
  76. +0
    -1
      src/plot/cake_plot.py
  77. +7
    -3
      src/plot/gmtpy.py
  78. +0
    -1
      src/plot/response.py
  79. +0
    -1
      src/scenario/targets/waveform.py
  80. +0
    -1
      src/shadow_pile.py
  81. +5
    -1
      src/spit.py
  82. +0
    -1
      src/streaming/serial_hamster.py
  83. +5
    -5
      src/trace.py
  84. +8
    -4
      src/util.py
  85. +0
    -2
      test/base/test_ahfull.py
  86. +4
    -4
      test/base/test_avl.py
  87. +0
    -3
      test/base/test_beachball.py
  88. +0
    -1
      test/base/test_cake.py
  89. +0
    -1
      test/base/test_crust2x2.py
  90. +0
    -1
      test/base/test_datacube.py
  91. +0
    -2
      test/base/test_fdsn.py
  92. +0
    -1
      test/base/test_gshhg.py
  93. +0
    -2
      test/base/test_io.py
  94. +0
    -2
      test/base/test_moment_tensor.py
  95. +0
    -2
      test/base/test_parimap.py
  96. +0
    -1
      test/base/test_parstack.py
  97. +0
    -1
      test/base/test_pile.py
  98. +5
    -3
      test/base/test_trace.py
  99. +5
    -2
      test/base/test_util.py
  100. +0
    -1
      test/gf/test_gf.py

+ 0
- 1
doc/source/install/details.rst View File

@ -23,7 +23,6 @@ installed from source:
* `matplotlib <http://matplotlib.sourceforge.net/>`_ (with Qt4 or Qt5 backend)
* `pyyaml <https://bitbucket.org/xi/pyyaml>`_
* `PyQt4 or PyQt5 <http://www.riverbankcomputing.co.uk/software/pyqt/intro>`_ (only needed for the GUI apps)
* `future <https://pypi.python.org/pypi/future>`_ (Python2/3 compatibility layer)
* `requests <http://docs.python-requests.org/en/master/>`_
* Optional Python modules:


+ 2
- 2
doc/source/install/packages/pip.rst View File

@ -30,7 +30,7 @@ Tagged builds are available for download from https://pypi.python.org/.
sudo pip install pyrocko
# Install requirements
sudo pip install numpy>=1.8 scipy pyyaml matplotlib progressbar2 future jinja2 requests PyOpenGL
sudo pip install numpy>=1.8 scipy pyyaml matplotlib progressbar2 jinja2 requests PyOpenGL
User local installation (no sudo)
@ -46,7 +46,7 @@ can use ``pip`` to manage the installation as well:
pip install pyrocko
# Install requirements
pip install numpy>=1.8 scipy pyyaml matplotlib progressbar2 future jinja2 requests PyOpenGL
pip install numpy>=1.8 scipy pyyaml matplotlib progressbar2 jinja2 requests PyOpenGL
Install latest version with pip


+ 1
- 1
doc/source/install/system/arch.rst View File

@ -11,7 +11,7 @@ Python 3.4 and later
python-numpy python-scipy python-matplotlib \
python-pyqt5 qt5-webengine qt5-svg python-pyqt4 \
python-cairo python-opengl python-progressbar \
python-requests python-yaml python-jinja python-future \
python-requests python-yaml python-jinja \
python-nose python-coverage
cd ~/src/ # or wherever you keep your source packages


+ 0
- 1
doc/source/install/system/centos.rst View File

@ -7,7 +7,6 @@ Installation on Centos systems
sudo yum install make gcc git python python-yaml python-matplotlib
sudo yum install numpy scipy python-requests python-coverage
sudo yum install python-jinja2 PyQt4 python-matplotlib-qt4
sudo yum install python-future || sudo easy_install future
sudo easy_install progressbar
cd ~/src/ # or wherever you keep your source packages
git clone https://git.pyrocko.org/pyrocko/pyrocko.git pyrocko


+ 0
- 2
doc/source/install/system/deb.rst View File

@ -14,7 +14,6 @@ Python 3.4 and later
sudo apt-get install -y python3-pyqt5.qtwebengine || sudo apt-get install -y python3-pyqt5.qtwebkit
sudo apt-get install -y python3-yaml python3-progressbar python3-jinja2
sudo apt-get install -y python3-requests
sudo apt-get install -y python3-future || sudo easy_install3 future
cd ~/src/ # or wherever you keep your source packages
git clone https://git.pyrocko.org/pyrocko/pyrocko.git pyrocko
cd pyrocko
@ -32,7 +31,6 @@ Python 2.7
sudo apt-get install -y python-pyqt5.qtwebengine || sudo apt-get install -y python-pyqt5.qtwebkit
sudo apt-get install -y python-yaml python-progressbar python-jinja2
sudo apt-get install -y python-requests
sudo apt-get install -y python-future || sudo easy_install future
cd ~/src/ # or wherever you keep your source packages
git clone https://git.pyrocko.org/pyrocko/pyrocko.git pyrocko
cd pyrocko


+ 3
- 3
doc/source/install/system/mac.rst View File

@ -22,7 +22,7 @@ Mac OS X with MacPorts (Python 3)
sudo port install git
sudo port install python35
sudo port select python python35
sudo port install py35-numpy py35-scipy py35-matplotlib py35-yaml py35-pyqt5 py35-setuptools py35-jinja2 py35-requests py35-future
sudo port install py35-numpy py35-scipy py35-matplotlib py35-yaml py35-pyqt5 py35-setuptools py35-jinja2 py35-requests
sudo easy_install progressbar
cd ~/src/ # or wherever you keep your source packages
git clone https://git.pyrocko.org/pyrocko/pyrocko.git pyrocko
@ -39,7 +39,7 @@ Mac OS X with MacPorts (Python 2.7)
sudo port install git
sudo port install python27
sudo port select python python27
sudo port install py27-numpy py27-scipy py27-matplotlib py27-yaml py27-pyqt5 py27-setuptools py27-jinja2 py27-requests py27-future
sudo port install py27-numpy py27-scipy py27-matplotlib py27-yaml py27-pyqt5 py27-setuptools py27-jinja2 py27-requests
sudo easy_install progressbar
cd ~/src/ # or wherever you keep your source packages
@ -58,7 +58,7 @@ Try this if you don't have sudo rights in ``/usr/bin``.
port install git
port install python35
port select python python35
port install py35-numpy py35-scipy py35-matplotlib py35-yaml py35-pyqt5 py35-setuptools py35-jinja2 py35-requests py35-future
port install py35-numpy py35-scipy py35-matplotlib py35-yaml py35-pyqt5 py35-setuptools py35-jinja2 py35-requests
For local installations of python modules, please first configure your
``PYTHONPATH`` and ``PYTHONUSERBASE`` variables in your environment or your


+ 2
- 2
doc/source/install/system/suse.rst View File

@ -12,7 +12,7 @@ Python 3.4 and later
python3-qt5 python3-qt4 \
python3-matplotlib-qt4 \
python3-PyYAML python3-progressbar python3-Jinja2 \
python3-future python3-requests \
python3-requests \
python3-nose python3-coverage
cd ~/src/ # or wherever you keep your source packages
@ -31,7 +31,7 @@ Python 2.7
python-matplotlib-qt5 python-matplotlib-qt4 python-matplotlib-tk \
python-qt5 python-qt4 \
python-PyYAML python-progressbar python-Jinja2 \
python-future python-requests \
python-requests \
python-nose python-coverage
cd ~/src/ # or wherever you keep your source packages


+ 2
- 2
doc/source/install/upgrade.rst View File

@ -50,7 +50,7 @@ when you try to run ``python setup.py install``.
:caption: Ubuntu, Debian, etc.: install new prerequisites and purge old install
# upgrade to PyQt5 and other depedencies
sudo apt-get install -y python-requests python-pyqt5 python-future
sudo apt-get install -y python-requests python-pyqt5
sudo apt-get install -y python-pyqt5 python-pyqt5.qtopengl python-pyqt5.qtsvg
sudo apt-get install -y python-pyqt5.qtwebengine || sudo apt-get install -y python-pyqt5.qtwebkit
@ -74,7 +74,7 @@ installation:
:caption: MacPorts has to install new dependencies
sudo rm -rf /opt/local/lib/python2.7/dist-packages/pyrocko*
sudo port install py27-pyqt5 py27-requests py27-future
sudo port install py27-pyqt5 py27-requests
cd ~/src/ # or wherever you keep your source packages
rm -rf pyrocko


+ 1
- 1
maintenance/readme-pip.rst View File

@ -20,7 +20,7 @@ Example for Ubuntu, Debian, Mint...
sudo pip3 install pyrocko
# Install requirements manually
sudo pip3 install numpy>=1.8 scipy pyyaml matplotlib progressbar2 future jinja2 requests PyOpenGL
sudo pip3 install numpy>=1.8 scipy pyyaml matplotlib progressbar2 jinja2 requests PyOpenGL
For the GUI application ``PyQt4`` or ``PyQt5`` has to be installed:


+ 1
- 1
prerequisites/prerequisites_arch_python3.sh View File

@ -4,5 +4,5 @@ sudo pacman -Syu --noconfirm --needed git make gcc python python-setuptools \
python-numpy python-scipy python-matplotlib \
python-pyqt5 qt5-webengine qt5-svg qt5-webkit \
python-cairo python-opengl python-progressbar \
python-requests python-yaml python-jinja python-future \
python-requests python-yaml python-jinja \
python-nose python-coverage

+ 0
- 2
prerequisites/prerequisites_centos_python2.sh View File

@ -3,5 +3,3 @@
sudo yum -y install make gcc git python python-yaml python-matplotlib numpy \
scipy python-requests python-coverage python-nose python-jinja2 \
PyQt4 python-matplotlib-qt4
sudo yum -y install python-future || sudo easy_install future

+ 0
- 1
prerequisites/prerequisites_debian_python2.sh View File

@ -8,5 +8,4 @@ sudo apt-get install -y python-pyqt5 python-pyqt5.qtopengl python-pyqt5.qtsvg
sudo apt-get install -y python-pyqt5.qtwebengine || sudo apt-get install -y python-pyqt5.qtwebkit
sudo apt-get install -y python-yaml python-progressbar python-jinja2
sudo apt-get install -y python-requests
sudo apt-get install -y python-future || sudo easy_install future
sudo apt-get install -y python-coverage python-nose

+ 0
- 1
prerequisites/prerequisites_debian_python3.sh View File

@ -8,5 +8,4 @@ sudo apt-get install -y python3-pyqt5 python3-pyqt5.qtopengl python3-pyqt5.qtsvg
sudo apt-get install -y python3-pyqt5.qtwebengine || sudo apt-get install -y python3-pyqt5.qtwebkit
sudo apt-get install -y python3-yaml python3-progressbar python3-jinja2
sudo apt-get install -y python3-requests
sudo apt-get install -y python3-future || sudo easy_install3 future
sudo apt-get install -y python3-coverage python3-nose

+ 1
- 1
prerequisites/prerequisites_opensuse_python2.sh View File

@ -5,6 +5,6 @@ sudo zypper -n install make git gcc python-devel python-setuptools \
python-matplotlib-qt5 python-matplotlib-qt4 python-matplotlib-tk \
python-qt5 python-qt4 \
python-PyYAML python-progressbar python-Jinja2 \
python-future python-requests \
python-requests \
python-nose python-coverage

+ 1
- 1
prerequisites/prerequisites_opensuse_python3.sh View File

@ -5,6 +5,6 @@ sudo zypper -n install make git gcc python3-devel python3-setuptools \
python3-qt5 python3-qt4 \
python3-matplotlib-qt4 \
python3-PyYAML python3-progressbar python3-Jinja2 \
python3-future python3-requests \
python3-requests \
python3-nose python3-coverage

+ 0
- 1
requirements-all.txt View File

@ -3,7 +3,6 @@ scipy
pyyaml
matplotlib
progressbar2
future
requests
nose
PyOpenGL


+ 0
- 1
requirements.txt View File

@ -3,7 +3,6 @@ scipy
pyyaml
matplotlib
progressbar2
future
requests
nose
PyOpenGL

+ 0
- 1
src/ahfullgreen.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, division
from builtins import zip
import math
import numpy as num


+ 0
- 2
src/apps/cake.py View File

@ -3,8 +3,6 @@
#
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from builtins import range
from builtins import str
import sys
import re
import numpy as num


+ 0
- 1
src/apps/fomosto.py View File

@ -4,7 +4,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import print_function
from builtins import range
import sys
import re


+ 5
- 3
src/cake.py View File

@ -44,9 +44,6 @@ The main classes defined in this module are:
from __future__ import absolute_import
from functools import reduce
from future import standard_library
standard_library.install_aliases() # noqa
from builtins import range, zip, str as newstr
import os
import logging
@ -65,6 +62,11 @@ from scipy.optimize import bisect, brentq
from . import util, config
try:
newstr = unicode
except NameError:
newstr = str
logger = logging.getLogger('cake')
ZEPS = 0.01


+ 6
- 2
src/client/fdsn.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import
from builtins import str
import re
import logging
@ -17,6 +16,11 @@ from pyrocko import config
from pyrocko.util import \
urlencode, Request, build_opener, HTTPDigestAuthHandler, urlopen, HTTPError
try:
newstr = unicode
except NameError:
newstr = str
logger = logging.getLogger('pyrocko.client.fdsn')
g_url = '%(site)s/fdsnws/%(service)s/%(majorversion)i/%(method)s'
@ -117,7 +121,7 @@ def _request(url, post=False, user=None, passwd=None,
req = Request(url)
if post:
if isinstance(post, str):
if isinstance(post, newstr):
post = post.encode('utf8')
logger.debug('POST data: \n%s' % post.decode('utf8'))
req.data = post


+ 0
- 2
src/dataset/crust2x2.py View File

@ -67,8 +67,6 @@ Contents
'''
from __future__ import absolute_import, division
from builtins import range
import os
import copy
import math


+ 0
- 2
src/dataset/crustdb.py View File

@ -5,8 +5,6 @@
'''Access to the USGS Global Crustal Database.
Simple queries and statistical analysis'''
from __future__ import absolute_import
from builtins import range
from builtins import map
import numpy as num
import copy


+ 0
- 2
src/dataset/geonames.py View File

@ -3,8 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases() # noqa
import logging
import os


+ 0
- 3
src/dataset/tectonics.py View File

@ -4,9 +4,6 @@
# ---|P------/S----------~Lg----------
from __future__ import absolute_import
from builtins import range
from builtins import map
import os.path as op
import math
from collections import defaultdict


+ 5
- 1
src/dataset/topo/dataset.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, division
from builtins import range
import math
import logging
@ -15,6 +14,11 @@ from . import tile
from ..util import get_download_callback
from pyrocko import util
try:
range = xrange
except NameError:
pass
logger = logging.getLogger('pyrocko.dataset.topo.dataset')


+ 5
- 1
src/dataset/topo/etopo1.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import
from builtins import range
import zipfile
import os.path as op
@ -12,6 +11,11 @@ import numpy as num
from . import tile, dataset
try:
range = xrange
except NameError:
pass
citation = '''
Amante, C. and B.W. Eakins, 2009. ETOPO1 1 Arc-Minute Global Relief Model:
Procedures, Data Sources and Analysis. NOAA Technical Memorandum NESDIS


+ 6
- 1
src/file.py View File

@ -12,7 +12,6 @@
# * A record payload consists of a sequence of record entries.
# * A record entry consists of a key, a type, and a value.
from __future__ import absolute_import, division
from builtins import range
from struct import unpack, pack
from io import BytesIO
@ -29,6 +28,12 @@ except ImportError:
from . import util
try:
range = xrange
except NameError:
pass
size_record_header = 64
no_hash = '\0' * 20


+ 0
- 1
src/fomosto/ahfullgreen.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, division
from builtins import zip
import numpy as num
import logging


+ 0
- 1
src/fomosto/dummy.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, division
from builtins import range
import logging
import os


+ 0
- 1
src/fomosto/poel.py View File

@ -4,7 +4,6 @@
# ---|P------/S----------~Lg----------
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division
from builtins import zip, range
import logging
import os


+ 0
- 1
src/fomosto/psgrn_pscmp.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, division
from builtins import range, zip
import logging
import os


+ 0
- 1
src/fomosto/qseis.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, division
from builtins import range, zip
import numpy as num
import logging


+ 0
- 1
src/fomosto/qseis2d.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, division
from builtins import range, map
import numpy as num
import logging


+ 0
- 1
src/fomosto/qssp.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, division
from builtins import range, zip
import numpy as num
import logging


+ 0
- 3
src/fomosto/report/report_main.py View File

@ -3,9 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, print_function, division
from builtins import range, map
from future import standard_library
standard_library.install_aliases() # noqa
import os
import sys


+ 0
- 1
src/gf/builder.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, division
from builtins import range
import os
import signal


+ 4
- 2
src/gf/meta.py View File

@ -3,8 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, division
from builtins import str as new_str
from builtins import range, map, zip
import math
import re
@ -25,6 +23,10 @@ from pyrocko import cake, orthodrome, spit, moment_tensor, trace
from .error import StoreError
try:
new_str = unicode
except NameError:
new_str = str
guts_prefix = 'pf'


+ 0
- 1
src/gf/seismosizer.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, division, print_function
from builtins import range, map, zip
from collections import defaultdict
from functools import cmp_to_key


+ 4
- 4
src/gf/server.py View File

@ -14,10 +14,6 @@ which is based on this one:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/259148
"""
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases() # noqa
from builtins import range
from builtins import str as newstr
import asynchat
import asyncore
@ -44,6 +40,10 @@ from pyrocko.plot import cake_plot
from pyrocko import gf, util
from pyrocko.util import quote, unquote
try:
newstr = unicode
except NameError:
newstr = str
logger = logging.getLogger('pyrocko.gf.server')


+ 0
- 1
src/gf/store.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, division
from builtins import zip, range
import errno
import time


+ 0
- 1
src/gf/targets.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, division
from builtins import range
import numpy as num
import math


+ 0
- 2
src/gf/ws.py View File

@ -2,8 +2,6 @@
#
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from future import standard_library
standard_library.install_aliases() # noqa
import time
import requests


+ 0
- 1
src/gui/marker.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import
from builtins import object
import calendar
import math


+ 1
- 2
src/gui/marker_editor.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import
from builtins import zip, range
import sys
@ -596,7 +595,7 @@ class MarkerTableModel(qc.QAbstractTableModel):
dists /= 1000.
dists = [round(x, 1) for x in dists]
self.distances = dict(list(zip(emarkers, dists)))
self.distances = dict(zip(emarkers, dists))
if want_angles:
if oevent.moment_tensor:


+ 6
- 2
src/gui/pile_viewer.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, print_function
from builtins import range
import sys
import os
@ -41,6 +40,11 @@ from .qt_compat import qc, qg, qw, qgl, qsvg, use_pyqt5
import scipy.stats as sstats
import platform
try:
newstr = unicode
except NameError:
newstr = str
def fnpatch(x):
if use_pyqt5:
@ -684,7 +688,7 @@ def sort_actions(menu):
actions = menu.actions()
for action in actions:
menu.removeAction(action)
actions.sort(key=lambda x: str(x.text()))
actions.sort(key=lambda x: newstr(x.text()))
help_action = [a for a in actions if a.text() == 'Snuffler Controls']
if help_action:


+ 0
- 2
src/gui/snuffler.py View File

@ -4,8 +4,6 @@
# ---|P------/S----------~Lg----------
'''Effective seismological trace viewer.'''
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases() # noqa
import os
import sys


+ 0
- 2
src/gui/snuffler_app.py View File

@ -4,8 +4,6 @@
# ---|P------/S----------~Lg----------
'''Effective seismological trace viewer.'''
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases() # noqa
import os
import sys


+ 5
- 1
src/gui/snufflings/cake_phase.py View File

@ -1,10 +1,14 @@
from builtins import str
from pyrocko.gui.snuffling import Snuffling, Param, Switch, Choice
from pyrocko.gui.marker import PhaseMarker
from pyrocko import gf
from pyrocko import cake
import numpy as num
try:
newstr = unicode
except NameError:
newstr = str
class CakePhase(Snuffling):
'''


+ 0
- 1
src/gui/snufflings/stalta.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import print_function, absolute_import
from builtins import zip
import numpy as num
from pyrocko.gui.snuffling import Param, Snuffling, Switch, Choice


+ 20
- 3
src/guts.py View File

@ -5,9 +5,6 @@
# ---|P------/S----------~Lg----------
'''Lightweight declarative YAML and XML data binding for Python.'''
from __future__ import absolute_import, print_function
from builtins import str as newstr
from builtins import range
from future.utils import with_metaclass
import datetime
import calendar
@ -32,6 +29,12 @@ except ImportError:
from .util import time_to_str, str_to_time, TimeStrError
try:
newstr = unicode
range = xrange
except NameError:
newstr = str
class GutsSafeDumper(SafeDumper):
pass
@ -763,6 +766,20 @@ class DefaultMaker(object):
**dict((k, make_default(v)) for (k, v) in self.kwargs.items()))
def with_metaclass(meta, *bases):
# inlined py2/py3 compat solution from python-future
class metaclass(meta):
__call__ = type.__call__
__init__ = type.__init__
def __new__(cls, name, this_bases, d):
if this_bases is None:
return type.__new__(cls, name, (), d)
return meta(name, bases, d)
return metaclass('temp', None, {})
class Object(with_metaclass(ObjectMetaClass, object)):
dummy_for = None


+ 1
- 3
src/guts_array.py View File

@ -3,15 +3,13 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import
from builtins import zip
from builtins import str as newstr
import numpy as num
from io import BytesIO
from base64 import b64decode, b64encode
import binascii
from .guts import TBase, Object, ValidationError, literal
from .guts import TBase, Object, ValidationError, literal, newstr
try:


+ 1
- 2
src/io/datacube.py View File

@ -10,7 +10,6 @@ import math
import logging
import numpy as num
from builtins import str as newstr
from pyrocko import trace, util, plot
from pyrocko.guts import Object, Int, String, Timestamp
@ -189,7 +188,7 @@ def plot_timeline(fns):
h = 3600.
if isinstance(fns, (str, newstr)):
if isinstance(fns, str):
fn = fns
if os.path.isdir(fn):
fns = [


+ 0
- 1
src/io/gse1.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, division
from builtins import map
import sys
import numpy as num


+ 0
- 2
src/io/gse2.py View File

@ -3,8 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import division, absolute_import
from builtins import range
from builtins import chr
import os
import random


+ 7
- 1
src/io/ims.py View File

@ -4,7 +4,6 @@
# ---|P------/S----------~Lg----------
'''Module to read and write GSE2.0, GSE2.1, and IMS1.0 files.'''
from __future__ import print_function, absolute_import
from builtins import range, object
import sys
import re
@ -16,6 +15,10 @@ from pyrocko.guts import (
Object, String, StringChoice, Timestamp, Int, Float, List, Bool, Complex,
ValidationError)
try:
range = xrange
except NameError:
pass
logger = logging.getLogger('pyrocko.io.ims')
@ -2432,6 +2435,9 @@ class Reader(object):
def __iter__(self):
return self
def next(self):
return self.__next__()
def __next__(self):
try:
while True:


+ 0
- 1
src/io/mseed.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import division, absolute_import
from builtins import zip
from struct import unpack
import os


+ 4
- 3
src/io/rdseed.py View File

@ -3,9 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import
from builtins import filter
from past.builtins import cmp
import os
import sys
@ -25,6 +22,10 @@ pjoin = os.path.join
logger = logging.getLogger('pyrocko.io.rdseed')
def cmp(a, b):
return (a > b) - (a < b)
def read_station_header_file(fn):
def m(i, *args):


+ 0
- 1
src/io/resp.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, division, print_function
from builtins import map
import time
import re


+ 0
- 1
src/io/sac.py View File

@ -4,7 +4,6 @@
# ---|P------/S----------~Lg----------
'''SAC IO library for Python'''
from __future__ import absolute_import
from builtins import range
import struct
import logging


+ 0
- 1
src/io/segy.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import division, absolute_import
from builtins import range
import numpy as num
import struct


+ 0
- 2
src/io/seisan_response.py View File

@ -3,8 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import
from builtins import range
from builtins import zip
import calendar
import logging


+ 0
- 1
src/io/seisan_waveform.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import division, absolute_import, print_function
from builtins import range
import sys
import calendar


+ 5
- 1
src/io/stationxml.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, division
from builtins import str as newstr
import sys
import time
@ -23,6 +22,11 @@ from pyrocko.guts import load_xml # noqa
import pyrocko.model
from pyrocko import trace, util
try:
newstr = unicode
except NameError:
newstr = str
guts_prefix = 'sx'
guts_xmlns = 'http://www.fdsn.org/xml/station/1'


+ 4
- 1
src/model/event.py View File

@ -4,7 +4,6 @@
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, division
from past.builtins import cmp
import logging
import numpy as num
import hashlib
@ -23,6 +22,10 @@ guts_prefix = 'pf'
d2r = num.pi / 180.
def cmp(a, b):
return (a > b) - (a < b)
def ehash(s):
return str(base64.urlsafe_b64encode(
hashlib.sha1(s.encode('utf8')).digest()).decode('ascii'))


+ 0
- 1
src/model/station.py View File

@ -4,7 +4,6 @@
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, division
from builtins import range
import math
import copy
import logging


+ 0
- 2
src/moment_tensor.py View File

@ -22,8 +22,6 @@ output of :py:meth:`MomentTensor.standard_decomposition`.
'''
from __future__ import division, print_function, absolute_import
from builtins import map
from builtins import zip
import math
import numpy as num


+ 0
- 1
src/orthodrome.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import division, absolute_import
from builtins import object
import math
import numpy as num


+ 0
- 2
src/parimap.py View File

@ -3,8 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from builtins import map
import queue
import multiprocessing
import traceback


+ 5
- 1
src/parstack.py View File

@ -3,11 +3,15 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import
from builtins import range
import numpy as num
from . import parstack_ext
try:
range = xrange
except NameError:
pass
def parstack(arrays, offsets, shifts, weights, method,
lengthout=-1,


+ 0
- 5
src/pile.py View File

@ -4,11 +4,6 @@
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, division, print_function
from future import standard_library
standard_library.install_aliases() # noqa
from builtins import range
import os
import logging
import time


+ 7
- 2
src/plot/__init__.py View File

@ -50,11 +50,16 @@ from __future__ import absolute_import
from pyrocko.util import parse_md
from pyrocko.guts import StringChoice, Float, Int, Bool, Tuple, Object
from builtins import str as newstr
import math
import random
try:
newstr = unicode
except NameError:
newstr = str
__doc__ += parse_md(__file__)


+ 5
- 5
src/plot/automap.py View File

@ -4,11 +4,6 @@
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, print_function
from builtins import str as newstr
from builtins import zip
from builtins import map
from builtins import range
import math
import random
import logging
@ -27,6 +22,11 @@ from pyrocko.dataset import topo
from pyrocko import orthodrome as od
from . import gmtpy
try:
newstr = unicode
except NameError:
newstr = str
points_in_region = od.points_in_region
logger = logging.getLogger('pyrocko.plot.automap')


+ 0
- 1
src/plot/beachball.py View File

@ -5,7 +5,6 @@
# python 2/3
from __future__ import absolute_import
from builtins import zip, map, range
from math import pi as PI
import logging
import numpy as num


+ 0
- 1
src/plot/cake_plot.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import
from builtins import range
import math
import numpy as num


+ 7
- 3
src/plot/gmtpy.py View File

@ -8,7 +8,6 @@
# See there for copying and licensing information.
from __future__ import print_function, absolute_import
from builtins import zip, str as text
import subprocess
try:
from StringIO import StringIO as BytesIO
@ -30,6 +29,11 @@ from scipy.io import netcdf
from pyrocko import ExternalProgramMissing
try:
newstr = unicode
except NameError:
newstr = str
find_bb = re.compile(br'%%BoundingBox:((\s+[-0-9]+){4})')
find_hiresbb = re.compile(br'%%HiResBoundingBox:((\s+[-0-9.]+){4})')
@ -3101,12 +3105,12 @@ class TableLiner(object):
def __iter__(self):
if self.in_columns is not None:
for row in zip(*self.in_columns):
yield (' '.join([text(x) for x in row])+'\n').encode(
yield (' '.join([newstr(x) for x in row])+'\n').encode(
self.encoding)
if self.in_rows is not None:
for row in self.in_rows:
yield (' '.join([text(x) for x in row])+'\n').encode(
yield (' '.join([newstr(x) for x in row])+'\n').encode(
self.encoding)


+ 0
- 1
src/plot/response.py View File

@ -31,7 +31,6 @@ Example
Example response plot
'''
from __future__ import absolute_import
from builtins import range
import logging


+ 0
- 1
src/scenario/targets/waveform.py View File

@ -4,7 +4,6 @@
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, division, print_function
from builtins import range
import hashlib
import math
import logging


+ 0
- 1
src/shadow_pile.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, division
from builtins import range
import math
import logging


+ 5
- 1
src/spit.py View File

@ -3,11 +3,15 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import division
from builtins import range
import struct
import logging
import numpy as num
try:
range = xrange
except NameError:
pass
logger = logging.getLogger('pyrocko.spit')
or_ = num.logical_or


+ 0
- 1
src/streaming/serial_hamster.py View File

@ -3,7 +3,6 @@
# The Pyrocko Developers, 21st Century
# ---|P------/S----------~Lg----------
from __future__ import absolute_import, division
from builtins import zip, range
import time
import logging


+ 5
- 5
src/trace.py View File

@ -5,11 +5,6 @@
'''This module provides basic signal processing for seismic traces.'''
from __future__ import division, absolute_import
from builtins import zip
from builtins import map
from builtins import range
from builtins import str as newstr
import time
import math
import copy
@ -24,6 +19,11 @@ from .guts import Object, Float, Int, String, Complex, Tuple, List, \
StringChoice
from .guts_array import Array
try:
newstr = unicode
except NameError:
newstr = str
UnavailableDecimation # noqa


+ 8
- 4
src/util.py View File

@ -4,9 +4,6 @@
# ---|P------/S----------~Lg----------
'''Utility functions for Pyrocko.'''
from __future__ import division, print_function
from past.builtins import zip, long
from builtins import range
from builtins import object
import time
import logging
@ -38,6 +35,13 @@ except ImportError:
from urllib2 import (Request, build_opener, HTTPDigestAuthHandler, # noqa
HTTPError, URLError, urlopen) # noqa
try:
long
except NameError:
long = int
force_dummy_progressbar = False
@ -1947,7 +1951,7 @@ def consistency_merge(list_of_tuples,
elif error == 'warn':
logger.warning(str(e))
return tuple([merge(x) for x in zip(*list_of_tuples)[1:]])
return tuple([merge(x) for x in list(zip(*list_of_tuples))[1:]])
def parse_md(f):


+ 0
- 2
test/base/test_ahfull.py View File

@ -1,7 +1,5 @@
# python 2/3
from __future__ import division, print_function, absolute_import
from builtins import zip
from builtins import range
import random
import math
import unittest


+ 4
- 4
test/base/test_avl.py View File

@ -2,10 +2,6 @@
# tested with Python 2.4, september-2007 (1.12)
# tested with Python 2.5, december-2008 (1.12_1)
from __future__ import division, print_function, absolute_import
from builtins import range
from builtins import next
from builtins import zip
from past.builtins import cmp
import sys # noqa
import unittest
@ -17,6 +13,10 @@ from io import BytesIO
from pyrocko import avl