Loading src/ips_fastran_gui/app/models/ips_fastran.py +12 −1 Original line number Diff line number Diff line """IPS Fastran classes.""" import logging import zipfile from io import BytesIO from pathlib import Path from typing import Tuple Loading Loading @@ -37,9 +39,18 @@ class IPSFastranTool(BasicTool): return self.tool, tool_params def get_results(self) -> Path: def get_output_path(self) -> Path: outputs = self.tool.get_results() dataset = outputs.get_dataset("output") dataset.download("output.nc") return Path("output.nc") def get_results(self, tool: Tool) -> bytes: outputs = tool.get_results() output = outputs.get_dataset("output").get_content() zip_buffer = BytesIO() with zipfile.ZipFile(zip_buffer, mode="w", compression=zipfile.ZIP_DEFLATED) as zf: zf.writestr("output.nc", output) zip_buffer.seek(0) return zip_buffer.getvalue() src/ips_fastran_gui/app/view_models/execution.py +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ class ExecutionViewModel: async def on_progress(self, _sender: Any, state: WorkState, details: Dict[str, Any]) -> None: if state == WorkState.FINISHED: path = self.tool.get_results() path = self.tool.get_output_path() self.completion_signal.send(output_path=path) def store_factory(self) -> str: Loading Loading
src/ips_fastran_gui/app/models/ips_fastran.py +12 −1 Original line number Diff line number Diff line """IPS Fastran classes.""" import logging import zipfile from io import BytesIO from pathlib import Path from typing import Tuple Loading Loading @@ -37,9 +39,18 @@ class IPSFastranTool(BasicTool): return self.tool, tool_params def get_results(self) -> Path: def get_output_path(self) -> Path: outputs = self.tool.get_results() dataset = outputs.get_dataset("output") dataset.download("output.nc") return Path("output.nc") def get_results(self, tool: Tool) -> bytes: outputs = tool.get_results() output = outputs.get_dataset("output").get_content() zip_buffer = BytesIO() with zipfile.ZipFile(zip_buffer, mode="w", compression=zipfile.ZIP_DEFLATED) as zf: zf.writestr("output.nc", output) zip_buffer.seek(0) return zip_buffer.getvalue()
src/ips_fastran_gui/app/view_models/execution.py +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ class ExecutionViewModel: async def on_progress(self, _sender: Any, state: WorkState, details: Dict[str, Any]) -> None: if state == WorkState.FINISHED: path = self.tool.get_results() path = self.tool.get_output_path() self.completion_signal.send(output_path=path) def store_factory(self) -> str: Loading