Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
214 changes: 214 additions & 0 deletions core/uis/PointBiserial_ui/PointBiserial.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PointBiserial</class>
<widget class="QMainWindow" name="PointBiserial">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>675</width>
<height>294</height>
</rect>
</property>
<property name="windowTitle">
<string>Point-biserial Correlation</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="inputGroupBox">
<property name="title">
<string>Input</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="2">
<widget class="QToolButton" name="continuousToolButton">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="continuousComboBox"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="continuousLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Continuous Parameter:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="discreteComboBox"/>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="inventoryComboBox">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QToolButton" name="inventoryToolButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="discreteLabel">
<property name="text">
<string>Discrete Parameter:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="discreteToolButton">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="compareLsToNonLsCheckBox">
<property name="text">
<string>Additionally compare landslide cells to non-landslide cells</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="inventoryLabel">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Inventory:</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="outputGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Output</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="outputLabel">
<property name="text">
<string>Analysis name</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="outputLineEdit">
<property name="toolTip">
<string>LSAT will create *name*_pbc.npz in /results/statistics</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QPushButton" name="applyPushButton">
<property name="text">
<string>Apply</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>675</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<connections>
<connection>
<sender>compareLsToNonLsCheckBox</sender>
<signal>clicked(bool)</signal>
<receiver>inventoryLabel</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>56</x>
<y>128</y>
</hint>
<hint type="destinationlabel">
<x>58</x>
<y>154</y>
</hint>
</hints>
</connection>
<connection>
<sender>compareLsToNonLsCheckBox</sender>
<signal>clicked(bool)</signal>
<receiver>inventoryComboBox</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>170</x>
<y>133</y>
</hint>
<hint type="destinationlabel">
<x>180</x>
<y>158</y>
</hint>
</hints>
</connection>
<connection>
<sender>compareLsToNonLsCheckBox</sender>
<signal>clicked(bool)</signal>
<receiver>inventoryToolButton</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>739</x>
<y>130</y>
</hint>
<hint type="destinationlabel">
<x>760</x>
<y>154</y>
</hint>
</hints>
</connection>
</connections>
</ui>
123 changes: 123 additions & 0 deletions core/uis/PointBiserial_ui/PointBiserial_ui.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file '.\PointBiserial.ui'
#
# Created by: PyQt5 UI code generator 5.15.7
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.


from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_PointBiserial(object):
def setupUi(self, PointBiserial):
PointBiserial.setObjectName("PointBiserial")
PointBiserial.resize(675, 294)
self.centralwidget = QtWidgets.QWidget(PointBiserial)
self.centralwidget.setObjectName("centralwidget")
self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
self.verticalLayout.setObjectName("verticalLayout")
self.inputGroupBox = QtWidgets.QGroupBox(self.centralwidget)
self.inputGroupBox.setObjectName("inputGroupBox")
self.gridLayout = QtWidgets.QGridLayout(self.inputGroupBox)
self.gridLayout.setObjectName("gridLayout")
self.continuousToolButton = QtWidgets.QToolButton(self.inputGroupBox)
self.continuousToolButton.setObjectName("continuousToolButton")
self.gridLayout.addWidget(self.continuousToolButton, 1, 2, 1, 1)
self.continuousComboBox = QtWidgets.QComboBox(self.inputGroupBox)
self.continuousComboBox.setObjectName("continuousComboBox")
self.gridLayout.addWidget(self.continuousComboBox, 1, 1, 1, 1)
self.continuousLabel = QtWidgets.QLabel(self.inputGroupBox)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.continuousLabel.sizePolicy().hasHeightForWidth())
self.continuousLabel.setSizePolicy(sizePolicy)
self.continuousLabel.setObjectName("continuousLabel")
self.gridLayout.addWidget(self.continuousLabel, 1, 0, 1, 1)
self.discreteComboBox = QtWidgets.QComboBox(self.inputGroupBox)
self.discreteComboBox.setObjectName("discreteComboBox")
self.gridLayout.addWidget(self.discreteComboBox, 0, 1, 1, 1)
self.inventoryComboBox = QtWidgets.QComboBox(self.inputGroupBox)
self.inventoryComboBox.setEnabled(False)
self.inventoryComboBox.setObjectName("inventoryComboBox")
self.gridLayout.addWidget(self.inventoryComboBox, 4, 1, 1, 1)
self.inventoryToolButton = QtWidgets.QToolButton(self.inputGroupBox)
self.inventoryToolButton.setEnabled(False)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.inventoryToolButton.sizePolicy().hasHeightForWidth())
self.inventoryToolButton.setSizePolicy(sizePolicy)
self.inventoryToolButton.setObjectName("inventoryToolButton")
self.gridLayout.addWidget(self.inventoryToolButton, 4, 2, 1, 1)
self.discreteLabel = QtWidgets.QLabel(self.inputGroupBox)
self.discreteLabel.setObjectName("discreteLabel")
self.gridLayout.addWidget(self.discreteLabel, 0, 0, 1, 1)
self.discreteToolButton = QtWidgets.QToolButton(self.inputGroupBox)
self.discreteToolButton.setObjectName("discreteToolButton")
self.gridLayout.addWidget(self.discreteToolButton, 0, 2, 1, 1)
self.compareLsToNonLsCheckBox = QtWidgets.QCheckBox(self.inputGroupBox)
self.compareLsToNonLsCheckBox.setObjectName("compareLsToNonLsCheckBox")
self.gridLayout.addWidget(self.compareLsToNonLsCheckBox, 2, 0, 1, 2)
self.inventoryLabel = QtWidgets.QLabel(self.inputGroupBox)
self.inventoryLabel.setEnabled(False)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.inventoryLabel.sizePolicy().hasHeightForWidth())
self.inventoryLabel.setSizePolicy(sizePolicy)
self.inventoryLabel.setObjectName("inventoryLabel")
self.gridLayout.addWidget(self.inventoryLabel, 4, 0, 1, 1)
self.verticalLayout.addWidget(self.inputGroupBox)
self.outputGroupBox = QtWidgets.QGroupBox(self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.outputGroupBox.sizePolicy().hasHeightForWidth())
self.outputGroupBox.setSizePolicy(sizePolicy)
self.outputGroupBox.setObjectName("outputGroupBox")
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.outputGroupBox)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.outputLabel = QtWidgets.QLabel(self.outputGroupBox)
self.outputLabel.setObjectName("outputLabel")
self.verticalLayout_2.addWidget(self.outputLabel)
self.outputLineEdit = QtWidgets.QLineEdit(self.outputGroupBox)
self.outputLineEdit.setObjectName("outputLineEdit")
self.verticalLayout_2.addWidget(self.outputLineEdit)
self.verticalLayout.addWidget(self.outputGroupBox)
self.applyPushButton = QtWidgets.QPushButton(self.centralwidget)
self.applyPushButton.setObjectName("applyPushButton")
self.verticalLayout.addWidget(self.applyPushButton)
PointBiserial.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(PointBiserial)
self.menubar.setGeometry(QtCore.QRect(0, 0, 675, 21))
self.menubar.setObjectName("menubar")
PointBiserial.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(PointBiserial)
self.statusbar.setObjectName("statusbar")
PointBiserial.setStatusBar(self.statusbar)

self.retranslateUi(PointBiserial)
self.compareLsToNonLsCheckBox.clicked['bool'].connect(self.inventoryLabel.setEnabled) # type: ignore
self.compareLsToNonLsCheckBox.clicked['bool'].connect(self.inventoryComboBox.setEnabled) # type: ignore
self.compareLsToNonLsCheckBox.clicked['bool'].connect(self.inventoryToolButton.setEnabled) # type: ignore
QtCore.QMetaObject.connectSlotsByName(PointBiserial)

def retranslateUi(self, PointBiserial):
_translate = QtCore.QCoreApplication.translate
PointBiserial.setWindowTitle(_translate("PointBiserial", "Point-biserial Correlation"))
self.inputGroupBox.setTitle(_translate("PointBiserial", "Input"))
self.continuousToolButton.setText(_translate("PointBiserial", "..."))
self.continuousLabel.setText(_translate("PointBiserial", "Continuous Parameter:"))
self.inventoryToolButton.setText(_translate("PointBiserial", "..."))
self.discreteLabel.setText(_translate("PointBiserial", "Discrete Parameter:"))
self.discreteToolButton.setText(_translate("PointBiserial", "..."))
self.compareLsToNonLsCheckBox.setText(_translate("PointBiserial", "Additionally compare landslide cells to non-landslide cells"))
self.inventoryLabel.setText(_translate("PointBiserial", "Inventory:"))
self.outputGroupBox.setTitle(_translate("PointBiserial", "Output"))
self.outputLabel.setText(_translate("PointBiserial", "Analysis name"))
self.outputLineEdit.setToolTip(_translate("PointBiserial", "LSAT will create *name*_pbc.npz in /results/statistics"))
self.applyPushButton.setText(_translate("PointBiserial", "Apply"))
8 changes: 6 additions & 2 deletions core/widgets/Catalog/catalog_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from core.widgets.RasterInfo.rasterInfo_main import RasterInfo
from core.widgets.ResultViewer.ann_resultviewer import ann_resultviewer
from core.widgets.ResultViewer.ahp_resultviewer import ahp_resultviewer
from core.widgets.ResultViewer.pb_resultviewer import pb_resultviewer
from core.widgets.ResultViewer.resultViewerWofE_main import ResultViewerWofE
from core.widgets.ResultViewer.resultViewerLogReg_main import ResultsForm as LogResultForm
from core.libs.Reporting.woe_report import woe_report
Expand Down Expand Up @@ -381,11 +382,14 @@ def showResults(self):
elif pathparts[-3] == "AHP":
self.ahpr = ahp_resultviewer(self.projectLocation, fname, result)
self.ahpr.show()
elif pathparts[-2] == "statistics":
elif pathparts[-2] == "contingency":
self.contr = ContingencyMatrix(self.projectLocation, fname, result)
self.contr.show()
elif pathparts[-2] == "pb":
self.pbr = pb_resultviewer(self.projectLocation, fname, result)
self.pbr.show()
else:
logging.info(self.tr("Support for {} is coming soon.").format(pathparts[-3]))
logging.info(self.tr("Support for {} is coming soon.").format(pathparts[-2]))


class TreeView(QTreeView):
Expand Down
1 change: 1 addition & 0 deletions core/widgets/Contingency/contingency_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def writeOutputFile(self):
self.projectLocation,
"results",
"statistics",
"contingency",
self.ui.outputFileNameLineEdit.text() +
"_ctg.npz")
np.savez_compressed(outputPath,
Expand Down
Loading