diff --git a/.github/workflows/build-windows-executable-app.yaml b/.github/workflows/build-windows-executable-app.yaml index bed4655b..77be95a9 100644 --- a/.github/workflows/build-windows-executable-app.yaml +++ b/.github/workflows/build-windows-executable-app.yaml @@ -14,7 +14,7 @@ env: OPENMS_VERSION: 3.2.0 PYTHON_VERSION: 3.11.0 # Name of the installer - APP_NAME: FLASHApp-0.8.0 + APP_NAME: FLASHApp-0.8.2 APP_UpgradeCode: "69ae44ad-d554-4e3c-8715-7c4daf60f8bb" jobs: diff --git a/example-data/workspaces/default/flashdeconv/cache/cache.db b/example-data/workspaces/default/flashdeconv/cache/cache.db index 2de26094..01941e30 100644 Binary files a/example-data/workspaces/default/flashdeconv/cache/cache.db and b/example-data/workspaces/default/flashdeconv/cache/cache.db differ diff --git a/example-data/workspaces/default/flashtnt/cache/cache.db b/example-data/workspaces/default/flashtnt/cache/cache.db index 4ffbc990..c992ad1c 100644 Binary files a/example-data/workspaces/default/flashtnt/cache/cache.db and b/example-data/workspaces/default/flashtnt/cache/cache.db differ diff --git a/example-data/workspaces/demo_antibody/flashdeconv/cache/cache.db b/example-data/workspaces/demo_antibody/flashdeconv/cache/cache.db index 5b77bf22..b3019b29 100644 Binary files a/example-data/workspaces/demo_antibody/flashdeconv/cache/cache.db and b/example-data/workspaces/demo_antibody/flashdeconv/cache/cache.db differ diff --git a/example-data/workspaces/demo_antibody/flashtnt/cache/cache.db b/example-data/workspaces/demo_antibody/flashtnt/cache/cache.db index 8f9a0203..11003b80 100644 Binary files a/example-data/workspaces/demo_antibody/flashtnt/cache/cache.db and b/example-data/workspaces/demo_antibody/flashtnt/cache/cache.db differ diff --git a/example-data/workspaces/demo_aqpz/flashdeconv/cache/cache.db b/example-data/workspaces/demo_aqpz/flashdeconv/cache/cache.db index 7950316f..509e9da8 100644 Binary files a/example-data/workspaces/demo_aqpz/flashdeconv/cache/cache.db and b/example-data/workspaces/demo_aqpz/flashdeconv/cache/cache.db differ diff --git a/example-data/workspaces/demo_aqpz/flashtnt/cache/cache.db b/example-data/workspaces/demo_aqpz/flashtnt/cache/cache.db index bce74124..71848d4c 100644 Binary files a/example-data/workspaces/demo_aqpz/flashtnt/cache/cache.db and b/example-data/workspaces/demo_aqpz/flashtnt/cache/cache.db differ diff --git a/settings.json b/settings.json index e0d3baf0..9171fdd8 100644 --- a/settings.json +++ b/settings.json @@ -1,7 +1,7 @@ { "app-name": "FLASHApp", "github-user": "OpenMS", - "version": "0.8.0", + "version": "0.8.2", "repository-name": "FLASHApp", "analytics": { "google-analytics": { diff --git a/src/Workflow.py b/src/Workflow.py index 8827f10e..5daa3c8d 100644 --- a/src/Workflow.py +++ b/src/Workflow.py @@ -80,12 +80,12 @@ def execution(self) -> None: try: in_mzmls = self.file_manager.get_files(self.params["mzML-files"]) except ValueError: - st.error('Please select at least one mzML file.') + self.logger.log('Please select at least one mzML file.') return try: database = self.file_manager.get_files(self.params["fasta-file"]) except ValueError: - st.error('Please select a database.') + self.logger.log('Please select a database.') return # Make sure output directory exists @@ -298,10 +298,10 @@ def configure(self) -> None: def execution(self) -> None: # Get input files - try: + try: in_mzmls = self.file_manager.get_files(self.params["mzML-files"]) except ValueError: - st.error('Please select at least one mzML file.') + self.logger.log('Please select at least one mzML file.') return # Define output directory diff --git a/src/workflow/StreamlitUI.py b/src/workflow/StreamlitUI.py index 892cec82..a8f7cf51 100644 --- a/src/workflow/StreamlitUI.py +++ b/src/workflow/StreamlitUI.py @@ -1032,7 +1032,45 @@ def execution_section(self, start_workflow_function) -> None: with st.expander("**Summary**"): st.markdown(self.export_parameters_markdown()) - self.show_log(start_workflow_function) + if OS_PLATFORM == 'win32': + self.show_log(start_workflow_function) + return + + c1, c2 = st.columns(2) + # Select log level, this can be changed at run time or later without re-running the workflow + log_level = c1.selectbox( + "log details", ["minimal", "commands and run times", "all"], key="log_level" + ) + if self.executor.pid_dir.exists(): + if c1.button("Stop Workflow", type="primary", use_container_width=True): + self.executor.stop() + st.rerun() + elif c1.button("Start Workflow", type="primary", use_container_width=True): + start_workflow_function() + time.sleep(3) + st.rerun() + log_path = Path(self.workflow_dir, "logs", log_level.replace(" ", "-") + ".log") + if log_path.exists(): + if self.executor.pid_dir.exists(): + with st.spinner("**Workflow running...**"): + with open(log_path, "r", encoding="utf-8") as f: + st.code( + "".join(f.readlines()[-30:]), + language="neon", + line_numbers=False, + ) + time.sleep(2) + st.rerun() + else: + st.markdown( + f"**Workflow log file: {datetime.fromtimestamp(log_path.stat().st_ctime).strftime('%Y-%m-%d %H:%M')} CET**" + ) + with open(log_path, "r", encoding="utf-8") as f: + content = f.read() + # Check if workflow finished successfully + if not "WORKFLOW FINISHED" in content: + st.error("**Errors occurred, check log file.**") + st.code(content, language="neon", line_numbers=False) def results_section(self, custom_results_function) -> None: custom_results_function()