zylab 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. zylab-0.1.1/.bumpversion.toml +18 -0
  2. zylab-0.1.1/.copier-answers.yml +19 -0
  3. zylab-0.1.1/.coveragerc +14 -0
  4. zylab-0.1.1/.dockerignore +46 -0
  5. zylab-0.1.1/.gitattributes +30 -0
  6. zylab-0.1.1/.github/workflows/ci.yml +68 -0
  7. zylab-0.1.1/.github/workflows/release.yml +44 -0
  8. zylab-0.1.1/.gitignore +37 -0
  9. zylab-0.1.1/.pre-commit-config.yaml +21 -0
  10. zylab-0.1.1/.python-version +1 -0
  11. zylab-0.1.1/.readthedocs.yaml +23 -0
  12. zylab-0.1.1/Dockerfile +53 -0
  13. zylab-0.1.1/LICENSE +21 -0
  14. zylab-0.1.1/Makefile +62 -0
  15. zylab-0.1.1/PKG-INFO +161 -0
  16. zylab-0.1.1/README.md +102 -0
  17. zylab-0.1.1/docs/_static/.gitkeep +0 -0
  18. zylab-0.1.1/docs/api.rst +7 -0
  19. zylab-0.1.1/docs/changelog.rst +7 -0
  20. zylab-0.1.1/docs/conf.py +69 -0
  21. zylab-0.1.1/docs/index.rst +58 -0
  22. zylab-0.1.1/pyproject.toml +77 -0
  23. zylab-0.1.1/pyrefly.toml +13 -0
  24. zylab-0.1.1/pytest.ini +6 -0
  25. zylab-0.1.1/ruff.toml +36 -0
  26. zylab-0.1.1/src/zylab/__init__.py +7 -0
  27. zylab-0.1.1/src/zylab/assets/icons/about.svg +1 -0
  28. zylab-0.1.1/src/zylab/assets/icons/analysis.svg +1 -0
  29. zylab-0.1.1/src/zylab/assets/icons/check.svg +1 -0
  30. zylab-0.1.1/src/zylab/assets/icons/console.svg +1 -0
  31. zylab-0.1.1/src/zylab/assets/icons/cross.svg +1 -0
  32. zylab-0.1.1/src/zylab/assets/icons/open_project.svg +1 -0
  33. zylab-0.1.1/src/zylab/assets/icons/plot.svg +1 -0
  34. zylab-0.1.1/src/zylab/assets/icons/question.svg +1 -0
  35. zylab-0.1.1/src/zylab/assets/icons/save_as_template.svg +1 -0
  36. zylab-0.1.1/src/zylab/assets/icons/save_project.svg +1 -0
  37. zylab-0.1.1/src/zylab/assets/icons/script.svg +1 -0
  38. zylab-0.1.1/src/zylab/cli.py +183 -0
  39. zylab-0.1.1/src/zylab/console/__init__.py +8 -0
  40. zylab-0.1.1/src/zylab/console/history.py +93 -0
  41. zylab-0.1.1/src/zylab/console/kernel.py +239 -0
  42. zylab-0.1.1/src/zylab/core/__init__.py +53 -0
  43. zylab-0.1.1/src/zylab/core/config.py +152 -0
  44. zylab-0.1.1/src/zylab/core/errors.py +50 -0
  45. zylab-0.1.1/src/zylab/core/events.py +68 -0
  46. zylab-0.1.1/src/zylab/core/executor.py +363 -0
  47. zylab-0.1.1/src/zylab/core/log.py +81 -0
  48. zylab-0.1.1/src/zylab/core/project.py +187 -0
  49. zylab-0.1.1/src/zylab/core/registry.py +144 -0
  50. zylab-0.1.1/src/zylab/fea/__init__.py +118 -0
  51. zylab-0.1.1/src/zylab/fea/assemble.py +277 -0
  52. zylab-0.1.1/src/zylab/fea/boundary.py +114 -0
  53. zylab-0.1.1/src/zylab/fea/buckling.py +191 -0
  54. zylab-0.1.1/src/zylab/fea/conduction.py +392 -0
  55. zylab-0.1.1/src/zylab/fea/electric.py +132 -0
  56. zylab-0.1.1/src/zylab/fea/electrothermal.py +110 -0
  57. zylab-0.1.1/src/zylab/fea/elements.py +826 -0
  58. zylab-0.1.1/src/zylab/fea/errors.py +27 -0
  59. zylab-0.1.1/src/zylab/fea/export.py +120 -0
  60. zylab-0.1.1/src/zylab/fea/harmonic.py +159 -0
  61. zylab-0.1.1/src/zylab/fea/material.py +110 -0
  62. zylab-0.1.1/src/zylab/fea/mesh.py +163 -0
  63. zylab-0.1.1/src/zylab/fea/modal.py +147 -0
  64. zylab-0.1.1/src/zylab/fea/nonlinear.py +255 -0
  65. zylab-0.1.1/src/zylab/fea/solve.py +70 -0
  66. zylab-0.1.1/src/zylab/fea/static.py +148 -0
  67. zylab-0.1.1/src/zylab/fea/thermal.py +211 -0
  68. zylab-0.1.1/src/zylab/fea/transient.py +207 -0
  69. zylab-0.1.1/src/zylab/fea/viewdata.py +168 -0
  70. zylab-0.1.1/src/zylab/gui/__init__.py +9 -0
  71. zylab-0.1.1/src/zylab/gui/app.py +130 -0
  72. zylab-0.1.1/src/zylab/gui/icons.py +110 -0
  73. zylab-0.1.1/src/zylab/gui/main_window.py +160 -0
  74. zylab-0.1.1/src/zylab/gui/pages/__init__.py +10 -0
  75. zylab-0.1.1/src/zylab/gui/pages/console_page.py +240 -0
  76. zylab-0.1.1/src/zylab/gui/pages/plot_page.py +44 -0
  77. zylab-0.1.1/src/zylab/gui/pages/script_page.py +78 -0
  78. zylab-0.1.1/src/zylab/gui/pages/studio_page.py +579 -0
  79. zylab-0.1.1/src/zylab/gui/qt_compat.py +228 -0
  80. zylab-0.1.1/src/zylab/gui/style.qss +463 -0
  81. zylab-0.1.1/src/zylab/gui/theme.py +336 -0
  82. zylab-0.1.1/src/zylab/gui/widgets/__init__.py +9 -0
  83. zylab-0.1.1/src/zylab/gui/widgets/node_canvas.py +476 -0
  84. zylab-0.1.1/src/zylab/gui/widgets/param_form.py +147 -0
  85. zylab-0.1.1/src/zylab/gui/widgets/result_view.py +612 -0
  86. zylab-0.1.1/src/zylab/py.typed +0 -0
  87. zylab-0.1.1/src/zylab/sci/__init__.py +60 -0
  88. zylab-0.1.1/src/zylab/sci/plotting.py +64 -0
  89. zylab-0.1.1/src/zylab/sci/workspace.py +117 -0
  90. zylab-0.1.1/src/zylab/studio/__init__.py +82 -0
  91. zylab-0.1.1/src/zylab/studio/batch.py +211 -0
  92. zylab-0.1.1/src/zylab/studio/builtin.py +272 -0
  93. zylab-0.1.1/src/zylab/studio/bundle.py +51 -0
  94. zylab-0.1.1/src/zylab/studio/errors.py +36 -0
  95. zylab-0.1.1/src/zylab/studio/graph.py +250 -0
  96. zylab-0.1.1/src/zylab/studio/module.py +493 -0
  97. zylab-0.1.1/src/zylab/studio/nodes.py +572 -0
  98. zylab-0.1.1/src/zylab/studio/registry.py +125 -0
  99. zylab-0.1.1/src/zylab/studio/runner.py +166 -0
  100. zylab-0.1.1/src/zylab/studio/template.py +255 -0
  101. zylab-0.1.1/tests/__init__.py +0 -0
  102. zylab-0.1.1/tests/_targets.py +57 -0
  103. zylab-0.1.1/tests/conftest.py +11 -0
  104. zylab-0.1.1/tests/test_cli.py +181 -0
  105. zylab-0.1.1/tests/test_console_history.py +111 -0
  106. zylab-0.1.1/tests/test_console_kernel.py +230 -0
  107. zylab-0.1.1/tests/test_core_config.py +142 -0
  108. zylab-0.1.1/tests/test_core_errors.py +49 -0
  109. zylab-0.1.1/tests/test_core_events.py +147 -0
  110. zylab-0.1.1/tests/test_core_executor.py +196 -0
  111. zylab-0.1.1/tests/test_core_log.py +75 -0
  112. zylab-0.1.1/tests/test_core_project.py +166 -0
  113. zylab-0.1.1/tests/test_core_registry.py +155 -0
  114. zylab-0.1.1/tests/test_fea_beam_loads.py +307 -0
  115. zylab-0.1.1/tests/test_fea_benchmarks.py +171 -0
  116. zylab-0.1.1/tests/test_fea_buckling.py +299 -0
  117. zylab-0.1.1/tests/test_fea_conduction.py +216 -0
  118. zylab-0.1.1/tests/test_fea_electric.py +131 -0
  119. zylab-0.1.1/tests/test_fea_electrothermal.py +118 -0
  120. zylab-0.1.1/tests/test_fea_elements.py +361 -0
  121. zylab-0.1.1/tests/test_fea_export.py +166 -0
  122. zylab-0.1.1/tests/test_fea_harmonic.py +199 -0
  123. zylab-0.1.1/tests/test_fea_material.py +75 -0
  124. zylab-0.1.1/tests/test_fea_mesh.py +122 -0
  125. zylab-0.1.1/tests/test_fea_modal.py +296 -0
  126. zylab-0.1.1/tests/test_fea_nonlinear.py +353 -0
  127. zylab-0.1.1/tests/test_fea_static.py +311 -0
  128. zylab-0.1.1/tests/test_fea_thermal.py +189 -0
  129. zylab-0.1.1/tests/test_fea_transient.py +374 -0
  130. zylab-0.1.1/tests/test_fea_viewdata.py +140 -0
  131. zylab-0.1.1/tests/test_gui_app.py +24 -0
  132. zylab-0.1.1/tests/test_gui_console_page.py +266 -0
  133. zylab-0.1.1/tests/test_gui_main_window.py +101 -0
  134. zylab-0.1.1/tests/test_gui_node_canvas.py +282 -0
  135. zylab-0.1.1/tests/test_gui_param_form.py +119 -0
  136. zylab-0.1.1/tests/test_gui_plot_page.py +41 -0
  137. zylab-0.1.1/tests/test_gui_result_view.py +261 -0
  138. zylab-0.1.1/tests/test_gui_script_page.py +44 -0
  139. zylab-0.1.1/tests/test_gui_studio_page.py +408 -0
  140. zylab-0.1.1/tests/test_gui_theme.py +296 -0
  141. zylab-0.1.1/tests/test_sci_plotting.py +38 -0
  142. zylab-0.1.1/tests/test_sci_workspace.py +88 -0
  143. zylab-0.1.1/tests/test_studio_batch.py +197 -0
  144. zylab-0.1.1/tests/test_studio_graph.py +258 -0
  145. zylab-0.1.1/tests/test_studio_module.py +169 -0
  146. zylab-0.1.1/tests/test_studio_nodes.py +435 -0
  147. zylab-0.1.1/tests/test_studio_registry.py +134 -0
  148. zylab-0.1.1/tests/test_studio_runner.py +310 -0
  149. zylab-0.1.1/tests/test_studio_template.py +329 -0
  150. zylab-0.1.1/tests/test_zylab.py +24 -0
  151. zylab-0.1.1/tox.ini +21 -0
  152. zylab-0.1.1/uv.lock +3731 -0
@@ -0,0 +1,18 @@
1
+ [tool.bumpversion]
2
+ current_version = "0.1.1"
3
+ commit = true
4
+ exclude = ["template/*"]
5
+ message = "chore: 更新版本 {current_version} → {new_version}"
6
+ tag = true
7
+ tag_name = "v{new_version}"
8
+
9
+ [[tool.bumpversion.files]]
10
+ filename = "pyproject.toml"
11
+ regex = true
12
+ search = '(version\s+=\s+)"{current_version}"'
13
+ replace = '\1"{new_version}"'
14
+
15
+ [[tool.bumpversion.files]]
16
+ filename = "src/zylab/__init__.py"
17
+ search = '__version__ = "{current_version}"'
18
+ replace = '__version__ = "{new_version}"'
@@ -0,0 +1,19 @@
1
+ # Changes here will be overwritten by Copier
2
+ _commit: v0.9.2
3
+ _src_path: https://gitee.com/gooker_young/coopie.git
4
+ author_email: gooker_young@qq.com
5
+ author_name: gookeryoung
6
+ coverage_fail_under: 95
7
+ description: 通用科学计算仿真分析平台。
8
+ license: MIT
9
+ max_python_version: '3.14'
10
+ min_python_version: '3.11'
11
+ package_name: zylab
12
+ project_name: zylab
13
+ project_type: gui
14
+ use_cicd: true
15
+ use_docker: true
16
+ use_docs: true
17
+ use_domestic_mirrors: true
18
+ use_tox: true
19
+
@@ -0,0 +1,14 @@
1
+ [run]
2
+ branch = true
3
+ concurrency = thread
4
+ omit = tests/*
5
+ source = zylab
6
+
7
+ [report]
8
+ fail_under = 95
9
+ exclude_lines =
10
+ if TYPE_CHECKING:
11
+ if __name__ == .__main__.:
12
+ pragma: no cover
13
+ raise NotImplementedError
14
+ show_missing = true
@@ -0,0 +1,46 @@
1
+ # 版本控制
2
+ .git
3
+ .gitignore
4
+ .github
5
+
6
+ # Python 缓存与构建产物
7
+ __pycache__
8
+ *.pyc
9
+ *.pyo
10
+ *.pyd
11
+ *.egg-info
12
+ *.egg
13
+ dist
14
+ build
15
+ .eggs
16
+
17
+ # 测试与覆盖率
18
+ .pytest_cache
19
+ .coverage
20
+ htmlcov
21
+ .tox
22
+ coverage.xml
23
+
24
+ # 虚拟环境
25
+ .venv
26
+ venv
27
+ env
28
+
29
+ # 工具缓存
30
+ .uv-cache
31
+ .ruff_cache
32
+ .pyrefly_cache
33
+ .mypy_cache
34
+
35
+ # IDE 与编辑器
36
+ .idea
37
+ .vscode
38
+ *.swp
39
+ *.swo
40
+
41
+ # 文档(按需保留)
42
+ docs
43
+
44
+ # 系统文件
45
+ .DS_Store
46
+ Thumbs.db
@@ -0,0 +1,30 @@
1
+ # Git 行尾规范化
2
+ # 默认所有文本文件使用 LF 行尾(跨平台一致)
3
+ * text=auto eol=lf
4
+
5
+ # Windows 脚本使用 CRLF
6
+ *.bat text eol=crlf
7
+ *.cmd text eol=crlf
8
+ *.ps1 text eol=crlf
9
+
10
+ # 二进制文件(不做行尾转换)
11
+ *.png binary
12
+ *.jpg binary
13
+ *.jpeg binary
14
+ *.gif binary
15
+ *.ico binary
16
+ *.icns binary
17
+ *.pdf binary
18
+ *.zip binary
19
+ *.gz binary
20
+ *.tar binary
21
+ *.tgz binary
22
+ *.whl binary
23
+ *.egg binary
24
+ *.pyc binary
25
+ *.pyo binary
26
+ *.so binary
27
+ *.dll binary
28
+ *.dylib binary
29
+ *.qrc binary
30
+ *.qss binary
@@ -0,0 +1,68 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, develop]
6
+ pull_request:
7
+ branches: [main, develop]
8
+
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ jobs:
14
+ lint:
15
+ name: Lint & Typecheck
16
+ runs-on: ubuntu-latest
17
+ timeout-minutes: 10
18
+ steps:
19
+ - uses: actions/checkout@v5
20
+
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v8.3.2
23
+ with:
24
+ enable-cache: true
25
+ cache-dependency-glob: "uv.lock"
26
+
27
+ - name: Sync dependencies
28
+ run: uv sync --frozen --extra lint
29
+
30
+ - name: Ruff check
31
+ run: uv run ruff check src tests
32
+
33
+ - name: Ruff format check
34
+ run: uv run ruff format --check src tests
35
+
36
+ - name: Pyrefly check
37
+ run: uv run pyrefly check
38
+
39
+ test:
40
+ name: Test (Python 3.8 & 3.13)
41
+ runs-on: ubuntu-latest
42
+ timeout-minutes: 15
43
+ strategy:
44
+ fail-fast: false
45
+ matrix:
46
+ python-version: ["3.8", "3.13"]
47
+ steps:
48
+ - uses: actions/checkout@v5
49
+
50
+ - name: Install uv
51
+ uses: astral-sh/setup-uv@v8.3.2
52
+ with:
53
+ enable-cache: true
54
+ cache-dependency-glob: "uv.lock"
55
+
56
+ - name: Set up Python ${{ matrix.python-version }}
57
+ run: uv python install ${{ matrix.python-version }}
58
+
59
+ - name: Install Qt offscreen system dependencies
60
+ run: sudo apt-get update && sudo apt-get install -y libegl1 libgl1 libxkbcommon0 libdbus-1-3 libfontconfig1
61
+
62
+ - name: Sync dependencies
63
+ run: uv sync --frozen --extra test --python ${{ matrix.python-version }}
64
+
65
+ - name: Run tests
66
+ env:
67
+ QT_QPA_PLATFORM: offscreen
68
+ run: uv run pytest -m "not slow" --cov=zylab --cov-fail-under=95 --cov-report=term-missing
@@ -0,0 +1,44 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags: ['v*.*.*']
6
+
7
+ permissions:
8
+ contents: write
9
+ id-token: write
10
+
11
+ concurrency:
12
+ group: release-${{ github.ref }}
13
+ cancel-in-progress: false
14
+
15
+ jobs:
16
+ release:
17
+ name: Build & Publish
18
+ runs-on: ubuntu-latest
19
+ environment: pypi
20
+ timeout-minutes: 10
21
+ steps:
22
+ - uses: actions/checkout@v5
23
+
24
+ - name: Install uv
25
+ uses: astral-sh/setup-uv@v8.3.2
26
+ with:
27
+ enable-cache: true
28
+ cache-dependency-glob: "uv.lock"
29
+
30
+ - name: Build distributions
31
+ run: uv build
32
+
33
+ - name: Publish to PyPI (OIDC)
34
+ run: uv publish
35
+
36
+ - name: Create GitHub Release
37
+ env:
38
+ GH_TOKEN: ${{ github.token }}
39
+ TAG_NAME: ${{ github.ref_name }}
40
+ run: |
41
+ gh release create "$TAG_NAME" \
42
+ --title "Release $TAG_NAME" \
43
+ --generate-notes \
44
+ dist/*
zylab-0.1.1/.gitignore ADDED
@@ -0,0 +1,37 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Virtual environments
10
+ .venv
11
+ .venv38
12
+
13
+ # 测试与覆盖率
14
+ .coverage
15
+ .coverage.*
16
+ htmlcov/
17
+ coverage.xml
18
+ .tox/
19
+
20
+ # 工具缓存
21
+ .ruff_cache/
22
+ .pyrefly_cache/
23
+ .mypy_cache/
24
+ .uv-cache/
25
+
26
+ # IDE
27
+ .idea/
28
+ *_profile.html
29
+
30
+ # 环境变量与凭证(勿提交)
31
+ .env
32
+ .env.*
33
+
34
+ # Sphinx 文档构建输出
35
+ docs/_build/
36
+ # 本地协作产物(需求/迭代/规则记录,勿提交)
37
+ /.trae/
@@ -0,0 +1,21 @@
1
+ # prek / pre-commit 配置
2
+ # See https://pre-commit.com for more information
3
+ repos:
4
+ - repo: https://github.com/astral-sh/ruff-pre-commit
5
+ # Ruff 版本 - 与 pyproject.toml 保持同步
6
+ rev: v0.15.21
7
+ hooks:
8
+ # 运行 linter
9
+ - id: ruff
10
+ args: [--fix, --exit-non-zero-on-fix]
11
+ # 运行格式化
12
+ - id: ruff-format
13
+ - repo: https://github.com/pre-commit/pre-commit-hooks
14
+ rev: v5.0.0
15
+ hooks:
16
+ - id: check-merge-conflict
17
+ - id: debug-statements
18
+ - id: fix-byte-order-marker
19
+ - id: trailing-whitespace
20
+ args: [--markdown-linebreak-ext=md]
21
+ - id: end-of-file-fixer
@@ -0,0 +1 @@
1
+ 3.10
@@ -0,0 +1,23 @@
1
+ # ReadTheDocs 配置
2
+ # https://docs.readthedocs.io/en/stable/config-file/v2.html
3
+ version: 2
4
+
5
+ # 构建配置
6
+ build:
7
+ os: ubuntu-24.04
8
+ tools:
9
+ python: "3.11"
10
+
11
+ # Python 依赖与构建命令
12
+ python:
13
+ install:
14
+ - method: pip
15
+ path: .
16
+ extra_requirements:
17
+ - docs
18
+
19
+ # Sphinx 构建
20
+ sphinx:
21
+ configuration: docs/conf.py
22
+ builder: html
23
+ fail_on_warning: false
zylab-0.1.1/Dockerfile ADDED
@@ -0,0 +1,53 @@
1
+ # CI/容器化用 Dockerfile
2
+ # 使用国内镜像源拉取基础镜像(如不需要可替换为官方镜像)
3
+ # 备选镜像源前缀:docker.1ms.run / dockerpull.com / docker.xuanyuan.me
4
+ FROM docker.m.daocloud.io/python:3.14-slim
5
+
6
+ # ---- 国内镜像源 ----
7
+ ENV PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
8
+ ENV PIP_TRUSTED_HOST=pypi.tuna.tsinghua.edu.cn
9
+ ENV UV_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
10
+ ENV UV_TRUSTED_HOST=pypi.tuna.tsinghua.edu.cn
11
+
12
+ # 环境变量:非交互 + 路径配置
13
+ ENV DEBIAN_FRONTEND=noninteractive \
14
+ LANG=C.UTF-8 \
15
+ LC_ALL=C.UTF-8 \
16
+ UV_LINK_MODE=copy \
17
+ UV_CACHE_DIR=/uv-cache \
18
+ UV_PROJECT_ENVIRONMENT=/opt/venv \
19
+ PATH="/opt/venv/bin:${PATH}"
20
+
21
+ # 配置 apt 国内镜像(阿里云)并安装系统依赖
22
+ RUN sed -i 's|deb.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list.d/debian.sources \
23
+ && apt-get update \
24
+ && apt-get install -y --no-install-recommends \
25
+ ca-certificates \
26
+ curl \
27
+ git \
28
+ build-essential \
29
+ && rm -rf /var/lib/apt/lists/*
30
+
31
+
32
+ # 安装 uv(国内镜像)
33
+ RUN pip install --no-cache-dir uv -i https://mirrors.aliyun.com/pypi/simple/
34
+
35
+ # 预装项目所需 Python 版本
36
+ RUN uv python install 3.11 3.14
37
+
38
+ # 预装项目 dev 依赖(仅复制依赖描述文件,利用 Docker 层缓存)
39
+ WORKDIR /workspace
40
+ COPY pyproject.toml uv.toml tox.ini README.md ./
41
+ COPY src/ ./src/
42
+
43
+ # 同步依赖到 /opt/venv(CI 时直接复用)
44
+ RUN uv sync --frozen --no-install-project 2>/dev/null || uv sync --no-install-project
45
+
46
+ # 预装 tox 环境(首尾两个版本)
47
+ RUN uvx tox run -e py311,py314 --notest 2>/dev/null || true
48
+
49
+ # 持久化 uv 缓存目录(CI 可挂载到宿主机加速)
50
+ VOLUME ["/uv-cache"]
51
+
52
+ # 默认入口
53
+ CMD ["/bin/bash"]
zylab-0.1.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 gookeryoung
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
zylab-0.1.1/Makefile ADDED
@@ -0,0 +1,62 @@
1
+ # Makefile - zylab 项目快捷命令
2
+ # 运行 `make help` 查看所有可用命令
3
+
4
+ PACKAGE := zylab
5
+ COV_THRESHOLD := 95
6
+
7
+ .PHONY: help sync build b clean c test cov lint typecheck typecheck-ci check doc tox bump patch minor major push
8
+
9
+ help: ## 显示帮助信息
10
+ @awk 'BEGIN {FS = ":.*##"} /^[a-zA-Z].*:.*##/ {printf " \033[36m%-14s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
11
+
12
+ sync: ## 安装开发依赖
13
+ uv sync --extra dev
14
+
15
+ build b: ## 构建分发包 (wheel + sdist)
16
+ uv build
17
+
18
+ clean c: ## 清理构建产物与缓存
19
+ rm -rf build/ dist/ wheels/ *.egg-info htmlcov/ .coverage .coverage.* coverage.xml docs/_build/ .tox/
20
+ rm -rf .ruff_cache/ .pyrefly_cache/ .mypy_cache/
21
+ find src tests -type d -name __pycache__ -exec rm -rf {} +
22
+ find src tests -type f -name "*.py[oc]" -delete
23
+
24
+ test: ## 运行测试(不含覆盖率)
25
+ uv run pytest -m "not slow"
26
+
27
+ cov: ## 运行测试并检查覆盖率
28
+ uv run pytest -m "not slow" --cov=$(PACKAGE) --cov-fail-under=$(COV_THRESHOLD)
29
+
30
+ lint: ## 代码风格检查 (ruff)
31
+ uv run ruff check .
32
+ uv run ruff format --check .
33
+
34
+ typecheck: ## 类型检查 (pyrefly)
35
+ uv run pyrefly check
36
+
37
+ typecheck-ci: ## 类型检查 (pyrefly, CI 平台 linux — 捕获跨平台问题)
38
+ uv run pyrefly check --python-platform linux
39
+
40
+ check: lint typecheck typecheck-ci cov ## 运行全套门禁 (lint + typecheck + typecheck-ci + cov)
41
+
42
+ doc: ## 构建 Sphinx 文档
43
+ uv run sphinx-build -b html docs docs/_build/html
44
+
45
+
46
+ tox: ## 多版本测试 (tox)
47
+ uvx tox -p auto
48
+
49
+ BUMP_PART := $(filter-out bump,$(MAKECMDGOALS))
50
+
51
+ bump: ## 版本号 bump (默认 patch,用法: make bump [minor|major])
52
+ @uvx bump-my-version bump $(if $(BUMP_PART),$(firstword $(BUMP_PART)),patch) --tag
53
+
54
+ patch minor major:
55
+ @:
56
+
57
+ pub: ## 推送到pypi
58
+ uvx twine upload ./dist/**
59
+
60
+ push: ## 推送代码到所有远程仓库
61
+ @uv run python -c "import subprocess as sp; [print(f'\u63a8\u9001 {r}...',flush=True) or (sp.run(['git','push',r],check=True) and sp.run(['git','push',r,'--tags'],check=True)) for r in sp.check_output(['git','remote'],text=True).split()]"
62
+
zylab-0.1.1/PKG-INFO ADDED
@@ -0,0 +1,161 @@
1
+ Metadata-Version: 2.5
2
+ Name: zylab
3
+ Version: 0.1.1
4
+ Summary: 通用科学计算仿真分析平台。
5
+ Author-email: gookeryoung <gooker_young@qq.com>
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.8
10
+ Classifier: Programming Language :: Python :: 3.9
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
+ Requires-Python: >=3.8
18
+ Requires-Dist: h5py>=3.9
19
+ Requires-Dist: numba>=0.56.4
20
+ Requires-Dist: numpy<2,>=1.24; python_version <= '3.10'
21
+ Requires-Dist: numpy>=1.24; python_version >= '3.11'
22
+ Requires-Dist: psutil>=5.9
23
+ Requires-Dist: pyqtgraph>=0.13
24
+ Requires-Dist: pyside2>=5.15.2.1; python_version <= '3.10'
25
+ Requires-Dist: pyside6>=6.5.0; python_version >= '3.11'
26
+ Requires-Dist: scipy>=1.10.1
27
+ Requires-Dist: tomli>=2.0; python_version < '3.11'
28
+ Provides-Extra: dev
29
+ Requires-Dist: prek>=0.4.5; extra == 'dev'
30
+ Requires-Dist: py>=1.11; (python_version <= '3.10') and extra == 'dev'
31
+ Requires-Dist: pyrefly>=1.1.1; extra == 'dev'
32
+ Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
33
+ Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
34
+ Requires-Dist: pytest-html>=4.1.1; extra == 'dev'
35
+ Requires-Dist: pytest-qt<4,>=3.3; (python_version <= '3.10') and extra == 'dev'
36
+ Requires-Dist: pytest-qt>=4.2; (python_version >= '3.11') and extra == 'dev'
37
+ Requires-Dist: pytest-xdist>=3.6.1; extra == 'dev'
38
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
39
+ Requires-Dist: ruff>=0.8.0; extra == 'dev'
40
+ Requires-Dist: tox-uv>=1.13.1; extra == 'dev'
41
+ Requires-Dist: tox>=4.25.0; extra == 'dev'
42
+ Provides-Extra: docs
43
+ Requires-Dist: myst-parser>=3.0; extra == 'docs'
44
+ Requires-Dist: sphinx-rtd-theme>=2.0; extra == 'docs'
45
+ Requires-Dist: sphinx>=7.0; extra == 'docs'
46
+ Provides-Extra: lint
47
+ Requires-Dist: pyrefly>=1.1.1; extra == 'lint'
48
+ Requires-Dist: ruff>=0.8.0; extra == 'lint'
49
+ Provides-Extra: test
50
+ Requires-Dist: py>=1.11; (python_version <= '3.10') and extra == 'test'
51
+ Requires-Dist: pytest-asyncio>=0.24.0; extra == 'test'
52
+ Requires-Dist: pytest-cov>=5.0.0; extra == 'test'
53
+ Requires-Dist: pytest-html>=4.1.1; extra == 'test'
54
+ Requires-Dist: pytest-qt<4,>=3.3; (python_version <= '3.10') and extra == 'test'
55
+ Requires-Dist: pytest-qt>=4.2; (python_version >= '3.11') and extra == 'test'
56
+ Requires-Dist: pytest-xdist>=3.6.1; extra == 'test'
57
+ Requires-Dist: pytest>=8.0.0; extra == 'test'
58
+ Description-Content-Type: text/markdown
59
+
60
+ # zylab
61
+
62
+ > 通用科学计算仿真分析平台。
63
+
64
+ [![PyPI](https://img.shields.io/pypi/v/zylab)](https://pypi.org/project/zylab/)
65
+ [![CI](https://github.com/gookeryoung/zylab/actions/workflows/ci.yml/badge.svg)](https://github.com/gookeryoung/zylab/actions/workflows/ci.yml)
66
+ ![Python](https://img.shields.io/badge/python-3.11%2B-blue.svg)
67
+ ![License](https://img.shields.io/badge/license-MIT-green.svg)
68
+ ![Coverage](https://img.shields.io/badge/coverage-%E2%89%A595%25-brightgreen.svg)
69
+
70
+ ## 特性
71
+
72
+ - **构建工具链**:hatchling + uv + ruff + pyrefly + pytest + coverage
73
+ - **Python 版本**:3.11 ~ 3.14
74
+ - **代码质量**:pre-commit 钩子 + ruff lint/format,覆盖率阈值 95%
75
+ - **CI/CD**:GitHub Actions(lint + typecheck + 多版本测试 + 自动发布到 PyPI)
76
+ - **文档**:Sphinx + ReadTheDocs(中文 zh_CN)
77
+ - **多版本测试**:tox + tox-uv(py311, py312, py313, py314)
78
+ - **容器化**:Dockerfile(含国内镜像源配置)
79
+ - **GUI 框架**:PySide2(Qt5,Python≤3.10)/ PySide6(Qt6,Python≥3.11),按版本自动区分
80
+ - **项目结构**:src layout + py.typed 类型标记
81
+
82
+ ## 安装
83
+
84
+ ```bash
85
+ pip install zylab
86
+ ```
87
+
88
+ 或使用 [uv](https://docs.astral.sh/uv/):
89
+
90
+ ```bash
91
+ uv add zylab
92
+ ```
93
+
94
+ ## 快速上手
95
+
96
+ ```python
97
+ import zylab
98
+
99
+ print(zylab.__version__)
100
+ ```
101
+
102
+ 命令行(无界面求解模板/工程,支持参数覆盖与扫描):
103
+
104
+ ```bash
105
+ zylab # 启动图形界面
106
+ zylab templates # 列出可用模板
107
+ zylab run structural.cantilever_static -p model.nx=20
108
+ zylab run demo.zprj --scan "model.tip_load=-50:-100:5"
109
+ ```
110
+
111
+ ## 开发
112
+
113
+ ```bash
114
+ # 安装开发依赖
115
+ uv sync --extra dev
116
+
117
+ # 运行测试(含覆盖率,阈值 95%)
118
+ uv run pytest -m "not slow" --cov=zylab --cov-fail-under=95
119
+
120
+ # 类型检查
121
+ uv run pyrefly check .
122
+
123
+ # 代码风格
124
+ uv run ruff check src tests
125
+ uv run ruff format --check src tests
126
+ ```
127
+
128
+ ### Make 快捷命令
129
+
130
+ 项目提供 Makefile 封装常用操作,运行 `make help` 查看全部命令:
131
+
132
+ ```bash
133
+ make sync # 安装开发依赖
134
+ make check # 全套门禁 (lint + typecheck + cov)
135
+ make build # 构建分发包
136
+ make clean # 清理构建产物
137
+ make bump PART=patch # 版本号 bump
138
+ ```
139
+
140
+
141
+ ## 文档
142
+
143
+ 文档由 Sphinx 构建,托管在 ReadTheDocs:
144
+
145
+ ```bash
146
+ # 本地构建文档
147
+ make doc
148
+ ```
149
+
150
+
151
+ ## 多版本测试
152
+
153
+ 使用 tox 在多个 Python 版本(py311, py312, py313, py314)下运行测试:
154
+
155
+ ```bash
156
+ make tox
157
+ ```
158
+
159
+ ## 许可证
160
+
161
+ MIT