feature/port-to-py3 #11

Merged
marcel merged 59 commits from feature/port-to-py3 into develop 2022-03-21 15:30:06 +01:00
6 changed files with 10 additions and 9 deletions
Showing only changes of commit 0dc5aff3fc - Show all commits

View File

@ -1324,6 +1324,7 @@ class MainWindow(QMainWindow):
return True
def modify_project_path(self, new_rootpath):
# TODO: change root to datapath
self.project.rootpath = new_rootpath
for event in self.project.eventlist:
event.rootpath = new_rootpath

View File

@ -794,8 +794,8 @@ class PilotDataStructure(GenericDataStructure):
def __init__(self, **fields):
if not fields:
fields = {'database': '2006.01',
'root': '/data/Egelados/EVENT_DATA/LOCAL'}
fields = {'database': '',
'root': ''}
GenericDataStructure.__init__(self, **fields)

View File

@ -376,7 +376,7 @@ def picks_from_picksdict(picks, creation_info=None):
def reassess_pilot_db(root_dir, db_dir, out_dir=None, fn_param=None, verbosity=0):
import glob
# TODO: change root to datapath
db_root = os.path.join(root_dir, db_dir)
evt_list = glob.glob1(db_root, 'e????.???.??')
@ -391,6 +391,7 @@ def reassess_pilot_event(root_dir, db_dir, event_id, out_dir=None, fn_param=None
from pylot.core.io.inputs import PylotParameter
from pylot.core.pick.utils import earllatepicker
# TODO: change root to datapath
if fn_param is None:
fn_param = defaults.AUTOMATIC_DEFAULTS
@ -483,7 +484,6 @@ def reassess_pilot_event(root_dir, db_dir, event_id, out_dir=None, fn_param=None
os.makedirs(out_dir)
fnout_prefix = os.path.join(out_dir, 'PyLoT_{0}.'.format(event_id))
evt.write(fnout_prefix + 'xml', format='QUAKEML')
# evt.write(fnout_prefix + 'cnv', format='VELEST')
def writephases(arrivals, fformat, filename, parameter=None, eventinfo=None):

View File

@ -400,6 +400,7 @@ class PDFstatistics(object):
This object can be used to get various statistic values from probability density functions.
Takes a path as argument.
"""
# TODO: change root to datapath
def __init__(self, directory):
"""Initiates some values needed when dealing with pdfs later"""

View File

@ -380,7 +380,7 @@ def check_time(datetime):
except ValueError:
return False
# TODO: change root to datapath
def get_file_list(root_dir):
"""
Function uses a directorie to get all the *.gse files from it.

View File

@ -61,10 +61,9 @@ from pylot.core.util.dataprocessing import Metadata
if sys.version_info.major == 3:
import icons_rc_3 as icons_rc
elif sys.version_info.major == 2:
import icons_rc_2 as icons_rc
else:
raise ImportError('Could not determine python version.')
raise ImportError(f'Python version {sys.version_info.major} of current interpreter not supported.'
f'\nPlease use Python 3+.')
# workaround to prevent PyCharm from deleting icons_rc import when optimizing imports
@ -4589,7 +4588,7 @@ class InputsTab(PropTab):
self.fullNameEdit.setText(fulluser)
except TypeError as e:
self.fullNameEdit.setText(fulluser[0])
# TODO: check settings and substitute datapath for root
# information about data structure
dataroot = settings.value("data/dataRoot")
curstructure = settings.value("data/Structure")