osis-python 0.1.4__tar.gz → 0.1.5__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 (62) hide show
  1. {osis_python-0.1.4/src/osis_python.egg-info → osis_python-0.1.5}/PKG-INFO +34 -26
  2. osis_python-0.1.5/README.md +101 -0
  3. {osis_python-0.1.4 → osis_python-0.1.5}/pyproject.toml +6 -1
  4. {osis_python-0.1.4 → osis_python-0.1.5/src/osis_python.egg-info}/PKG-INFO +34 -26
  5. {osis_python-0.1.4 → osis_python-0.1.5}/src/osis_python.egg-info/SOURCES.txt +1 -2
  6. {osis_python-0.1.4 → osis_python-0.1.5}/src/osis_python.egg-info/requires.txt +4 -0
  7. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/__init__.py +1 -1
  8. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/material/interface.py +1 -1
  9. osis_python-0.1.4/README.md +0 -97
  10. osis_python-0.1.4/tests/test_osis.py +0 -72
  11. {osis_python-0.1.4 → osis_python-0.1.5}/LICENSE +0 -0
  12. {osis_python-0.1.4 → osis_python-0.1.5}/setup.cfg +0 -0
  13. {osis_python-0.1.4 → osis_python-0.1.5}/src/osis_python.egg-info/dependency_links.txt +0 -0
  14. {osis_python-0.1.4 → osis_python-0.1.5}/src/osis_python.egg-info/top_level.txt +0 -0
  15. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/ai/__init__.py +0 -0
  16. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/ai/agents/BaseAgent.py +0 -0
  17. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/ai/agents/DecisionAgent.py +0 -0
  18. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/ai/agents/MaterialAgent.py +0 -0
  19. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/ai/agents/ModelAgent.py +0 -0
  20. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/ai/agents/QuickBuildingAgent.py +0 -0
  21. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/ai/agents/SectionAgent.py +0 -0
  22. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/ai/agents/__init__.py +0 -0
  23. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/boundary/__init__.py +0 -0
  24. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/boundary/interface.py +0 -0
  25. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/control/__init__.py +0 -0
  26. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/control/interface.py +0 -0
  27. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/core/PyInterface.pyi +0 -0
  28. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/core/__init__.py +0 -0
  29. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/core/command.py +0 -0
  30. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/core/engine.py +0 -0
  31. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/element/__init__.py +0 -0
  32. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/element/interface.py +0 -0
  33. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/general/__init__.py +0 -0
  34. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/general/interface.py +0 -0
  35. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/live/__init__.py +0 -0
  36. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/live/analysis.py +0 -0
  37. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/live/grade.py +0 -0
  38. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/live/lane.py +0 -0
  39. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/load/__init__.py +0 -0
  40. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/load/loadcase.py +0 -0
  41. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/load/static.py +0 -0
  42. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/load/tendon.py +0 -0
  43. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/material/__init__.py +0 -0
  44. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/node/__init__.py +0 -0
  45. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/node/interface.py +0 -0
  46. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/post/__init__.py +0 -0
  47. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/post/interface.py +0 -0
  48. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/property/__init__.py +0 -0
  49. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/property/coordinate.py +0 -0
  50. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/property/creep_shrink.py +0 -0
  51. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/property/damping.py +0 -0
  52. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/property/pu_curve.py +0 -0
  53. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/quick_building/__init__.py +0 -0
  54. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/quick_building/interface.py +0 -0
  55. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/section/__init__.py +0 -0
  56. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/section/common.py +0 -0
  57. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/section/numeric.py +0 -0
  58. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/section/param.py +0 -0
  59. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/section/steel.py +0 -0
  60. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/stage/__init__.py +0 -0
  61. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/stage/define.py +0 -0
  62. {osis_python-0.1.4 → osis_python-0.1.5}/src/pyosis/stage/overall.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: osis-python
3
- Version: 0.1.4
3
+ Version: 0.1.5
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: MIT License
@@ -43,6 +43,10 @@ Requires-Dist: langchain-core>=1.0.3
43
43
  Requires-Dist: langchain-openai>=1.0.2
44
44
  Requires-Dist: pydantic>=2.12.4
45
45
  Requires-Dist: pydantic_core>=2.41.5
46
+ Requires-Dist: fastapi>=0.128.0
47
+ Requires-Dist: httpx>=0.28.1
48
+ Requires-Dist: openai>=2.7.1
49
+ Requires-Dist: uvicorn>=0.40.0
46
50
  Provides-Extra: dev
47
51
  Requires-Dist: pytest>=7.0; extra == "dev"
48
52
  Requires-Dist: black>=23.0; extra == "dev"
@@ -52,30 +56,36 @@ Requires-Dist: pytest>=7.0; extra == "test"
52
56
  Requires-Dist: pytest-cov>=4.0; extra == "test"
53
57
  Dynamic: license-file
54
58
 
59
+ [简体中文](README.zh-CN.md) | [English](README.md)
60
+
55
61
  # pyosis
56
62
 
57
- 中交公路规划设计院自研OSIS桥隧分析平台的Python接口库`pyosis`
63
+ Python client library for OSIS Bridge Analysis Platform
58
64
 
59
65
  ## Installation
60
- 由于`pyosis`存在重名,请您采用以下方式安装:
66
+
67
+ Due to naming conflicts on PyPI, please install using:
68
+
61
69
  ```bash
62
70
  pip install osis-python
63
71
  ```
64
- 如果您的镜像站未同步`pyosis`,请使用以下命令:
72
+
73
+ If your mirror hasn't synced yet, use:
74
+
65
75
  ```bash
66
76
  pip install osis-python -i https://pypi.org/simple
67
77
  ```
68
78
 
69
79
  ## Usage
70
80
 
71
- 首先需要安装最新版OSIS(>=5.0),并配置好python环境变量。pyosis需要python3.11版本以上的环境。并且,您需要在环境变量中设置`PYTHONHOME`为您python的安装目录,例如:`C:\Program Files\python`,设置`PYTHONIOENCODING`为`utf-8`。然后在`path`中分别添加`%PYTHONHOME%`和`%PYTHONHOME%\Scripts`两个条目。
81
+ First, install the latest version of OSIS (>=5.0) and configure the Python environment variables. pyosis requires Python 3.11 or higher. You need to set PYTHONHOME in the environment variables to your Python installation directory, e.g., C:\Program Files\python, and set PYTHONIOENCODING to utf-8. Then add %PYTHONHOME% and %PYTHONHOME%\Scripts to the Path variable.
72
82
 
83
+ Your scripts should be placed in the python folder under the OSIS installation directory, e.g., C:\Program Files\osis\python. Suppose there is a script named test_osis.py with the following content:
73
84
 
74
- 您的脚本应放置于OSIS安装目录下的python文件夹中,例如:`C:\Program Files\osis\python`。假设存在一个名为`test_osis.py`的脚本,其内容如下:
75
85
 
76
86
  ```python
77
87
  import json
78
- from pyosis.core import osis_run # 导入需要的功能
88
+ from pyosis.core import osis_run # Import required functions
79
89
  from pyosis.control import *
80
90
  from pyosis.general import *
81
91
  from pyosis.section import *
@@ -102,18 +112,18 @@ osis_ln_srch(0)
102
112
  osis_auto_ts(0)
103
113
  osis_mod_opt(0)
104
114
 
105
- osis_section_circle(1, "圆形截面1", "CIRCLE", "Hollow", 0.219, 0.012)
106
- osis_section_circle(2, "圆形截面2", "CIRCLE", "Hollow", 0.180, 0.008)
107
- osis_section_circle(3, "圆形截面3", "CIRCLE", "Hollow", 0.114, 0.005)
108
- osis_section_circle(4, "圆形截面4", "CIRCLE", "Hollow", 0.089, 0.004)
109
- osis_section_circle(5, "圆形截面5", "CIRCLE", "Hollow", 0.045, 0.003)
115
+ osis_section_circle(1, "Circle Section 1", "CIRCLE", "Hollow", 0.219, 0.012)
116
+ osis_section_circle(2, "Circle Section 2", "CIRCLE", "Hollow", 0.180, 0.008)
117
+ osis_section_circle(3, "Circle Section 3", "CIRCLE", "Hollow", 0.114, 0.005)
118
+ osis_section_circle(4, "Circle Section 4", "CIRCLE", "Hollow", 0.089, 0.004)
119
+ osis_section_circle(5, "Circle Section 5", "CIRCLE", "Hollow", 0.045, 0.003)
110
120
 
111
- osis_material_steel(1, "钢材1", "STEEL", "JTGD64_2015", "Q345", 0.05)
121
+ osis_material_steel(1, "Steel 1", "STEEL", "JTGD64_2015", "Q345", 0.05)
112
122
 
113
- # 固定节点(x,y单位:m
123
+ # Fixed nodes (x, y units: m)
114
124
  osis_node(1, 0, 5, 0)
115
125
  osis_node(2, 15, 5, 0)
116
- # 荷载作用节点
126
+ # Load application nodes
117
127
  osis_node(3, 7.5, 0, 0)
118
128
  osis_node(4, 20, 0, 0)
119
129
 
@@ -122,30 +132,28 @@ osis_element_beam3d(2, "BEAM3D", 2, 3, 1, 5, 5, 1, 1, 0.00, 0, 0.00, 0)
122
132
  osis_element_beam3d(3, "BEAM3D", 2, 4, 1, 5, 5, 1, 1, 0.00, 0, 0.00, 0)
123
133
  osis_element_beam3d(4, "BEAM3D", 3, 4, 1, 5, 5, 1, 1, 0.00, 0, 0.00, 0)
124
134
 
125
-
126
135
  osis_boundary_general(1, "GENERAL", "", 1, 1, 1, 1, 1, 1, 1)
127
136
  osis_assign_boundary(1, "a", [1, 2])
128
137
 
129
- osis_loadcase("自定义工况1", "USER", 1, "施加于节点34的两个力")
130
- osis_load_nforce("NFORCE", "自定义工况1", 3, 0, -1000000, 0, 0, 0, 0)
131
- osis_load_nforce("NFORCE", "自定义工况1", 4, 200000, 0, 0, 0, 0, 0)
138
+ osis_loadcase("Custom Load Case 1", "USER", 1, "Two forces applied at nodes 3 and 4")
139
+ osis_load_nforce("NFORCE", "Custom Load Case 1", 3, 0, -1000000, 0, 0, 0, 0)
140
+ osis_load_nforce("NFORCE", "Custom Load Case 1", 4, 200000, 0, 0, 0, 0, 0)
132
141
 
133
142
  osis_solve()
134
143
 
135
- osis_run() # OSIS执行所有前处理命令
136
-
137
- isok, error, ef = osis_elem_force("自定义工况1", "EF", "BEAM3D")
144
+ osis_run() # Let OSIS execute all preprocessing commands
138
145
 
146
+ isok, error, ef = osis_elem_force("Custom Load Case 1", "EF", "BEAM3D")
139
147
 
140
148
  def dict_to_json_txt(data, filename):
141
- """将字典以JSON格式写入文件"""
149
+ """Write dictionary to file in JSON format"""
142
150
  with open(filename, 'w', encoding='utf-8') as f:
143
151
  json.dump(data, f, indent=4)
144
152
 
145
- print(f"字典已写入文件: {filename}")
153
+ print(f"Dictionary written to file: {filename}")
146
154
 
147
- # 使用
155
+ # Usage
148
156
  dict_to_json_txt(ef, "output.json")
149
157
  ```
150
158
 
151
- OSIS中选择并运行这个脚本,如果一切正常的话,您将会看到OSIS开始了计算,并在`C:\Program Files\osis`下生成了一个名为`output.json`的文件,其中包含了OSIS计算内力的结果。
159
+ Select and run this script in OSIS. If everything is normal, you will see OSIS start the calculation and generate a file named output.json in C:\Program Files\osis, containing the internal force results from OSIS. (Not yet completed)
@@ -0,0 +1,101 @@
1
+ [简体中文](README.zh-CN.md) | [English](README.md)
2
+
3
+ # pyosis
4
+
5
+ Python client library for OSIS Bridge Analysis Platform
6
+
7
+ ## Installation
8
+
9
+ Due to naming conflicts on PyPI, please install using:
10
+
11
+ ```bash
12
+ pip install osis-python
13
+ ```
14
+
15
+ If your mirror hasn't synced yet, use:
16
+
17
+ ```bash
18
+ pip install osis-python -i https://pypi.org/simple
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ First, install the latest version of OSIS (>=5.0) and configure the Python environment variables. pyosis requires Python 3.11 or higher. You need to set PYTHONHOME in the environment variables to your Python installation directory, e.g., C:\Program Files\python, and set PYTHONIOENCODING to utf-8. Then add %PYTHONHOME% and %PYTHONHOME%\Scripts to the Path variable.
24
+
25
+ Your scripts should be placed in the python folder under the OSIS installation directory, e.g., C:\Program Files\osis\python. Suppose there is a script named test_osis.py with the following content:
26
+
27
+
28
+ ```python
29
+ import json
30
+ from pyosis.core import osis_run # Import required functions
31
+ from pyosis.control import *
32
+ from pyosis.general import *
33
+ from pyosis.section import *
34
+ from pyosis.material import *
35
+ from pyosis.node import *
36
+ from pyosis.element import *
37
+ from pyosis.boundary import *
38
+ from pyosis.load import *
39
+ from pyosis.post import *
40
+
41
+ osis_clear()
42
+
43
+ osis_acel(9.8066)
44
+ osis_calc_tendon(1)
45
+ osis_calc_con_force(1)
46
+ osis_calc_shrink(1)
47
+ osis_calc_creep(1)
48
+ osis_calc_shear(1)
49
+ osis_calc_rlx(1)
50
+ osis_mod_loc_coor(0)
51
+ osis_inc_tendon(1)
52
+ osis_nl(0, 0)
53
+ osis_ln_srch(0)
54
+ osis_auto_ts(0)
55
+ osis_mod_opt(0)
56
+
57
+ osis_section_circle(1, "Circle Section 1", "CIRCLE", "Hollow", 0.219, 0.012)
58
+ osis_section_circle(2, "Circle Section 2", "CIRCLE", "Hollow", 0.180, 0.008)
59
+ osis_section_circle(3, "Circle Section 3", "CIRCLE", "Hollow", 0.114, 0.005)
60
+ osis_section_circle(4, "Circle Section 4", "CIRCLE", "Hollow", 0.089, 0.004)
61
+ osis_section_circle(5, "Circle Section 5", "CIRCLE", "Hollow", 0.045, 0.003)
62
+
63
+ osis_material_steel(1, "Steel 1", "STEEL", "JTGD64_2015", "Q345", 0.05)
64
+
65
+ # Fixed nodes (x, y units: m)
66
+ osis_node(1, 0, 5, 0)
67
+ osis_node(2, 15, 5, 0)
68
+ # Load application nodes
69
+ osis_node(3, 7.5, 0, 0)
70
+ osis_node(4, 20, 0, 0)
71
+
72
+ osis_element_beam3d(1, "BEAM3D", 1, 3, 1, 4, 4, 1, 1, 0.00, 0, 0.00, 0)
73
+ osis_element_beam3d(2, "BEAM3D", 2, 3, 1, 5, 5, 1, 1, 0.00, 0, 0.00, 0)
74
+ osis_element_beam3d(3, "BEAM3D", 2, 4, 1, 5, 5, 1, 1, 0.00, 0, 0.00, 0)
75
+ osis_element_beam3d(4, "BEAM3D", 3, 4, 1, 5, 5, 1, 1, 0.00, 0, 0.00, 0)
76
+
77
+ osis_boundary_general(1, "GENERAL", "", 1, 1, 1, 1, 1, 1, 1)
78
+ osis_assign_boundary(1, "a", [1, 2])
79
+
80
+ osis_loadcase("Custom Load Case 1", "USER", 1, "Two forces applied at nodes 3 and 4")
81
+ osis_load_nforce("NFORCE", "Custom Load Case 1", 3, 0, -1000000, 0, 0, 0, 0)
82
+ osis_load_nforce("NFORCE", "Custom Load Case 1", 4, 200000, 0, 0, 0, 0, 0)
83
+
84
+ osis_solve()
85
+
86
+ osis_run() # Let OSIS execute all preprocessing commands
87
+
88
+ isok, error, ef = osis_elem_force("Custom Load Case 1", "EF", "BEAM3D")
89
+
90
+ def dict_to_json_txt(data, filename):
91
+ """Write dictionary to file in JSON format"""
92
+ with open(filename, 'w', encoding='utf-8') as f:
93
+ json.dump(data, f, indent=4)
94
+
95
+ print(f"Dictionary written to file: {filename}")
96
+
97
+ # Usage
98
+ dict_to_json_txt(ef, "output.json")
99
+ ```
100
+
101
+ Select and run this script in OSIS. If everything is normal, you will see OSIS start the calculation and generate a file named output.json in C:\Program Files\osis, containing the internal force results from OSIS. (Not yet completed)
@@ -29,6 +29,7 @@ classifiers = [
29
29
  "Programming Language :: Python :: 3.11",
30
30
  "Programming Language :: Python :: 3.12",
31
31
  ]
32
+
32
33
  # 依赖
33
34
  dependencies = [
34
35
  "langchain>=1.0.3",
@@ -36,6 +37,10 @@ dependencies = [
36
37
  "langchain-openai>=1.0.2",
37
38
  "pydantic>=2.12.4",
38
39
  "pydantic_core>=2.41.5",
40
+ "fastapi>=0.128.0",
41
+ "httpx>=0.28.1",
42
+ "openai>=2.7.1",
43
+ "uvicorn>=0.40.0",
39
44
  ]
40
45
 
41
46
  [tool.setuptools.dynamic]
@@ -48,7 +53,7 @@ Documentation = "https://github.com/osis-ai/pyosis#readme"
48
53
  Repository = "https://github.com/osis-ai/pyosis.git"
49
54
  BugTracker = "https://github.com/osis-ai/pyosis/issues"
50
55
 
51
- # 可选依赖(如果有的话)
56
+ # 可选依赖
52
57
  [project.optional-dependencies]
53
58
  dev = [
54
59
  "pytest>=7.0",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: osis-python
3
- Version: 0.1.4
3
+ Version: 0.1.5
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: MIT License
@@ -43,6 +43,10 @@ Requires-Dist: langchain-core>=1.0.3
43
43
  Requires-Dist: langchain-openai>=1.0.2
44
44
  Requires-Dist: pydantic>=2.12.4
45
45
  Requires-Dist: pydantic_core>=2.41.5
46
+ Requires-Dist: fastapi>=0.128.0
47
+ Requires-Dist: httpx>=0.28.1
48
+ Requires-Dist: openai>=2.7.1
49
+ Requires-Dist: uvicorn>=0.40.0
46
50
  Provides-Extra: dev
47
51
  Requires-Dist: pytest>=7.0; extra == "dev"
48
52
  Requires-Dist: black>=23.0; extra == "dev"
@@ -52,30 +56,36 @@ Requires-Dist: pytest>=7.0; extra == "test"
52
56
  Requires-Dist: pytest-cov>=4.0; extra == "test"
53
57
  Dynamic: license-file
54
58
 
59
+ [简体中文](README.zh-CN.md) | [English](README.md)
60
+
55
61
  # pyosis
56
62
 
57
- 中交公路规划设计院自研OSIS桥隧分析平台的Python接口库`pyosis`
63
+ Python client library for OSIS Bridge Analysis Platform
58
64
 
59
65
  ## Installation
60
- 由于`pyosis`存在重名,请您采用以下方式安装:
66
+
67
+ Due to naming conflicts on PyPI, please install using:
68
+
61
69
  ```bash
62
70
  pip install osis-python
63
71
  ```
64
- 如果您的镜像站未同步`pyosis`,请使用以下命令:
72
+
73
+ If your mirror hasn't synced yet, use:
74
+
65
75
  ```bash
66
76
  pip install osis-python -i https://pypi.org/simple
67
77
  ```
68
78
 
69
79
  ## Usage
70
80
 
71
- 首先需要安装最新版OSIS(>=5.0),并配置好python环境变量。pyosis需要python3.11版本以上的环境。并且,您需要在环境变量中设置`PYTHONHOME`为您python的安装目录,例如:`C:\Program Files\python`,设置`PYTHONIOENCODING`为`utf-8`。然后在`path`中分别添加`%PYTHONHOME%`和`%PYTHONHOME%\Scripts`两个条目。
81
+ First, install the latest version of OSIS (>=5.0) and configure the Python environment variables. pyosis requires Python 3.11 or higher. You need to set PYTHONHOME in the environment variables to your Python installation directory, e.g., C:\Program Files\python, and set PYTHONIOENCODING to utf-8. Then add %PYTHONHOME% and %PYTHONHOME%\Scripts to the Path variable.
72
82
 
83
+ Your scripts should be placed in the python folder under the OSIS installation directory, e.g., C:\Program Files\osis\python. Suppose there is a script named test_osis.py with the following content:
73
84
 
74
- 您的脚本应放置于OSIS安装目录下的python文件夹中,例如:`C:\Program Files\osis\python`。假设存在一个名为`test_osis.py`的脚本,其内容如下:
75
85
 
76
86
  ```python
77
87
  import json
78
- from pyosis.core import osis_run # 导入需要的功能
88
+ from pyosis.core import osis_run # Import required functions
79
89
  from pyosis.control import *
80
90
  from pyosis.general import *
81
91
  from pyosis.section import *
@@ -102,18 +112,18 @@ osis_ln_srch(0)
102
112
  osis_auto_ts(0)
103
113
  osis_mod_opt(0)
104
114
 
105
- osis_section_circle(1, "圆形截面1", "CIRCLE", "Hollow", 0.219, 0.012)
106
- osis_section_circle(2, "圆形截面2", "CIRCLE", "Hollow", 0.180, 0.008)
107
- osis_section_circle(3, "圆形截面3", "CIRCLE", "Hollow", 0.114, 0.005)
108
- osis_section_circle(4, "圆形截面4", "CIRCLE", "Hollow", 0.089, 0.004)
109
- osis_section_circle(5, "圆形截面5", "CIRCLE", "Hollow", 0.045, 0.003)
115
+ osis_section_circle(1, "Circle Section 1", "CIRCLE", "Hollow", 0.219, 0.012)
116
+ osis_section_circle(2, "Circle Section 2", "CIRCLE", "Hollow", 0.180, 0.008)
117
+ osis_section_circle(3, "Circle Section 3", "CIRCLE", "Hollow", 0.114, 0.005)
118
+ osis_section_circle(4, "Circle Section 4", "CIRCLE", "Hollow", 0.089, 0.004)
119
+ osis_section_circle(5, "Circle Section 5", "CIRCLE", "Hollow", 0.045, 0.003)
110
120
 
111
- osis_material_steel(1, "钢材1", "STEEL", "JTGD64_2015", "Q345", 0.05)
121
+ osis_material_steel(1, "Steel 1", "STEEL", "JTGD64_2015", "Q345", 0.05)
112
122
 
113
- # 固定节点(x,y单位:m
123
+ # Fixed nodes (x, y units: m)
114
124
  osis_node(1, 0, 5, 0)
115
125
  osis_node(2, 15, 5, 0)
116
- # 荷载作用节点
126
+ # Load application nodes
117
127
  osis_node(3, 7.5, 0, 0)
118
128
  osis_node(4, 20, 0, 0)
119
129
 
@@ -122,30 +132,28 @@ osis_element_beam3d(2, "BEAM3D", 2, 3, 1, 5, 5, 1, 1, 0.00, 0, 0.00, 0)
122
132
  osis_element_beam3d(3, "BEAM3D", 2, 4, 1, 5, 5, 1, 1, 0.00, 0, 0.00, 0)
123
133
  osis_element_beam3d(4, "BEAM3D", 3, 4, 1, 5, 5, 1, 1, 0.00, 0, 0.00, 0)
124
134
 
125
-
126
135
  osis_boundary_general(1, "GENERAL", "", 1, 1, 1, 1, 1, 1, 1)
127
136
  osis_assign_boundary(1, "a", [1, 2])
128
137
 
129
- osis_loadcase("自定义工况1", "USER", 1, "施加于节点34的两个力")
130
- osis_load_nforce("NFORCE", "自定义工况1", 3, 0, -1000000, 0, 0, 0, 0)
131
- osis_load_nforce("NFORCE", "自定义工况1", 4, 200000, 0, 0, 0, 0, 0)
138
+ osis_loadcase("Custom Load Case 1", "USER", 1, "Two forces applied at nodes 3 and 4")
139
+ osis_load_nforce("NFORCE", "Custom Load Case 1", 3, 0, -1000000, 0, 0, 0, 0)
140
+ osis_load_nforce("NFORCE", "Custom Load Case 1", 4, 200000, 0, 0, 0, 0, 0)
132
141
 
133
142
  osis_solve()
134
143
 
135
- osis_run() # OSIS执行所有前处理命令
136
-
137
- isok, error, ef = osis_elem_force("自定义工况1", "EF", "BEAM3D")
144
+ osis_run() # Let OSIS execute all preprocessing commands
138
145
 
146
+ isok, error, ef = osis_elem_force("Custom Load Case 1", "EF", "BEAM3D")
139
147
 
140
148
  def dict_to_json_txt(data, filename):
141
- """将字典以JSON格式写入文件"""
149
+ """Write dictionary to file in JSON format"""
142
150
  with open(filename, 'w', encoding='utf-8') as f:
143
151
  json.dump(data, f, indent=4)
144
152
 
145
- print(f"字典已写入文件: {filename}")
153
+ print(f"Dictionary written to file: {filename}")
146
154
 
147
- # 使用
155
+ # Usage
148
156
  dict_to_json_txt(ef, "output.json")
149
157
  ```
150
158
 
151
- OSIS中选择并运行这个脚本,如果一切正常的话,您将会看到OSIS开始了计算,并在`C:\Program Files\osis`下生成了一个名为`output.json`的文件,其中包含了OSIS计算内力的结果。
159
+ Select and run this script in OSIS. If everything is normal, you will see OSIS start the calculation and generate a file named output.json in C:\Program Files\osis, containing the internal force results from OSIS. (Not yet completed)
@@ -55,5 +55,4 @@ src/pyosis/section/param.py
55
55
  src/pyosis/section/steel.py
56
56
  src/pyosis/stage/__init__.py
57
57
  src/pyosis/stage/define.py
58
- src/pyosis/stage/overall.py
59
- tests/test_osis.py
58
+ src/pyosis/stage/overall.py
@@ -3,6 +3,10 @@ langchain-core>=1.0.3
3
3
  langchain-openai>=1.0.2
4
4
  pydantic>=2.12.4
5
5
  pydantic_core>=2.41.5
6
+ fastapi>=0.128.0
7
+ httpx>=0.28.1
8
+ openai>=2.7.1
9
+ uvicorn>=0.40.0
6
10
 
7
11
  [dev]
8
12
  pytest>=7.0
@@ -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.1.4"
10
+ __version__ = "0.1.5"
11
11
  __author__ = "CCCC Highway Consultant Co. Ltd." # 中交公路规划设计院 - 工程技术研究中心
12
12
 
13
13
  # from .core import engine
@@ -130,7 +130,7 @@ def osis_material_prestressed(nMat: int, strName: str, eMaterialType: Literal["P
130
130
  pass
131
131
 
132
132
  @REGISTRY.register('Material')
133
- def osis_material_reber(nMat: int, strName: str, eMaterialType: Literal["REBAR"], eCode: Literal["JTG3362_2018", "JTGD62_2004"],
133
+ def osis_material_rebar(nMat: int, strName: str, eMaterialType: Literal["REBAR"], eCode: Literal["JTG3362_2018", "JTGD62_2004"],
134
134
  eGrade: Literal["HPB300", "HRB400", "HRBF400", "RRB400", "HRB500"] | Literal["R235", "HRB335", "HRB400", "KL400"], dDmp: float):
135
135
  """创建或修改钢材
136
136
 
@@ -1,97 +0,0 @@
1
- # pyosis
2
-
3
- 中交公路规划设计院自研OSIS桥隧分析平台的Python接口库`pyosis`
4
-
5
- ## Installation
6
- 由于`pyosis`存在重名,请您采用以下方式安装:
7
- ```bash
8
- pip install osis-python
9
- ```
10
- 如果您的镜像站未同步`pyosis`,请使用以下命令:
11
- ```bash
12
- pip install osis-python -i https://pypi.org/simple
13
- ```
14
-
15
- ## Usage
16
-
17
- 首先需要安装最新版OSIS(>=5.0),并配置好python环境变量。pyosis需要python3.11版本以上的环境。并且,您需要在环境变量中设置`PYTHONHOME`为您python的安装目录,例如:`C:\Program Files\python`,设置`PYTHONIOENCODING`为`utf-8`。然后在`path`中分别添加`%PYTHONHOME%`和`%PYTHONHOME%\Scripts`两个条目。
18
-
19
-
20
- 您的脚本应放置于OSIS安装目录下的python文件夹中,例如:`C:\Program Files\osis\python`。假设存在一个名为`test_osis.py`的脚本,其内容如下:
21
-
22
- ```python
23
- import json
24
- from pyosis.core import osis_run # 导入需要的功能
25
- from pyosis.control import *
26
- from pyosis.general import *
27
- from pyosis.section import *
28
- from pyosis.material import *
29
- from pyosis.node import *
30
- from pyosis.element import *
31
- from pyosis.boundary import *
32
- from pyosis.load import *
33
- from pyosis.post import *
34
-
35
- osis_clear()
36
-
37
- osis_acel(9.8066)
38
- osis_calc_tendon(1)
39
- osis_calc_con_force(1)
40
- osis_calc_shrink(1)
41
- osis_calc_creep(1)
42
- osis_calc_shear(1)
43
- osis_calc_rlx(1)
44
- osis_mod_loc_coor(0)
45
- osis_inc_tendon(1)
46
- osis_nl(0, 0)
47
- osis_ln_srch(0)
48
- osis_auto_ts(0)
49
- osis_mod_opt(0)
50
-
51
- osis_section_circle(1, "圆形截面1", "CIRCLE", "Hollow", 0.219, 0.012)
52
- osis_section_circle(2, "圆形截面2", "CIRCLE", "Hollow", 0.180, 0.008)
53
- osis_section_circle(3, "圆形截面3", "CIRCLE", "Hollow", 0.114, 0.005)
54
- osis_section_circle(4, "圆形截面4", "CIRCLE", "Hollow", 0.089, 0.004)
55
- osis_section_circle(5, "圆形截面5", "CIRCLE", "Hollow", 0.045, 0.003)
56
-
57
- osis_material_steel(1, "钢材1", "STEEL", "JTGD64_2015", "Q345", 0.05)
58
-
59
- # 固定节点(x,y单位:m)
60
- osis_node(1, 0, 5, 0)
61
- osis_node(2, 15, 5, 0)
62
- # 荷载作用节点
63
- osis_node(3, 7.5, 0, 0)
64
- osis_node(4, 20, 0, 0)
65
-
66
- osis_element_beam3d(1, "BEAM3D", 1, 3, 1, 4, 4, 1, 1, 0.00, 0, 0.00, 0)
67
- osis_element_beam3d(2, "BEAM3D", 2, 3, 1, 5, 5, 1, 1, 0.00, 0, 0.00, 0)
68
- osis_element_beam3d(3, "BEAM3D", 2, 4, 1, 5, 5, 1, 1, 0.00, 0, 0.00, 0)
69
- osis_element_beam3d(4, "BEAM3D", 3, 4, 1, 5, 5, 1, 1, 0.00, 0, 0.00, 0)
70
-
71
-
72
- osis_boundary_general(1, "GENERAL", "", 1, 1, 1, 1, 1, 1, 1)
73
- osis_assign_boundary(1, "a", [1, 2])
74
-
75
- osis_loadcase("自定义工况1", "USER", 1, "施加于节点3和4的两个力")
76
- osis_load_nforce("NFORCE", "自定义工况1", 3, 0, -1000000, 0, 0, 0, 0)
77
- osis_load_nforce("NFORCE", "自定义工况1", 4, 200000, 0, 0, 0, 0, 0)
78
-
79
- osis_solve()
80
-
81
- osis_run() # 让OSIS执行所有前处理命令
82
-
83
- isok, error, ef = osis_elem_force("自定义工况1", "EF", "BEAM3D")
84
-
85
-
86
- def dict_to_json_txt(data, filename):
87
- """将字典以JSON格式写入文件"""
88
- with open(filename, 'w', encoding='utf-8') as f:
89
- json.dump(data, f, indent=4)
90
-
91
- print(f"字典已写入文件: {filename}")
92
-
93
- # 使用
94
- dict_to_json_txt(ef, "output.json")
95
- ```
96
-
97
- 在OSIS中选择并运行这个脚本,如果一切正常的话,您将会看到OSIS开始了计算,并在`C:\Program Files\osis`下生成了一个名为`output.json`的文件,其中包含了OSIS计算内力的结果。
@@ -1,72 +0,0 @@
1
- import json
2
- from pyosis.core import osis_run
3
- from pyosis.control import *
4
- from pyosis.general import *
5
- from pyosis.section import *
6
- from pyosis.material import *
7
- from pyosis.node import *
8
- from pyosis.element import *
9
- from pyosis.boundary import *
10
- from pyosis.load import *
11
- from pyosis.post import *
12
-
13
- osis_clear()
14
-
15
- osis_acel(9.8066)
16
- osis_calc_tendon(1)
17
- osis_calc_con_force(1)
18
- osis_calc_shrink(1)
19
- osis_calc_creep(1)
20
- osis_calc_shear(1)
21
- osis_calc_rlx(1)
22
- osis_mod_loc_coor(0)
23
- osis_inc_tendon(1)
24
- osis_nl(0, 0)
25
- osis_ln_srch(0)
26
- osis_auto_ts(0)
27
- osis_mod_opt(0)
28
-
29
- osis_section_circle(1, "圆形截面1", "CIRCLE", "Hollow", 0.219, 0.012)
30
- osis_section_circle(2, "圆形截面2", "CIRCLE", "Hollow", 0.180, 0.008)
31
- osis_section_circle(3, "圆形截面3", "CIRCLE", "Hollow", 0.114, 0.005)
32
- osis_section_circle(4, "圆形截面4", "CIRCLE", "Hollow", 0.089, 0.004)
33
- osis_section_circle(5, "圆形截面5", "CIRCLE", "Hollow", 0.045, 0.003)
34
-
35
- osis_material_steel(1, "钢材1", "STEEL", "JTGD64_2015", "Q345", 0.05)
36
-
37
- # 固定节点(x,y单位:m)
38
- osis_node(1, 0, 5, 0)
39
- osis_node(2, 15, 5, 0)
40
- # 荷载作用节点
41
- osis_node(3, 7.5, 0, 0)
42
- osis_node(4, 20, 0, 0)
43
-
44
- osis_element_beam3d(1, "BEAM3D", 1, 3, 1, 4, 4, 1, 1, 0.00, 0, 0.00, 0)
45
- osis_element_beam3d(2, "BEAM3D", 2, 3, 1, 5, 5, 1, 1, 0.00, 0, 0.00, 0)
46
- osis_element_beam3d(3, "BEAM3D", 2, 4, 1, 5, 5, 1, 1, 0.00, 0, 0.00, 0)
47
- osis_element_beam3d(4, "BEAM3D", 3, 4, 1, 5, 5, 1, 1, 0.00, 0, 0.00, 0)
48
-
49
-
50
- osis_boundary_general(1, "GENERAL", "", 1, 1, 1, 1, 1, 1, 1)
51
- osis_assign_boundary(1, "a", [1, 2])
52
-
53
- osis_loadcase("自定义工况1", "USER", 1, "施加于节点3和4的两个力")
54
- osis_load_nforce("NFORCE", "自定义工况1", 3, 0, -1000000, 0, 0, 0, 0)
55
- osis_load_nforce("NFORCE", "自定义工况1", 4, 200000, 0, 0, 0, 0, 0)
56
-
57
- osis_solve()
58
-
59
- osis_run() # 让OSIS执行所有前处理命令
60
-
61
- isok, error, ef = osis_elem_force("自定义工况1", "EF", "BEAM3D")
62
-
63
-
64
- def dict_to_json_txt(data, filename):
65
- """将字典以JSON格式写入文件"""
66
- with open(filename, 'w', encoding='utf-8') as f:
67
- json.dump(data, f, indent=4)
68
-
69
- print(f"字典已写入文件: {filename}")
70
-
71
- # 使用
72
- dict_to_json_txt(ef, "output.json")
File without changes
File without changes