Refactor project structure and enhance launcher script functionality - #151
Merged
Merged
Conversation
This pull request introduces improvements to both the user experience and code logic in the launcher batch script and the auto-fetch module. The batch script now provides more flexible inference environment options for users, while the auto-fetch logic is refined to prevent unintentional overwriting of prediction results. Launcher script enhancements: Expanded the inference environment selection in iron_shark_launcher.bat to allow users to choose between PyTorch CPU, CUDA 12.8, CUDA 13.0, or onnxruntime, with improved prompt text and logic for handling user input. Updated the script to use uv sync with the appropriate --extra flag based on the user's choice, rather than always attempting to install PyTorch, and clarified messages to the user. Auto-fetch logic improvement: In src/game/auto_fetch.py, changed the heartbeat update to use the current prediction value instead of a fixed 0, preventing accidental overwriting of GUI prediction results.
* refactor: 优化uv安装和推理环境选择逻辑 Co-authored-by: Copilot <copilot@github.com> * fix(auto_fetch): 刷新当前预测显示,避免覆盖 GUI 错误 * fix(sim): 修复路径问题 * feat(paths): 添加路径管理模块,统一资源路径管理 - 新增 paths.py 文件,定义项目根目录、资源目录、数据目录等路径 - 更新多个模块以使用新的路径管理函数,确保路径的一致性和可维护性 Co-authored-by: Copilot <copilot@github.com> --------- Co-authored-by: Copilot <copilot@github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request contains significant refactoring and improvements to the codebase, focusing on modularization, maintainability, and user experience. The most impactful changes include reorganizing imports to use the new
srcdirectory structure, updating resource paths, enhancing the environment selection logic for inference, and improving UI code readability and maintainability.Project structure and import refactoring:
main.pyhave been updated to use the newsrcdirectory structure, improving code organization and maintainability. For example, modules likeloadData,auto_fetch, andrecognizeare now imported from their respective submodules undersrc. [1] [2] [3]Resource path and packaging updates:
src/resources/assets, ensuring the application loads assets correctly after restructuring.src/tools/package.py, and the build artifact path is updated tobuild/dist/main/.Inference environment selection improvements:
uv syncto install dependencies according to the user's selection, improving flexibility and user experience.UI code improvements:
main.pyhas been refactored for readability, including breaking up long import lines, reformatting style sheet strings, and improving alignment and clarity of widget setup and signal connections. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16]Other enhancements:
These changes collectively modernize the codebase, streamline development, and enhance the user and developer experience.