mip_dmp.qt5

The mip_dmp.qt5 subpackage contains sub-packages and modules for PySide2 UI components of the MIP Dataset Mapper.

mip_dmp.qt5.components sub-package

mip_dmp.qt5.components.dataset_mapper_window

Module that defines the class dedicated to the main window of the MIP Dataset Mapper UI application.

class mip_dmp.qt5.components.dataset_mapper_window.MIPDatasetMapperWindow(mainWindow)[source]

Bases: object

Class for the main window of the MIP Dataset Mapper UI application.

adjustWindow(mainWindow)[source]

Adjust the window size, Qt Style Sheet, and title.

Parameters

mainWindowQMainWindow

The main window of the application.

createComponents(mainWindow)[source]

Create the UI components.

Parameters

mainWindowQMainWindow

The main window of the application.

createToolBar(mainWindow)[source]

Create the tool bar.

Parameters

mainWindowQMainWindow

The main window of the application.

createInputDatasetComponents(mainWindow)[source]

Create the components of the input dataset group box.

Parameters

mainWindowQMainWindow

The main window of the application.

createTargetCDEsComponents(mainWindow)[source]

Create the components of the target CDEs group box.

Parameters

mainWindowQMainWindow

The main window of the application.

createMappingComponents(mainWindow)[source]

Create the components of the mapping group box.

Parameters

mainWindowQMainWindow

The main window of the application.

createMappingTableRowViewComponents()[source]

Create the components of the mapping table row editor group box.

adjustWidgetsAndLayouts()[source]

Add widgets to the layouts of the UI elements.

connectButtons()[source]

Connect the buttons to their corresponding functions.

embeddingViz()[source]

Open the embedding visualization window.

matchingViz()[source]

Open the matching visualization window.

addMappingTableRow()[source]

Add a row to the mapping table.

deleteMappingTableRow()[source]

Delete the selected row from the mapping table.

initializeMappingEditForm(index)[source]

Initialize the mapping row editor form with the data of the selected row.

Parameters

indexQModelIndex

The index of the selected row in the mapping table.

updateMappingEditForm(index)[source]

Update the mapping table row form for a given index.

Parameters

indexQModelIndex

The index of the selected row to be updated in the mapping table.

updateMappingTableRow()[source]

Update the selected row of the mapping table with the data of the form.

loadInputDataset()[source]

Load the input dataset.

loadCDEsFile()[source]

Load the CDEs file.

loadMapping()[source]

Load the mapping file.

saveMapping()[source]

Save the mapping file.

disableMappingMapButtons()[source]

Disable the check / save / load mapping and map buttons.

disableMappingInitItems()[source]

Disable the mapping initialization items.

enableMappingInitItems()[source]

Enable the mapping initialization items.

enableMappingButtons()[source]

Enable the check / save / load mapping and map buttons.

disableMappingComponents()[source]

Disable the mapping components.

enableMappingComponents()[source]

Enable the mapping components.

checkMapping()[source]

Check the content of the mapping table.

This function checks if:

  • The mapping table contains unique mapping to a specific CDE code.

  • The mapping contains only valid CDE codes.

  • The mapping transform is correctly formatted.

initMapping()[source]

Initialize an empty column/CDEs mapping table.

mappingMatch()[source]

Initialize the column/CDEs mapping based on fuzzy word matching and character embedding methods.

selectOutputFilename()[source]

Select the output filename.

updateStatusbar(message)[source]

Update the statusbar with the given message.

map()[source]

Map the input dataset to the target CDEs.

centralWidgetGridLayout
centralWidgetSplitter
centralwidget
columnsCDEsMappingGroupBox
columnsCDEsMappingGroupBoxLayout
columnsCDEsMappingSplitter
inputDatasetFormLayout
inputDatasetFormLayoutWidget
inputDatasetGroupBox
inputDatasetGroupBoxLayout
inputDatasetLoadButton
inputDatasetPathLabel
inputDatasetTableView
leftCentralWidgetSplitter
mapButton
mappingFilePathLabel
mappingFormLayout
mappingFormLayoutWidget
mappingLoadButton
mappingSaveButton
mappingCheckButton
mappingTableView
outputDirectoryLabel
outputDirectorySelectButton
outputFilenameLabel
outputFilenameSelectButton
outputFormLayout
outputFormLayoutWidget
outputGroupBox
outputGroupBoxLayout
rightCentralWidgetSplitter
targetCDEsFormLayout
targetCDEsFormLayoutWidget
targetCDEsGroupBox
targetCDEsGroupBoxLayout
targetCDEsLoadButton
targetCDEsPathLabel
targetCDEsTableView
inputDatasetPath
inputDataset
inputDatasetColumns
inputDatasetPandasModel
targetCDEsPath
targetCDEs
targetCDEsPandasModel
mappingFilePath
columnsCDEsMappingData
columnsCDEsMappingPandasModel
mappingTableRowUpdateGroupBox
mappingTableRowUpdateGroupBoxLayout
mappingRowIndex
mappingTableViewWidget
mappingTableViewLayout
mappingTableViewAddDeleteRowWidget
mappingTableViewAddDeleteRowLayout
mappingTableViewAddRowButton
mappingTableViewDeleteRowButton
datasetColumn
cdeCode
cdeType
transformType
transform
matchedCdeCodes
updateMappingRowButton
outputDirectoryPath
outputFilename
statusbar
toolBar
mappingInitLabel
initMatchingMethod
mappingInitButton
embeddingVizButton
embeddingFigure
embeddingWidget
embeddingWidgetLayout
embeddingCanvas
inputDatasetColumnEmbeddings
targetCDEsEmbeddings
matchingVizButton
matchingWidget

mip_dmp.qt5.components.embedding_visualization_widget

Module that defines the class dedicated to the widget that supports the visualization of the initial automated mapping matches via embedding.

class mip_dmp.qt5.components.embedding_visualization_widget.WordEmbeddingVisualizationWidget(parent=None)[source]

Bases: QWidget

Class for the widget that supports the visualization of the automated column / CDE code matches via embedding.

adjustWindow()[source]

Adjust the window size, Qt Style Sheet, and title.

Parameters

mainWindowQMainWindow

The main window of the application.

generate_embedding_figure()[source]

Generate 3D scatter plot showing dimensionality-reduced embedding vectors of the words.

generate_embeddings(inputDatasetColumns: list, targetCDECodes: list, matchingMethod: str)[source]

Generate the embeddings of the columns and CDE codes.

Set the input dataset columns (self.inputDatasetColumns), the target CDE codes (self.targetCDECodes), the input dataset column embeddings (self.inputDatasetColumnEmbeddings) and the target CDE code embeddings (self.targetCDECodeEmbeddings).

The embeddings are generated using the specified matching method (matchingMethod). The matching method can be “glove” or “chars2vec”.

inputDatasetColumns: list

List of the input dataset columns.

targetCDECodes: list

List of the target CDE codes.

matchingMethod: str

Matching method. Can be “glove” or “chars2vec”

set_embeddings(inputDatasetColumnEmbeddings: list, inputDatasetColumns: list, targetCDECodeEmbeddings: list, targetCDECodes: list, matchedCdeCodes: dict, matchingMethod: str)[source]

Set the input dataset column and target CDE code embeddings.

inputDatasetColumnEmbeddings: list

List of the input dataset column embeddings.

inputDatasetColumns: list

List of the input dataset columns.

targetCDECodeEmbeddings: list

List of the target CDE code embeddings.

targetCDECodes: list

List of the target CDE codes.

matchedCdeCodes: dict

Dictionary of the matched CDE codes in the form:

{
    "input_dataset_column1": {
        "words": ["cde_code1", "cde_code2", ...],
        "embeddings": [embedding_vector1, embedding_vector2, ...]
        "distances": [distance1, distance2, ...]
    },
    "input_dataset_column2": {
        "words": ["cde_code1", "cde_code2", ...],
        "embeddings": [embedding_vector1, embedding_vector2, ...]
        "distances": [distance1, distance2, ...]
    },
    ...
}
matchingMethod: str

Matching method. Can be “glove” or “chars2vec”.

set_matching_method(matchingMethod)[source]

Set the matching method.

matchingMethod: str

Matching method. Can be “glove” or “chars2vec”

set_word_list(wordList)[source]

Set the list of words that can be visualized in the 3D scatter plot.

wordList: list

List of words to visualize in the 3D scatter plot

set_wordcombobox_items(wordList)[source]

Set the items of the word combo box.

wordList: list

List of words to visualize in the combo box of the widget that controls the selection of the word to visualize in the 3D scatter plot.

staticMetaObject = <PySide2.QtCore.QMetaObject object>

mip_dmp.qt5.components.matching_visualization_widget

Module that defines the class for the widget that supports the visualization of the distances obtained by the automated mapping matches for the n most similar CDE codes.

class mip_dmp.qt5.components.matching_visualization_widget.MatchingVisualizationWidget(inputDatasetColumns=None, targetCDECodes=None, matchedCdeCodes=None, matchingMethod=None, parent=None)[source]

Bases: QWidget

Class for the widget that supports the visualization of the distances / similarity measures obtained by the automated mapping matches for the n most similar CDE codes.

adjustWindow()[source]

Adjust the window size, Qt Style Sheet, and title.

Parameters

mainWindowQMainWindow

The main window of the application.

generate_heatmap_figure()[source]

Generate a heatmap figure with seaborn that shows the similarity / distance matrix of the input dataset columns and the target CDE codes.

set_wordcombobox_items(wordList)[source]

Set the items of the word combo box.

Parameters

wordList: list

List of the words to add to the combo box.

staticMetaObject = <PySide2.QtCore.QMetaObject object>

mip_dmp.qt5.model sub-package

mip_dmp.qt5.model.table_model

Module to describe Qt/PySide2 Table Models.

class mip_dmp.qt5.model.table_model.NoEditorDelegate[source]

Bases: QItemDelegate

Class to define a custom item delegate with no editor.

createEditor(parent, opt, index)[source]

Create the editor for the given index.

staticMetaObject = <PySide2.QtCore.QMetaObject object>
class mip_dmp.qt5.model.table_model.PandasTableModel(data)[source]

Bases: QAbstractTableModel

Qt Table Model for Pandas DataFrames.

columnCount(index)[source]

Return the number of columns in the table.

data(index, role)[source]

Return the data for the given index and role.

flags(index)[source]

Return the flags for the given index.

headerData(section, orientation, role)[source]

Return the header data for the given section.

rowCount(index)[source]

Return the number of rows in the table.

setData(index, value, role)[source]

Set the data for the given index and role.

staticMetaObject = <PySide2.QtCore.QMetaObject object>
class mip_dmp.qt5.model.table_model.QComboBoxDelegate(*args, **kwargs)[source]

Bases: QItemDelegate

Class to define a custom item delegate with QComboBox editor.

createEditor(self, parent: PySide2.QtWidgets.QWidget, option: PySide2.QtWidgets.QStyleOptionViewItem, index: PySide2.QtCore.QModelIndex) PySide2.QtWidgets.QWidget[source]
setItems(items)[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>