Skip to content

Support Abaqus 2021 Python 2.7 Windows compatibility#2

Open
hp283260133-bit wants to merge 3 commits into
Whfkl:mainfrom
hp283260133-bit:abaqus-2021-python27-windows-compat
Open

Support Abaqus 2021 Python 2.7 Windows compatibility#2
hp283260133-bit wants to merge 3 commits into
Whfkl:mainfrom
hp283260133-bit:abaqus-2021-python27-windows-compat

Conversation

@hp283260133-bit

Copy link
Copy Markdown
Collaborator

Summary

This PR builds on the latest upstream structure and keeps the new setup flow, root package layout, automatic GUI plugin installation, and renamed MCP tools.

It adds compatibility fixes for Abaqus/CAE 2021 and other Abaqus versions that still run Python 2.7 inside the GUI/kernel process.

Changes

  • Add Python 2.7 fallbacks in the GUI plugin for Queue, SocketServer, TimeoutError, basestring, AST key parsing, compiled-code execution, and stream redirection.
  • Normalize non-ASCII Windows paths and byte strings before base64 encoding and JSON serialization.
  • Make MCP responses JSON-safe with recursive conversion and ensure_ascii=True, reducing timeout symptoms from truncated response files.
  • Add duplicate GUI menu registration protection.
  • Use multiprocessing.cpu_count() fallback where Abaqus Python lacks os.cpu_count().
  • Set job CPU/GPU options through job.setValues(...) before job.submit(...) for better Abaqus API compatibility.
  • Add docs/upstream-v2-optimization-notes.md documenting the optimization rationale and validation target.

Validation

Validated locally on Windows with Abaqus Python available:

python -m py_compile abaqus_mcp_bridge/gui_plugin.py abaqus_mcp_bridge/server.py abaqus_mcp_bridge/cli.py
abaqus python -m py_compile C:\Users\yellow鹏\abaqus_plugins\abaqus_mcp_gui_plugin.py
pip check

The compatibility work is based on real usage with Abaqus/CAE 2021, including model creation, solving, post-processing, and report generation through the MCP bridge.

Note: this replaces the earlier PR opened from abaqus-2021-python27-compat-v2; the branch was renamed to make its purpose clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant