Skip to content

mainwindow

sgp.ui.mainwindow.__version__ module-attribute

__version__: str = _get_version()

sgp.ui.mainwindow.config module-attribute

config = Config(verbose=lower() in trues, password=get('SGP_PASSWORD', ''), numba_enabled=get('NUMBA_DISABLE_JIT', '0') == '0', language=value('language', name()))

sgp.ui.mainwindow.settings module-attribute

settings = QSettings('Hailin Wang', 'Shanghai Geotechnical Parameters')

sgp.ui.mainwindow.ANN

Bases: PredictionBase

Artificial Neural Network (ANN) model.

sgp.ui.mainwindow.HSSTab

Bases: QWidget, QObject

Widget for displaying soil properties for the HSS model.

sgp.ui.mainwindow.HSSTab.ann property

ann: ANN

Get the ann object.

sgp.ui.mainwindow.HSSTab.io property

io: SGPIO

Get the io object.

sgp.ui.mainwindow.HSSTab.mpd property

mpd: MPD

Get the mpd object.

sgp.ui.mainwindow.HSSTab.addInputProperty

addInputProperty(key: str, **options) -> PropertyWidget

Add an input property to the list.

sgp.ui.mainwindow.HSSTab.addOutputProperty

addOutputProperty(key: str, SpinBox: Type[QDoubleSpinBox] = QtWidgets.QDoubleSpinBox, **options) -> PropertyWidget

Add an output property to the list.

sgp.ui.mainwindow.HSSTab.inputs

inputs() -> Dict[str, float]

Get the input properties.

sgp.ui.mainwindow.HSSTab.soilType

soilType() -> Literal['黏土', '砂土']

Get the soil type.

sgp.ui.mainwindow.HSSTab.updateOutputProperties

updateOutputProperties()

Update the output properties.

sgp.ui.mainwindow.MPD

Bases: PredictionBase

Multivariate Distribution (MPD) model.

sgp.ui.mainwindow.MPD.corr_bootstrap

corr_bootstrap(X: ndarray) -> ndarray

Calculate the correlation matrix.

sgp.ui.mainwindow.MPD.dist

Get the distributional results.

sgp.ui.mainwindow.MPD.fit

fit()

Fit the Johnson distribution to the data.

RETURNS DESCRIPTION
A tuple containing the distributions, the optimization results, the statistics, and the p-values.

sgp.ui.mainwindow.MPD.optimize

optimize(df: DataFrame, *, method: Optimizers, **kwargs)

Optimize the z-value for the Johnson distribution.

sgp.ui.mainwindow.Model

The prediction model

sgp.ui.mainwindow.Model.__init__

__init__(io: SGPIO)

Initialize the model.

sgp.ui.mainwindow.QueryTab

Bases: QWidget, QObject

Widget for displaying query properties.

sgp.ui.mainwindow.QueryTab.ann property

ann: ANN

Get the ann object.

sgp.ui.mainwindow.QueryTab.io property

io: SGPIO

Get the io object.

sgp.ui.mainwindow.QueryTab.mpd property

mpd: MPD

Get the mpd object.

sgp.ui.mainwindow.QueryTab.addInputProperty

addInputProperty()

Add a property to the list.

sgp.ui.mainwindow.QueryTab.deleteInputProperty

deleteInputProperty()

Delete a property from the list.

sgp.ui.mainwindow.QueryTab.inputs

inputs() -> dict[str, float]

Get the input values.

sgp.ui.mainwindow.QueryTab.predictANN

predictANN()

Predict the properties by ANN.

sgp.ui.mainwindow.QueryTab.predictMPD

predictMPD()

Predict the properties by MPD.

sgp.ui.mainwindow.QueryTab.setANNOutputs

setANNOutputs(outputs: dict[str, float])

Set the output values.

sgp.ui.mainwindow.QueryTab.updateMPDOutputProperty

updateMPDOutputProperty()

Update the output property.

sgp.ui.mainwindow.SGPIO

sgp.ui.mainwindow.SGPMainWindow

Bases: MainWindow, QObject

Custom main window for the qtconsole that adds a window for displaying matplotlib figures.

sgp.ui.mainwindow.SGPMainWindow.ann property

ann: ANN

Get the ann object.

sgp.ui.mainwindow.SGPMainWindow.io property

io: SGPIO

Get the io object.

sgp.ui.mainwindow.SGPMainWindow.mpd property

mpd: MPD

Get the mpd object.

sgp.ui.mainwindow.SGPMainWindow.about

about()

Show the information about the application.

sgp.ui.mainwindow.SGPMainWindow.corrData

corrData() -> dict

Get the correlation data.

sgp.ui.mainwindow.SGPMainWindow.corrTab

corrTab(data: dict = None) -> TableWidget

Query the correlation matrix.

sgp.ui.mainwindow.SGPMainWindow.distData

distData() -> dict

Get the distribution data.

sgp.ui.mainwindow.SGPMainWindow.distTab

distTab(data: dict = None) -> TableWidget

Query the distribution parameters.

sgp.ui.mainwindow.SGPMainWindow.english

english()

Change the language to English.

sgp.ui.mainwindow.SGPMainWindow.fromBytes

fromBytes(*, bytes: bytes | None = None, path: str | None = None, **kwargs)

Load the project from a binary string or file if a path is provided.

sgp.ui.mainwindow.SGPMainWindow.fromCryptography

fromCryptography(*, binary: bytes | None = None, path: str | None = None, **kwargs)

Load the project from a binary string or file if a path is provided.

sgp.ui.mainwindow.SGPMainWindow.fromDict

fromDict(*, data: dict, **kwargs)

Load the project from a dictionary.

sgp.ui.mainwindow.SGPMainWindow.fromJson

fromJson(*, string: str | None = None, path: str | None = None, **kwargs)

Load the project from a json string or file if a path is provided.

sgp.ui.mainwindow.SGPMainWindow.fromToml

fromToml(*, string: str | None = None, path: str | None = None, **kwargs)

Load the project from a toml string or file if a path is provided.

sgp.ui.mainwindow.SGPMainWindow.fromYaml

fromYaml(*, string: str | None = None, path: str | None = None, **kwargs)

Load the project from a yaml string or file if a path is provided.

sgp.ui.mainwindow.SGPMainWindow.github

github()

Open project GitHub homepage.

sgp.ui.mainwindow.SGPMainWindow.hssTab

hssTab() -> HSSTab

Query the parameters for the HSS model.

sgp.ui.mainwindow.SGPMainWindow.init_sgp_menu_bar

init_sgp_menu_bar()

Setup the menu bar.

sgp.ui.mainwindow.SGPMainWindow.new

new()

Create a new project.

sgp.ui.mainwindow.SGPMainWindow.open

open(filePath: str = None)

Open a project.

sgp.ui.mainwindow.SGPMainWindow.queryTab

queryTab() -> QueryTab

Query the parameters from the database.

sgp.ui.mainwindow.SGPMainWindow.reportTab

reportTab() -> TableWidget

Show the statistics.

sgp.ui.mainwindow.SGPMainWindow.requestRestart

requestRestart()

Request a restart of the application.

sgp.ui.mainwindow.SGPMainWindow.save

save()

Save the project.

sgp.ui.mainwindow.SGPMainWindow.saveAs

saveAs()

Save the project as a new file.

sgp.ui.mainwindow.SGPMainWindow.setLanguage

setLanguage(language: Literal['en', 'zh_CN'])

Change the language of the application.

sgp.ui.mainwindow.SGPMainWindow.setupCentralWidget

setupCentralWidget()

Setup the central widget.

sgp.ui.mainwindow.SGPMainWindow.simplifiedChinese

simplifiedChinese()

Change the language to Chinese.

sgp.ui.mainwindow.SGPMainWindow.statsTab

statsTab() -> TableWidget

Show the statistics.

sgp.ui.mainwindow.SGPMainWindow.toBytes

toBytes(path: str | None = None, **kwargs) -> bytes | None

Convert the project to a binary string or save it to a file if a path is provided.

sgp.ui.mainwindow.SGPMainWindow.toCryptography

toCryptography(path: str | None = None, **kwargs) -> bytes | None

Convert the project to a binary string or save it to a file if a path is provided.

sgp.ui.mainwindow.SGPMainWindow.toDict

toDict(**kwargs) -> dict

Convert the project to a dictionary.

sgp.ui.mainwindow.SGPMainWindow.toJson

toJson(path: str | None = None, **kwargs) -> str | None

Convert the project to a json string or save it to a file if a path is provided.

sgp.ui.mainwindow.SGPMainWindow.toToml

toToml(path: str | None = None, **kwargs) -> str | None

Convert the project to a toml string or save it to a file if a path is provided.

sgp.ui.mainwindow.SGPMainWindow.toYaml

toYaml(path: str | None = None, **kwargs) -> str | None

Convert the project to a yaml string or save it to a file if a path is provided.

sgp.ui.mainwindow.TabWidget

Bases: QTabWidget

Tab widget with methods for adding tabs of any types.

sgp.ui.mainwindow.TabWidget.figures property

figures: dict[str, Figure]

Get all figures.

sgp.ui.mainwindow.TabWidget.addAnyTab

addAnyTab(widget: Type | QWidget, title: str, *args, **kwargs)

Add any tab to the tab widget.

PARAMETER DESCRIPTION
widget

A class or instance of the tab.

TYPE: Type | QWidget

title

The title of the tab.

TYPE: str

*args

The arguments and keyword arguments for the tab.

DEFAULT: ()

**kwargs

The arguments and keyword arguments for the tab.

DEFAULT: ()

sgp.ui.mainwindow.TabWidget.addFigureTab

addFigureTab(window: MainWindow, canvas: FigureCanvas)

Add a figure tab to the tab widget.

PARAMETER DESCRIPTION
window

The window to be displayed in the tab.

TYPE: MainWindow

canvas

The canvas to be displayed in the window.

TYPE: FigureCanvas

sgp.ui.mainwindow.TabWidget.addTableTab

addTableTab(data, title: str) -> TableWidget

Add a table tab to the tab widget.

PARAMETER DESCRIPTION
title

The title of the tab.

TYPE: str

data

The data to be displayed in the table.

TYPE: dict

sgp.ui.mainwindow.TabWidget.getCanvas

getCanvas(label: str) -> FigureCanvas

Get canvas with given label.

sgp.ui.mainwindow.TabWidget.getFigure

getFigure(label: str) -> Figure

Get figure with given label.

sgp.ui.mainwindow.execute_in_thread

execute_in_thread(func: Callable = None, *, slot: Callable = None)

Execute a function in a separate thread, usually for functions that do not return a value. For functions that return a value, use the slot parameter to connect the resultReady signal to a function that will receive the result.

PARAMETER DESCRIPTION
func

Function to be executed in a separate thread, by default None

TYPE: Callable DEFAULT: None

slot

Function to be connected to the resultReady signal when the result is ready, by default None

TYPE: Callable DEFAULT: None

sgp.ui.mainwindow.getIcon

getIcon(filename: str) -> QIcon

Get the icon.

sgp.ui.mainwindow.getSgpMainWindow

getSgpMainWindow() -> Optional['SGPMainWindow']

Return the main window for the application.

sgp.ui.mainwindow.timing

timing(func: Callable = None, *, target: Callable[[str], Any] = print)

Print the time taken for a function to execute.

PARAMETER DESCRIPTION
func

Function to be timed, by default None

TYPE: Callable DEFAULT: None

target

Function to print the timing information, by default print

TYPE: Callable[[str], Any] DEFAULT: print