[FOLDER RESTURCTURING #22] some changes in path variables

This commit is contained in:
Kaan Cökerim 2021-09-08 13:06:51 +02:00
parent 7c5e16ecc6
commit 0dc5aff3fc
6 changed files with 10 additions and 9 deletions

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