1
0
Fork 0

remove dependency on future

drone
Sebastian Heimann 3 years ago
parent 3615e390c8
commit a6b49f38a4

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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