Skip to content

Commit

Permalink
Simplify paths in src/ccompass/CCMPS.py (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl authored Jan 13, 2025
1 parent fe0cea7 commit 4ec1544
Showing 1 changed file with 17 additions and 36 deletions.
53 changes: 17 additions & 36 deletions src/ccompass/CCMPS.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import FreeSimpleGUI as sg
import pandas as pd
import os
from pathlib import Path

os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"

Expand Down Expand Up @@ -1512,11 +1513,8 @@ def main():
export_folder = sg.popup_get_folder("Statistics Report")
if export_folder:
for condition in results:
fname = (
export_folder
+ "/CCMPS_statistics_"
+ condition
+ ".xlsx"
fname = Path(
export_folder, f"CCMPS_statistics_{condition}.xlsx"
)
selected_columns = [
col
Expand All @@ -1538,13 +1536,9 @@ def main():
export_folder = sg.popup_get_folder("Global Changes Report")
if export_folder:
for comb in comparison:
fname = (
export_folder
+ "/CCMPS_comparison_"
+ comb[0]
+ "_"
+ comb[1]
+ ".xlsx"
fname = Path(
export_folder,
f"CCMPS_comparison_{comb[0]}_{comb[1]}.xlsx",
)
selected_columns = [
col
Expand All @@ -1570,11 +1564,9 @@ def main():
export_folder = sg.popup_get_folder("Class-centric Changes Report")
if export_folder:
for condition in results:
fname = (
export_folder
+ "/CCMPS_ClassComposition_"
+ condition
+ ".xlsx"
fname = Path(
export_folder,
f"CCMPS_ClassComposition_{condition}.xlsx",
)
selected_columns = [
col
Expand All @@ -1595,13 +1587,9 @@ def main():
]
df_out.to_excel(fname, index=True)
for comb in comparison:
fname = (
export_folder
+ "/CCMPS_ClassComparison_"
+ comb[0]
+ "_"
+ comb[1]
+ ".xlsx"
fname = Path(
export_folder,
f"CCMPS_ClassComparison_{comb[0]}_{comb[1]}.xlsx",
)
selected_columns = [
col
Expand Down Expand Up @@ -1674,11 +1662,8 @@ def main():
export_folder = sg.popup_get_folder("Export Statistics")
if export_folder:
for condition in results:
fname = (
export_folder
+ "/CCMPS_statistics_"
+ condition
+ ".tsv"
fname = Path(
export_folder, f"CCMPS_statistics_{condition}.tsv"
)
df_out = pd.merge(
fract_data["vis"][condition + "_median"],
Expand All @@ -1704,13 +1689,9 @@ def main():
export_folder = sg.popup_get_folder("Export Statistics")
if export_folder:
for comb in comparison:
fname = (
export_folder
+ "/CCMPS_comparison_"
+ comb[0]
+ "_"
+ comb[1]
+ ".tsv"
fname = Path(
export_folder,
f"CCMPS_comparison_{comb[0]}_{comb[1]}.tsv",
)
df_out = pd.DataFrame(
index=comparison[comb]["intersection_data"].index
Expand Down

0 comments on commit 4ec1544

Please sign in to comment.