-
Notifications
You must be signed in to change notification settings - Fork 2
/
SFRAT.pyw
executable file
·56 lines (42 loc) · 1.75 KB
/
SFRAT.pyw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env python3
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QApplication, QFileDialog
import sys
import os
import pandas as pd
from core import ui, window, analyzeData, applyModels, queryResults, evaluateModels
'''
This is the core SFRAT file. It loads its functionality from other "core" files,
namely each tab of the SFRAT plus some common window functionality. Each tab is
treated as a "module" in an attempt to allow for easy accessing and indexing of
data between tabs, however precaution must be taken in order to not overwrite
functionality between tabs. The overall design makes use of a minimal amount of
required python libraries, however some are needed for desktop use (qt), data
processing (pandas), plotting (matplotlib), as well as other basic functionality
which makes use of the pre-existing default modules.
'''
from models import DSS, GM, GO, ISS, JM, WEI
models = [DSS.DSS, GM.GM, GO.GO, ISS.ISS, JM.JM, WEI.WEI] # must include for model to appear
class SFRAT(QtWidgets.QMainWindow, ui.Ui_MainWindow,
window.Module,
analyzeData.Module, applyModels.Module,
queryResults.Module,evaluateModels.Module): # each tab is assigned its own file
canvasDPI = 90 # quick adjust for all matplotlib canvas DPIs
def __init__(self, parent=None):
super(SFRAT, self).__init__(parent)
self.setupUi(self)
self.modules = models
window.Module.__init__(self) # load window and 4 tabs
analyzeData.Module.__init__(self)
applyModels.Module.__init__(self)
queryResults.Module.__init__(self)
evaluateModels.Module.__init__(self)
self.showMode(0) # setup done, show first tab
print('SFRAT initialized')
def main():
app = QApplication(sys.argv)
form = SFRAT()
form.show()
app.exec_()
if __name__ == '__main__':
main()