Skip to content

Commit 5148a12

Browse files
authored
ENH: Kore LST support, release info for v2.1.0 (#71)
* add kore lst converter entry with `Ctrl+K` shortcut * explicitly call `write_crd()` in KORE2LST routine * swtich rimseval req to kore_lst_support branch * update release information to prepare for 2.1.0
1 parent 132c2cf commit 5148a12

File tree

7 files changed

+65
-59
lines changed

7 files changed

+65
-59
lines changed

.github/workflows/release_multi_os.yml

Lines changed: 9 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jobs:
1212
runs-on: windows-latest
1313
strategy:
1414
matrix:
15-
python-version: [3.11]
15+
python-version: [3.12]
1616
steps:
1717
- name: Checkout code
18-
uses: actions/checkout@v2
18+
uses: actions/checkout@v5
1919
- name: Set up Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v2
20+
uses: actions/setup-python@v5
2121
with:
2222
python-version: ${{ matrix.python-version }}
2323
- name: Install dependencies
@@ -57,12 +57,12 @@ jobs:
5757
runs-on: macos-latest
5858
strategy:
5959
matrix:
60-
python-version: [3.11]
60+
python-version: [3.12]
6161
steps:
6262
- name: Checkout code
63-
uses: actions/checkout@v2
63+
uses: actions/checkout@v5
6464
- name: Set up Python ${{ matrix.python-version }}
65-
uses: actions/setup-python@v2
65+
uses: actions/setup-python@v5
6666
with:
6767
python-version: ${{ matrix.python-version }}
6868
- name: Install dependencies
@@ -83,60 +83,23 @@ jobs:
8383
tag: ${{ github.ref }}
8484
overwrite: true
8585

86-
build-ubuntu-20-04:
87-
needs: build-windows
88-
name: Ubuntu Packaging 20.04
89-
runs-on: ubuntu-20.04
90-
strategy:
91-
matrix:
92-
python-version: [ 3.11 ]
93-
steps:
94-
- name: Checkout code
95-
uses: actions/checkout@v2
96-
- name: Install fpm (required for fbs)
97-
run: |
98-
sudo apt-get install ruby ruby-dev rubygems build-essential
99-
sudo gem install --no-document fpm
100-
fpm --version
101-
- name: Set up Python ${{ matrix.python-version }}
102-
uses: actions/setup-python@v2
103-
with:
104-
python-version: ${{ matrix.python-version }}
105-
- name: Install dependencies
106-
run: |
107-
python -m pip install --upgrade pip
108-
pip install -r requirements.txt
109-
pip install ${{ secrets.FBS_DL }}
110-
- name: Run fbs and freeze application
111-
run: |
112-
fbs freeze
113-
fbs installer
114-
- name: Upload binaries to release
115-
uses: svenstaro/upload-release-action@v2
116-
with:
117-
repo_token: ${{ secrets.GITHUB_TOKEN }}
118-
file: target/RIMSEvaluation.deb
119-
asset_name: RIMSEvaluation_Ubuntu_20.04.deb
120-
tag: ${{ github.ref }}
121-
overwrite: true
122-
12386
build-ubuntu-22-04:
12487
needs: build-windows
12588
name: Ubuntu Packaging 22.04
12689
runs-on: ubuntu-22.04
12790
strategy:
12891
matrix:
129-
python-version: [ 3.11 ]
92+
python-version: [ 3.12 ]
13093
steps:
13194
- name: Checkout code
132-
uses: actions/checkout@v2
95+
uses: actions/checkout@v5
13396
- name: Install fpm (required for fbs)
13497
run: |
13598
sudo apt-get install ruby ruby-dev rubygems build-essential
13699
sudo gem install --no-document fpm
137100
fpm --version
138101
- name: Set up Python ${{ matrix.python-version }}
139-
uses: actions/setup-python@v2
102+
uses: actions/setup-python@v5
140103
with:
141104
python-version: ${{ matrix.python-version }}
142105
- name: Install dependencies

release_text.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# RIMSEvalGUI v2.0.14
1+
# RIMSEvalGUI v2.1.0
22

3-
RIMSEvalGUI release based on the latest `rimseval` version `v2.0.2`.
3+
RIMSEvalGUI release based on the latest `rimseval` version `v2.1.0`.
44

55
**Main Changes to GUI:**
6-
- Peak overlaps now only trigger a question to the user to confirm the intention.
6+
- KORE LST files can now be converted to CRD files.
77

88

9-
Changes in `rimseval` package since last version: see [here](https://github.com/RIMS-Code/RIMSEval/releases/tag/v2.0.2).
9+
Changes in `rimseval` package since last version: see [here](https://github.com/RIMS-Code/RIMSEval/releases/tag/v2.1.0).

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PyQt6
22
pyqtdarktheme
3-
rimseval>=2.0.2
4-
git+https://github.com/trappitsch/pyqtconfig@DialogBox_fixes_for_PyQt6
3+
rimseval~=2.1
4+
pyqtconfig
55
matplotlib
66
numpy
77
requests

src/build/settings/base.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"app_name": "RIMSEvaluation",
33
"author": "Reto Trappitsch",
44
"main_module": "src/main/python/main.py",
5-
"version": "2.0.14"
5+
"version": "2.1.0"
66
}

src/main/python/dialogs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def about_text(self):
6767
)
6868
layout.addWidget(issues)
6969

70-
author = QtWidgets.QLabel("Reto Trappitsch, 2022")
70+
author = QtWidgets.QLabel("Reto Trappitsch")
7171
layout.addWidget(author)
7272

7373
button_box = QtWidgets.QDialogButtonBox(

src/main/python/main.py

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Main RIMSEval graphical user interface."""
22

3+
from importlib import metadata
34
import itertools
45
import json
56
from pathlib import Path
@@ -72,7 +73,7 @@ def __init__(self, appctxt, is_windows: bool = False):
7273
self.init_config_manager()
7374

7475
# window titles and geometry
75-
self.version = f"v{rimseval.__version__}"
76+
self.version = f"v{metadata.version('rimseval')}"
7677
self.setWindowTitle(f"RIMS Evaluation {self.version}")
7778
self.setGeometry(QtCore.QRect(310, 100, 700, 100))
7879

@@ -193,7 +194,7 @@ def __init__(self, appctxt, is_windows: bool = False):
193194

194195
# welcome the user
195196
self.status_bar.showMessage(
196-
f"Welcome to RIMSEval v{rimseval.__version__}", msecs=self.status_bar_time
197+
f"Welcome to RIMSEval v{self.version}", msecs=self.status_bar_time
197198
)
198199

199200
# update actions
@@ -770,6 +771,18 @@ def init_menu_toolbar(self):
770771

771772
# LST FILE ACTIONS #
772773

774+
kore_convert_action = QtGui.QAction(
775+
QtGui.QIcon(self.appctxt.get_resource("icons/blue-folder-import.png")),
776+
"Convert KORE to CRD",
777+
self,
778+
)
779+
kore_convert_action.setStatusTip("Convert KORE to CRD file(s)")
780+
kore_convert_action.setShortcut(QtGui.QKeySequence("Ctrl+k"))
781+
kore_convert_action.triggered.connect(self.convert_kore_to_crd)
782+
self.lst_menu.addAction(kore_convert_action)
783+
tool_bar.addSeparator()
784+
tool_bar.addAction(kore_convert_action)
785+
773786
lst_convert_action = QtGui.QAction(
774787
QtGui.QIcon(self.appctxt.get_resource("icons/blue-folder-import.png")),
775788
"Convert LST to CRD",
@@ -1637,6 +1650,36 @@ def calculate_batch(self):
16371650

16381651
# LST FILE FUNCTIONS #
16391652

1653+
def convert_kore_to_crd(self):
1654+
"""Convert a KORE LST file to CRD File(s)."""
1655+
query = QtWidgets.QFileDialog.getOpenFileNames(
1656+
self,
1657+
"Open LST File(s)",
1658+
directory=str(self.user_folder),
1659+
filter="KORE LST Files (*.lst)",
1660+
)[0]
1661+
1662+
if len(query) > 0:
1663+
fnames = [Path(it) for it in query]
1664+
for it, fname in enumerate(fnames):
1665+
try:
1666+
lst = rimseval.data_io.kore_to_crd.KORE2CRD(file_name=fname)
1667+
lst.write_crd()
1668+
1669+
self.status_bar.showMessage(
1670+
f"{fname.name} converted, {it + 1}/{len(fnames)} done.",
1671+
msecs=self.status_bar_time,
1672+
)
1673+
QtWidgets.QApplication.processEvents()
1674+
1675+
except OSError as err:
1676+
QtWidgets.QMessageBox.warning(
1677+
self, "KORE LST File error", err.args[0]
1678+
)
1679+
1680+
# set user path to this folder
1681+
self.user_folder = fname.parent
1682+
16401683
def convert_lst_to_crd(self, tagged=False):
16411684
"""Convert LST to CRD File(s).
16421685
@@ -1665,7 +1708,7 @@ def convert_lst_to_crd(self, tagged=False):
16651708
lst.write_crd()
16661709

16671710
self.status_bar.showMessage(
1668-
f"{fname.name} converted, {it+1}/{len(fnames)} done.",
1711+
f"{fname.name} converted, {it + 1}/{len(fnames)} done.",
16691712
msecs=self.status_bar_time,
16701713
)
16711714
QtWidgets.QApplication.processEvents()

src/requirements/base.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PyQt6
22
pyqtdarktheme
3-
rimseval==2.0.2
4-
git+https://github.com/trappitsch/pyqtconfig@DialogBox_fixes_for_PyQt6
3+
rimseval==2.1.0
4+
pyqtconfig
55
matplotlib
66
numpy
77
requests

0 commit comments

Comments
 (0)