diff --git a/HISTORY.rst b/HISTORY.rst index a94f3900674ff45112c0d5377c4db9759781243d..db916b9f439e3d1737299b77f75377f8c715b676 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -10,3 +10,10 @@ History 2018.228 (2018-08-16) ------------------ * Updated to work with python 2 and 3 + +2020.093 (2020-04-02) +------------------ +* Updated to work with python 2 and 3. +* Resources used: Python-Future project and Futurize tool. +* Changes tested using unittest module on individual test methods(tests.test_data2passcal) +* Changes tested against real seismic dataset (AB.2002 - 2012) diff --git a/README.rst b/README.rst index 1d6dee089e41341f1618e01f5a91e7ee72a5c3e0..efc03cf70b5aeeb77a45be7fff9dd765383a0534 100644 --- a/README.rst +++ b/README.rst @@ -4,6 +4,7 @@ data2passcal Prepare SEED data for shipment to PASSCAL. +Only accept day-long MSEED files. * Free software: GNU General Public License v3 (GPLv3) diff --git a/data2passcal/__init__.py b/data2passcal/__init__.py index 1636f688fe53d37abbe1eb0fb8f667675ef3b664..afe21e9225139b7e746aabc93df87e9991ff3b07 100644 --- a/data2passcal/__init__.py +++ b/data2passcal/__init__.py @@ -4,4 +4,4 @@ __author__ = """IRIS PASSCAL""" __email__ = 'software-support@passcal.nmt.edu' -__version__ = '2018.228' +__version__ = '2020.093' diff --git a/data2passcal/data2passcal.py b/data2passcal/data2passcal.py index 7632678c2c3cef869cf1a7490bd7f69fbbd63b97..a4afaafc0317720dab90d5c265387f05d369a197 100644 --- a/data2passcal/data2passcal.py +++ b/data2passcal/data2passcal.py @@ -5,8 +5,9 @@ data2passcal Ship miniseed data to passcal via ftp for qc before archival at DMC DMS Lloyd Carothers IRIS/PASSCAL ''' -from __future__ import print_function -VERSION = '2018.228' +from __future__ import print_function, division +from builtins import * +VERSION = '2020.093' import ftplib import sys, os, signal, struct, pickle, logging @@ -313,11 +314,11 @@ def send2passcal(mslist, sentlist=None): update.bytes_sent += len(data) print('\r' + str(PB) + ' %s /sec ' % ( format_size(size_sent / (time() - starttime )) ), end=' ') ''' - print '%s %0.2f%%. %0.10d / %0.10d.' % ( current_file.center(20), - (update.bytes_sent / update.file_size)*100, - update.bytes_sent, - file_size, - ) , + print '%s %0.2f%%. %0.10d / %0.10d.' % ( current_file.center(20), + (update.bytes_sent / update.file_size)*100, + update.bytes_sent, + file_size, + ) , ''' ETA_sec = ((time() - starttime) / size_sent ) * (size_to_send - size_sent) print('ETA %s %s %s' % ( str(datetime.timedelta(seconds=(ETA_sec))), current_file.center(20), ' '*20 ), end=' ') @@ -388,7 +389,7 @@ def send2passcal(mslist, sentlist=None): ######################################################## # From progressbar 3rd party class will eventually dump not awesome -class ProgressBar: +class ProgressBar(object): def __init__(self, duration): self.duration = duration self.prog_bar = '[]' diff --git a/setup.cfg b/setup.cfg index bd5e695214d2220c9df4bb5f53418783cc3037b2..ac124ca411cea8f9dabc9e8c0af2752987f18625 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 2018.228 +current_version = 2020.093 commit = True tag = True @@ -19,4 +19,3 @@ exclude = docs [aliases] # Define setup.py command aliases here - diff --git a/setup.py b/setup.py index 3c7b133727cf7718141b7ce8e55399c30d670526..6afb3d2ddf200dcb6435ce2c75f77154b81a83e3 100644 --- a/setup.py +++ b/setup.py @@ -52,6 +52,6 @@ setup( packages=find_packages(include=['data2passcal']), test_suite='tests', url='https://git.passcal.nmt.edu/passoft/data2passcal', - version='2018.228', + version='2020.093', zip_safe=False, ) diff --git a/tests/test_data2passcal.py b/tests/test_data2passcal.py index e102d31f6b7762155c53b59bb37b4039d921533f..a82fa89fd59939d3dfaf33a9cf4ba03f1c71c670 100644 --- a/tests/test_data2passcal.py +++ b/tests/test_data2passcal.py @@ -22,7 +22,6 @@ class TestData2passcal(unittest.TestCase): def test_import(self): if 'data2passcal' in sys.modules: - self.assert_(True, "data2passcal loaded") + self.assertTrue(True, "data2passcal loaded") else: self.fail() -