osis-python 0.6.3__tar.gz → 0.6.4__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 (117) hide show
  1. {osis_python-0.6.3/src/osis_python.egg-info → osis_python-0.6.4}/PKG-INFO +1 -1
  2. {osis_python-0.6.3 → osis_python-0.6.4/src/osis_python.egg-info}/PKG-INFO +1 -1
  3. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/__init__.py +1 -1
  4. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/display/interface.py +26 -1
  5. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/display/manager.py +48 -7
  6. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/property/component_thickness.py +4 -1
  7. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/property/manager.py +4 -1
  8. {osis_python-0.6.3 → osis_python-0.6.4}/LICENSE +0 -0
  9. {osis_python-0.6.3 → osis_python-0.6.4}/README.md +0 -0
  10. {osis_python-0.6.3 → osis_python-0.6.4}/pyproject.toml +0 -0
  11. {osis_python-0.6.3 → osis_python-0.6.4}/setup.cfg +0 -0
  12. {osis_python-0.6.3 → osis_python-0.6.4}/src/osis_python.egg-info/SOURCES.txt +0 -0
  13. {osis_python-0.6.3 → osis_python-0.6.4}/src/osis_python.egg-info/dependency_links.txt +0 -0
  14. {osis_python-0.6.3 → osis_python-0.6.4}/src/osis_python.egg-info/requires.txt +0 -0
  15. {osis_python-0.6.3 → osis_python-0.6.4}/src/osis_python.egg-info/top_level.txt +0 -0
  16. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/boundary/__init__.py +0 -0
  17. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/boundary/interface.py +0 -0
  18. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/boundary/manager.py +0 -0
  19. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/control/__init__.py +0 -0
  20. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/control/control.py +0 -0
  21. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/control/io.py +0 -0
  22. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/control/manager.py +0 -0
  23. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/control/nonlinear.py +0 -0
  24. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/core/__init__.py +0 -0
  25. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/core/all_func.py +0 -0
  26. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/core/apdl_sync.py +0 -0
  27. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/core/basic_manager.py +0 -0
  28. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/core/build.py +0 -0
  29. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/core/client.py +0 -0
  30. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/core/command.py +0 -0
  31. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/core/engine.py +0 -0
  32. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/core/exceptions.py +0 -0
  33. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/core/references.py +0 -0
  34. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/core/solver.py +0 -0
  35. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/core/sync_apdl_cli.py +0 -0
  36. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/display/__init__.py +0 -0
  37. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/dynamic/__init__.py +0 -0
  38. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/dynamic/load_to_mass.py +0 -0
  39. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/dynamic/manager.py +0 -0
  40. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/dynamic/modal.py +0 -0
  41. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/dynamic/seismic.py +0 -0
  42. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/element/__init__.py +0 -0
  43. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/element/interface.py +0 -0
  44. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/element/manager.py +0 -0
  45. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/general/__init__.py +0 -0
  46. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/general/interface.py +0 -0
  47. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/geometry/__init__.py +0 -0
  48. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/geometry/interface.py +0 -0
  49. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/geometry/manager.py +0 -0
  50. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/live/__init__.py +0 -0
  51. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/live/analysis.py +0 -0
  52. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/live/grade.py +0 -0
  53. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/live/lane.py +0 -0
  54. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/live/manager.py +0 -0
  55. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/load/__init__.py +0 -0
  56. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/load/loadcase.py +0 -0
  57. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/load/manager.py +0 -0
  58. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/load/static.py +0 -0
  59. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/load/tendon.py +0 -0
  60. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/material/__init__.py +0 -0
  61. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/material/interface.py +0 -0
  62. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/material/manager.py +0 -0
  63. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/node/__init__.py +0 -0
  64. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/node/interface.py +0 -0
  65. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/node/manager.py +0 -0
  66. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/post/__init__.py +0 -0
  67. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/post/combine.py +0 -0
  68. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/post/design_check.py +0 -0
  69. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/post/display.py +0 -0
  70. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/post/manager.py +0 -0
  71. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/project/__init__.py +0 -0
  72. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/project/interface.py +0 -0
  73. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/project/manager.py +0 -0
  74. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/property/__init__.py +0 -0
  75. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/property/coordinate.py +0 -0
  76. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/property/creep_shrink.py +0 -0
  77. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/property/damping.py +0 -0
  78. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/property/pu_curve.py +0 -0
  79. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/quick_building/__init__.py +0 -0
  80. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/quick_building/interface.py +0 -0
  81. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/result/__init__.py +0 -0
  82. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/result/check.py +0 -0
  83. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/result/env.py +0 -0
  84. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/result/loadcase.py +0 -0
  85. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/result/manager.py +0 -0
  86. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/result/result.py +0 -0
  87. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/section/__init__.py +0 -0
  88. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/section/common.py +0 -0
  89. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/section/composite.py +0 -0
  90. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/section/manager.py +0 -0
  91. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/section/numeric.py +0 -0
  92. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/section/param.py +0 -0
  93. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/section/rebar.py +0 -0
  94. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/section/rib.py +0 -0
  95. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/section/steel.py +0 -0
  96. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/settlement/__init__.py +0 -0
  97. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/settlement/interface.py +0 -0
  98. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/settlement/manager.py +0 -0
  99. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/stability/__init__.py +0 -0
  100. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/stability/buckling.py +0 -0
  101. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/stability/manager.py +0 -0
  102. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/stage/__init__.py +0 -0
  103. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/stage/define.py +0 -0
  104. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/stage/manager.py +0 -0
  105. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/stage/overall.py +0 -0
  106. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/thickness/__init__.py +0 -0
  107. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/thickness/interface.py +0 -0
  108. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/thickness/manager.py +0 -0
  109. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/transfer/__init__.py +0 -0
  110. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/transfer/generator.py +0 -0
  111. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/transfer/matrix.py +0 -0
  112. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/transfer/out_to_python.py +0 -0
  113. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/transfer/parser.py +0 -0
  114. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/transfer/routes.py +0 -0
  115. {osis_python-0.6.3 → osis_python-0.6.4}/src/pyosis/transfer/split.py +0 -0
  116. {osis_python-0.6.3 → osis_python-0.6.4}/tests/test_delete_occupied.py +0 -0
  117. {osis_python-0.6.3 → osis_python-0.6.4}/tests/test_project_manager.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: osis-python
3
- Version: 0.6.3
3
+ Version: 0.6.4
4
4
  Summary: A Python client library for Osis APDL
5
5
  Author-email: "CCCC Highway Consultant Co. Ltd." <support@osisbim.com>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: osis-python
3
- Version: 0.6.3
3
+ Version: 0.6.4
4
4
  Summary: A Python client library for Osis APDL
5
5
  Author-email: "CCCC Highway Consultant Co. Ltd." <support@osisbim.com>
6
6
  License-Expression: MIT
@@ -7,7 +7,7 @@ A library for extending OSIS functionality.
7
7
  A library that allows users to use CAE with great flexibility.
8
8
  """
9
9
 
10
- __version__ = "0.6.3"
10
+ __version__ = "0.6.4"
11
11
  __author__ = "CCCC Highway Consultant Co. Ltd." # 中交公路规划设计院 - 工程技术研究中心 - lzh - wjh - myf
12
12
 
13
13
  from .core.engine import OSISEngine
@@ -60,6 +60,7 @@ def osis_disp_ctrl(
60
60
  def osis_control(
61
61
  eAction: str,
62
62
  eArg: str | None = None,
63
+ *dValues,
63
64
  ):
64
65
  """视图 / 界面控制命令。
65
66
 
@@ -70,7 +71,9 @@ def osis_control(
70
71
  * ``view`` = 切换视图方向(配合 eArg)
71
72
  * 其他如 ``quickCreateModel`` 等
72
73
  eArg (str | None): 子命令参数
73
- * 当 eAction 为 ``view`` 时: ``standard`` / ``top`` / ``right`` / ``front``
74
+ * 当 eAction 为 ``view`` 时: ``standard`` / ``top`` / ``right`` /
75
+ ``front`` / ``zoom`` / ``move``
76
+ dValues: 附加参数
74
77
 
75
78
  Returns:
76
79
  tuple (bool, str): 是否成功,失败原因
@@ -80,6 +83,7 @@ def osis_control(
80
83
  >>> osis_control("view", "top")
81
84
  >>> osis_control("view", "right")
82
85
  >>> osis_control("view", "front")
86
+ >>> osis_control("view", "zoom", 0.8)
83
87
  """
84
88
  pass
85
89
 
@@ -101,3 +105,24 @@ def osis_plsm(bFlag: Literal[0, 1] = 1):
101
105
  >>> osis_plsm(0)
102
106
  """
103
107
  pass
108
+
109
+ @REGISTRY.register("jpeg")
110
+ def osis_jpeg(path: str = "image"):
111
+ """截图工具。
112
+
113
+ 格式: ``jpeg,path``
114
+
115
+ Args:
116
+ path (str): 图片保存路径/文件名。文件扩展名固定为 ``.jpg``。
117
+ 当仅传入文件名(不含目录分隔符)时,图片默认保存到
118
+ ``<project_dir>/image/{path}.jpg``;
119
+ 传入完整路径(如 ``D:\\reports\\fig1``)则保存到对应位置。
120
+
121
+ Returns:
122
+ tuple (bool, str): 是否成功,失败原因
123
+
124
+ Examples:
125
+ >>> osis_jpeg("IMG_盖梁裂缝宽度计算结果图")
126
+ >>> osis_jpeg(r"D:\\reports\\fig1")
127
+ """
128
+ pass
@@ -15,7 +15,7 @@ from __future__ import annotations
15
15
 
16
16
  from typing import Literal, Sequence, Union
17
17
 
18
- from .interface import osis_control, osis_disp_ctrl, osis_plsm
18
+ from .interface import osis_control, osis_disp_ctrl, osis_plsm, osis_jpeg
19
19
 
20
20
 
21
21
  class DisplayManager:
@@ -55,28 +55,45 @@ class DisplayManager:
55
55
  if not ok:
56
56
  raise RuntimeError(f"显示控制失败: {err}")
57
57
 
58
- def control(self, action: str, arg: str | None = None) -> None:
58
+ def control(self, action: str, arg: str | None = None, *values) -> None:
59
59
  """视图 / 界面控制(对应 ``/control,...``)。
60
60
 
61
61
  Args:
62
62
  action: 子命令,如 ``view``、``quickCreateModel``
63
- arg: 子命令参数;``view`` 时为 ``standard`` / ``top`` / ``right`` / ``front``
63
+ arg: 子命令参数;``view`` 时为 ``standard`` / ``top`` / ``right`` /
64
+ ``front`` / ``zoom`` / ``move``
65
+ *values: 附加参数。``view`` 子命令下:
66
+ * ``zoom``: 缩放系数(值越小模型越小)
67
+ * ``move``: (x, y) 像素偏移
64
68
 
65
69
  Raises:
66
70
  RuntimeError: 操作失败时抛出异常
71
+
72
+ Examples:
73
+ >>> display_manager.control("view", "top")
74
+ >>> display_manager.control("view", "zoom", 0.8)
75
+ >>> display_manager.control("view", "move", 30, 10)
67
76
  """
68
- ok, err = osis_control(action, arg)
77
+ ok, err = osis_control(action, arg, *values)
69
78
  if not ok:
70
79
  raise RuntimeError(f"界面控制失败: {err}")
71
80
 
72
81
  def set_view(
73
82
  self,
74
- view: Literal["standard", "top", "right", "front"] = "standard",
83
+ view: Literal["standard", "top", "right", "front", "zoom", "move"] = "standard",
84
+ *values,
75
85
  ) -> None:
76
86
  """切换视图方向。
77
87
 
78
88
  Args:
79
- view: ``standard`` / ``top`` / ``right`` / ``front``
89
+ view: 视图
90
+ * ``standard``: 标准视图
91
+ * ``top``: 俯视
92
+ * ``right``: 右视
93
+ * ``front``: 前视
94
+ * ``zoom``: 缩放(附加系数:值越小模型越小)
95
+ * ``move``: 平移(附加参数:x, y)
96
+ *values: ``zoom`` 时为缩放系数,``move`` 时为 x, y 像素偏移
80
97
 
81
98
  Raises:
82
99
  RuntimeError: 操作失败时抛出异常
@@ -84,8 +101,10 @@ class DisplayManager:
84
101
  Examples:
85
102
  >>> display_manager.set_view("top")
86
103
  >>> display_manager.set_view("front")
104
+ >>> display_manager.set_view("zoom", 0.8)
105
+ >>> display_manager.set_view("move", 30, 10)
87
106
  """
88
- self.control("view", view)
107
+ self.control("view", view, *values)
89
108
 
90
109
  def set_plsm(self, enabled: Literal[0, 1] = 1) -> None:
91
110
  """显示开关(Plsm)。
@@ -104,6 +123,28 @@ class DisplayManager:
104
123
  if not ok:
105
124
  raise RuntimeError(f"设置 Plsm 失败: {err}")
106
125
 
126
+ def capture(self, path: str) -> None:
127
+ """截图工具(对应 ``jpeg,...``)。
128
+
129
+ 把当前画面截图保存到 ``path``。文件扩展名固定为 ``.jpg``。
130
+ 若仅传入文件名(不含目录分隔符),图片默认保存到
131
+ ``<project_dir>/image/{path}.jpg``;传入完整路径则保存到对应位置。
132
+
133
+ Args:
134
+ path: 图片保存路径或文件名
135
+
136
+ Raises:
137
+ RuntimeError: 截图失败时抛出异常
138
+
139
+ Examples:
140
+ >>> display_manager.capture("D:\\reports\\fig1.jpg")
141
+ >>> display_manager.capture("crack.jpg") # 保存到 <project_dir>/image/crack.jpg
142
+ >>> display_manager.capture("crack") # 保存到 <project_dir>/image/crack.jpg
143
+ """
144
+ ok, err = osis_jpeg(path)
145
+ if not ok:
146
+ raise RuntimeError(f"截图失败: {err}")
147
+
107
148
  def __repr__(self) -> str:
108
149
  return "DisplayManager()"
109
150
 
@@ -9,7 +9,10 @@ def osis_assign_component_thickness(dThickness: float, strOp: Literal['a', 's',
9
9
 
10
10
  Args:
11
11
  dThickness (float): 构件理论厚度
12
- strOp (str): 操作;a = 添加,s = 替换,r = 移除;
12
+ strOp (str): 操作
13
+ * a = 添加,再次调用会覆盖旧参数
14
+ * s = 替换
15
+ * r = 移除
13
16
  *strElem (str): 待分配单元的编号。注:定义、修改、删除 elem支持的格式:*to*
14
17
 
15
18
  Returns:
@@ -890,11 +890,14 @@ class PropertyManager:
890
890
  Args:
891
891
  thickness (float): 构件理论厚度
892
892
  op (str): 操作
893
- * a = 添加
893
+ * a = 添加,再次调用会覆盖旧参数
894
894
  * s = 替换
895
895
  * r = 移除
896
896
  *elems (str|int): 待分配单元的编号。定义、修改、删除 elem 支持的格式:*to*
897
897
 
898
+ Examples:
899
+ >>> assign_component_thickness(0.2, s, 1, 2, 3) # 将 1 2 3号单元的厚度修改为 0.2
900
+
898
901
  Raises:
899
902
  RuntimeError: 分配失败时抛出
900
903
  '''
File without changes
File without changes
File without changes
File without changes