Skip to content

Commit

Permalink
PySimpleGUI -> FreeSimpleGUI (#35)
Browse files Browse the repository at this point in the history
Switch to FreeSimpleGUI before the last free PySimpleGUI version gets pulled from PyPI.
Closes #7.
  • Loading branch information
dweindl authored Jan 13, 2025
1 parent 8d078ea commit cb484eb
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies = [
"scikit-learn",
"scipy",
"seaborn",
"PySimpleGUI==4.60.5.0",
"FreeSimpleGUI",
]
requires-python = ">=3.10"

Expand Down
2 changes: 1 addition & 1 deletion src/ccompass/CCMPS.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

# import runpy

import PySimpleGUI as sg
import FreeSimpleGUI as sg
import pandas as pd

import os
Expand Down
2 changes: 1 addition & 1 deletion src/ccompass/CCMPS_actions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PySimpleGUI as sg
import FreeSimpleGUI as sg
import numpy as np
import pandas as pd
from tkinter import messagebox, simpledialog
Expand Down
2 changes: 1 addition & 1 deletion src/ccompass/CM.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
##### CLASS MANAGER

import PySimpleGUI as sg
import FreeSimpleGUI as sg
import numpy as np
import pandas as pd

Expand Down
2 changes: 1 addition & 1 deletion src/ccompass/FDP.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import copy
import numpy as np
import pandas as pd
import PySimpleGUI as sg
import FreeSimpleGUI as sg
from tkinter import messagebox
from sklearn.preprocessing import MinMaxScaler
from scipy.stats import pearsonr
Expand Down
2 changes: 1 addition & 1 deletion src/ccompass/FSD.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
##### FRACTIONATION SUMMARY DISPLAY

import PySimpleGUI as sg
import FreeSimpleGUI as sg


## internal functions:
Expand Down
2 changes: 1 addition & 1 deletion src/ccompass/NPC.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import copy
import numpy as np
import pandas as pd
import PySimpleGUI as sg
import FreeSimpleGUI as sg
from tkinter import messagebox, simpledialog

from .NPC_func import (
Expand Down
2 changes: 1 addition & 1 deletion src/ccompass/PPMS.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
##### PREPARAMETERS

import PySimpleGUI as sg
import FreeSimpleGUI as sg
from . import PPMS_actions as action
import copy

Expand Down
26 changes: 13 additions & 13 deletions src/ccompass/RP.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### RESULT PLOTS
import PySimpleGUI as sg
import FreeSimpleGUI as sg
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
Expand All @@ -16,7 +16,7 @@ def RP_gradient_heatmap(fract_data):
# Get the list of conditions from fract_data['vis']
conditions = list(fract_data["vis"].keys())

# Define the PySimpleGUI layout
# Define the layout
layout = [
[sg.Text("Select Condition:")],
[
Expand Down Expand Up @@ -118,7 +118,7 @@ def export_results(fract_data, folder_path):
# Generate the heatmap with hierarchical clustering and condition name as the title
heatmap_image = plot_heatmap(df, selected_condition)

# Convert the heatmap image to PNG and update the PySimpleGUI window
# Convert the heatmap image to PNG and update the window
bio = BytesIO()
heatmap_image.save(bio, format="PNG")
window["-HEATMAP-"].update(data=bio.getvalue())
Expand All @@ -141,7 +141,7 @@ def RP_stats_heatmap(results):
# Get the list of conditions from results
conditions = list(results.keys())

# Define the PySimpleGUI layout
# Define the GUI layout
layout = [
[sg.Text("Select Condition:")],
[
Expand Down Expand Up @@ -259,7 +259,7 @@ def export_results(results, folder_path):
# Generate the heatmap with hierarchical clustering and condition name as the title
heatmap_image = plot_heatmap(df, selected_condition)

# Convert the heatmap image to PNG and update the PySimpleGUI window
# Convert the heatmap image to PNG and update the window
bio = BytesIO()
heatmap_image.save(bio, format="PNG")
window["-HEATMAP-"].update(data=bio.getvalue())
Expand All @@ -280,7 +280,7 @@ def RP_stats_distribution(results):
# Get the list of conditions from results
conditions = list(results.keys())

# Define the PySimpleGUI layout
# Define the layout
layout = [
[sg.Text("Select Condition:")],
[
Expand Down Expand Up @@ -381,7 +381,7 @@ def export_pie_charts(results, folder_path):
# Generate the pie chart for the class distribution
pie_chart_image = plot_pie_chart(df, selected_condition)

# Convert the pie chart image to PNG and update the PySimpleGUI window
# Convert the pie chart image to PNG and update the window
bio = BytesIO()
pie_chart_image.save(bio, format="PNG")
window["-PIECHART-"].update(data=bio.getvalue())
Expand All @@ -402,7 +402,7 @@ def RP_global_heatmap(comparison):
# Get the list of comparisons from the dictionary keys
comparisons = list(comparison.keys())

# Define the PySimpleGUI layout
# Define the layout
layout = [
[sg.Text("Select Comparison:")],
[
Expand Down Expand Up @@ -536,7 +536,7 @@ def export_heatmaps(comparison, folder_path):
# Generate the heatmap with hierarchical clustering and comparison name as the title
heatmap_image = plot_heatmap(df_filtered_for_plot, selected_comparison)

# Convert the heatmap image to PNG and update the PySimpleGUI window
# Convert the heatmap image to PNG and update the window
bio = BytesIO()
heatmap_image.save(bio, format="PNG")
window["-HEATMAP-"].update(data=bio.getvalue())
Expand All @@ -557,7 +557,7 @@ def RP_global_distance(comparison):
# Get the list of comparisons from the dictionary keys
comparisons = list(comparison.keys())

# Define the PySimpleGUI layout
# Define the layout
layout = [
[sg.Text("Select Comparison:")],
[
Expand Down Expand Up @@ -678,7 +678,7 @@ def export_scatter_data(comparison, folder_path):
# Generate the scatter plot with the selected comparison name
scatter_image = plot_scatter(df, selected_comparison)

# Convert the scatter plot image to PNG and update the PySimpleGUI window
# Convert the scatter plot image to PNG and update the window
bio = BytesIO()
scatter_image.save(bio, format="PNG")
window["-SCATTERPLOT-"].update(data=bio.getvalue())
Expand All @@ -705,7 +705,7 @@ def RP_class_heatmap(results):
# Find the intersection of classnames across all conditions
common_classnames = list(set.intersection(*classnames_lists))

# Define the PySimpleGUI layout
# Define the layout
layout = [
[sg.Text("Select Classname:")],
[
Expand Down Expand Up @@ -863,7 +863,7 @@ def export_heatmaps(results, common_classnames, folder_path):
# Generate the heatmap for the selected classname, using condition names as column labels
heatmap_image = plot_heatmap(df_zscore, selected_classname, conditions)

# Convert the heatmap image to PNG and update the PySimpleGUI window
# Convert the heatmap image to PNG and update the window
if heatmap_image:
bio = BytesIO()
heatmap_image.save(bio, format="PNG")
Expand Down
2 changes: 1 addition & 1 deletion src/ccompass/SM.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## SHOW MARKERS


import PySimpleGUI as sg
import FreeSimpleGUI as sg
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
Expand Down
2 changes: 1 addition & 1 deletion src/ccompass/TM.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
##### TEST MARKER

import PySimpleGUI as sg
import FreeSimpleGUI as sg
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
Expand Down
2 changes: 1 addition & 1 deletion src/ccompass/TPP.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import math
import numpy as np
import pandas as pd
import PySimpleGUI as sg
import FreeSimpleGUI as sg
from tkinter import messagebox
from scipy.stats import pearsonr

Expand Down

0 comments on commit cb484eb

Please sign in to comment.