Browse Source

remove dependency on future

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

1
doc/source/install/details.rst

@ -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:

4
doc/source/install/packages/pip.rst

@ -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

2
doc/source/install/system/arch.rst

@ -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

1
doc/source/install/system/centos.rst

@ -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

2
doc/source/install/system/deb.rst

@ -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

6
doc/source/install/system/mac.rst

@ -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

4
doc/source/install/system/suse.rst

@ -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

4
doc/source/install/upgrade.rst

@ -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

2
maintenance/readme-pip.rst

@ -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:

2
prerequisites/prerequisites_arch_python3.sh

@ -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

2
prerequisites/prerequisites_centos_python2.sh

@ -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

1
prerequisites/prerequisites_debian_python2.sh

@ -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

1
prerequisites/prerequisites_debian_python3.sh

@ -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

2
prerequisites/prerequisites_opensuse_python2.sh

@ -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

2
prerequisites/prerequisites_opensuse_python3.sh

@ -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

1
requirements-all.txt

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

1
requirements.txt

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

1
src/ahfullgreen.py

@ -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

2
src/apps/cake.py

@ -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

1
src/apps/fomosto.py

@ -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

8
src/cake.py

@ -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

8
src/client/fdsn.py

@ -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

2
src/dataset/crust2x2.py

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

2
src/dataset/crustdb.py

@ -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

2
src/dataset/geonames.py

@ -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

3
src/dataset/tectonics.py

@ -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

6
src/dataset/topo/dataset.py

@ -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')

6
src/dataset/topo/etopo1.py

@ -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

7
src/file.py

@ -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

1
src/fomosto/ahfullgreen.py

@ -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

1
src/fomosto/dummy.py

@ -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

1
src/fomosto/poel.py

@ -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

1
src/fomosto/psgrn_pscmp.py

@ -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

1
src/fomosto/qseis.py

@ -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

1
src/fomosto/qseis2d.py

@ -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

1
src/fomosto/qssp.py

@ -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

3
src/fomosto/report/report_main.py

@ -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

1
src/gf/builder.py

@ -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

6
src/gf/meta.py

@ -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'

1
src/gf/seismosizer.py

@ -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

8
src/gf/server.py

@ -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')

1
src/gf/store.py

@ -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

1
src/gf/targets.py

@ -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

2
src/gf/ws.py

@ -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

1
src/gui/marker.py

@ -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

3
src/gui/marker_editor.py

@ -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:

8
src/gui/pile_viewer.py

@ -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:

2
src/gui/snuffler.py

@ -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

2
src/gui/snuffler_app.py

@ -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

6
src/gui/snufflings/cake_phase.py

@ -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):
'''

1
src/gui/snufflings/stalta.py

@ -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

23
src/guts.py

@ -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

4
src/guts_array.py

@ -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:

3
src/io/datacube.py

@ -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 = [

1
src/io/gse1.py

@ -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

2
src/io/gse2.py

@ -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

8
src/io/ims.py

@ -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:

1
src/io/mseed.py

@ -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

7
src/io/rdseed.py

@ -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):

1
src/io/resp.py

@ -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

1
src/io/sac.py

@ -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

1
src/io/segy.py

@ -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

2
src/io/seisan_response.py

@ -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

1
src/io/seisan_waveform.py

@ -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

6
src/io/stationxml.py

@ -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'

5
src/model/event.py

@ -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'))

1
src/model/station.py

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

2
src/moment_tensor.py

@ -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

1
src/orthodrome.py

@ -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

2
src/parimap.py

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

6
src/parstack.py

@ -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,

5
src/pile.py

@ -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

9
src/plot/__init__.py

@ -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__)

10
src/plot/automap.py

@ -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')

1
src/plot/beachball.py

@ -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

1
src/plot/cake_plot.py

@ -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

10
src/plot/gmtpy.py

@ -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)

1
src/plot/response.py

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

1
src/scenario/targets/waveform.py

@ -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

1
src/shadow_pile.py

@ -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

6
src/spit.py

@ -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

1
src/streaming/serial_hamster.py

@ -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

10
src/trace.py

@ -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

12
src/util.py

@ -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,