Skip to content

Commit a4b15f7

Browse files
authored
Merge pull request #35 from MIDRC/feature/pip_support
Feature/pip support
2 parents 7c32679 + 9af8609 commit a4b15f7

3 files changed

Lines changed: 67 additions & 12 deletions

File tree

MANIFEST.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include README.md
2+
include LICENSE
3+
recursive-include src *
4+
include jsdconfig-example.yaml
5+
recursive-include data *.xls *.xlsx

setup.py

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,51 @@
11
from setuptools import find_packages, setup
2+
from pathlib import Path
3+
4+
here = Path(__file__).parent
5+
long_description = (here / "README.md").read_text(encoding="utf-8")
26

37
setup(
4-
name='midrc_react',
5-
version='0.1.0',
6-
packages=find_packages(where='src'),
7-
package_dir={'': 'src'},
8+
name="midrc_react",
9+
version="0.1.0",
10+
description="The MIDRC Representativeness Exploration and Comparison Tool (REACT) is a tool designed to compare the representativeness of biomedical data.",
11+
long_description=long_description,
12+
long_description_content_type="text/markdown",
13+
author="Robert Tomek",
14+
author_email="rtomek@uchicago.edu",
15+
url="https://github.com/MIDRC/MIDRC-REACT",
16+
classifiers=[
17+
"Programming Language :: Python :: 3",
18+
"Programming Language :: Python :: 3.10",
19+
"License :: OSI Approved :: MIT License",
20+
"Operating System :: OS Independent",
21+
],
22+
packages=find_packages(where="src"),
23+
package_dir={"": "src"},
824
include_package_data=True,
925
install_requires=[
10-
# list additional dependencies here, for example:
11-
# 'numpy',
12-
# 'pandas',
26+
"numpy>=1.26.0",
27+
"pandas>=2.2.0",
28+
"PySide6>=6.6.0",
29+
"scipy>=1.12.0",
30+
"openpyxl>=3.1.0",
31+
"pytest>=8.1.0",
32+
"PyYAML>=6.0.0",
33+
"prince>=0.15.0",
34+
"dash>=2.18.2",
35+
"plotly>=5.24.1",
36+
"matplotlib>=3.9.0",
37+
"seaborn>=0.13.2",
38+
"ipywidgets>=8.1.5",
39+
"ipython>=8.28.0",
40+
"python-dateutil>=2.9.0.post0",
41+
"tabulate>=0.9.0",
42+
"scikit-learn>=1.6.1",
1343
],
44+
python_requires=">=3.10",
1445
entry_points={
15-
'console_scripts': [
16-
'midrc-react=midrc_react.gui.pyside6.launch_react:launch_react',
17-
'MIDRC-REACT=midrc_react.gui.pyside6.launch_react:launch_react',
46+
"console_scripts": [
47+
"midrc-react=midrc_react.gui.pyside6.launch_react:launch_react",
48+
"MIDRC-REACT=midrc_react.gui.pyside6.launch_react:launch_react",
1849
],
1950
},
2051
)

src/midrc_react/gui/pyside6/jsdview.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,17 @@ def update_pie_chart_dock(self, sheet_dict: Dict[Any, Any]) -> None:
304304
clear_layout(self.pie_chart_layout)
305305
categorybox = self.dataselectiongroupbox.category_combobox
306306
categories: List[str] = [categorybox.itemText(i) for i in range(categorybox.count())]
307+
308+
# Create a mapping for a fixed ordering per category using the first sheet encountered that has it.
309+
common_order: Dict[str, List[str]] = {}
310+
for category in categories:
311+
common_order[category] = []
312+
for sheets in sheet_dict.values():
313+
if category in sheets:
314+
for col in sheets[category].data_columns:
315+
if col not in common_order[category]:
316+
common_order[category].append(col)
317+
307318
timepoint: int = -1
308319
file_comboboxes = self.dataselectiongroupbox.file_comboboxes
309320
labels: List[QLabel] = JsdWindow._create_pie_chart_labels(sheet_dict, file_comboboxes)
@@ -317,9 +328,17 @@ def update_pie_chart_dock(self, sheet_dict: Dict[Any, Any]) -> None:
317328
if category not in sheets:
318329
continue
319330
df = sheets[category].df
320-
cols_to_use = sheets[category].data_columns
331+
sheet_order = sheets[category].data_columns
332+
# Use common order, but include only columns that exist in the current sheet.
333+
final_order = [col for col in common_order.get(category, []) if col in sheet_order]
334+
# Append any extra columns from the sheet that are not already in final_order.
335+
final_order += [col for col in sheet_order if col not in final_order]
336+
# Ensure 'Not Reported' is always the last column.
337+
if "Not Reported" in final_order:
338+
final_order = [col for col in final_order if col != "Not Reported"] + ["Not Reported"]
339+
321340
series = QPieSeries()
322-
for col in cols_to_use:
341+
for col in final_order:
323342
value = df[col].iloc[timepoint]
324343
if value > 0:
325344
series.append(col, value)

0 commit comments

Comments
 (0)