osis-python 0.7.7__tar.gz → 0.8.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 (124) hide show
  1. {osis_python-0.7.7/src/osis_python.egg-info → osis_python-0.8.1}/PKG-INFO +26 -4
  2. {osis_python-0.7.7 → osis_python-0.8.1}/README.md +25 -3
  3. {osis_python-0.7.7 → osis_python-0.8.1/src/osis_python.egg-info}/PKG-INFO +26 -4
  4. {osis_python-0.7.7 → osis_python-0.8.1}/src/osis_python.egg-info/SOURCES.txt +2 -0
  5. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/__init__.py +1 -1
  6. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/boundary/manager.py +72 -56
  7. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/core/__init__.py +11 -0
  8. osis_python-0.8.1/src/pyosis/core/enums.py +395 -0
  9. osis_python-0.8.1/src/pyosis/core/normalize.py +48 -0
  10. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/core/sdk.py +1 -1
  11. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/core/solver.py +41 -21
  12. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/element/manager.py +71 -21
  13. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/geometry/manager.py +2 -12
  14. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/live/manager.py +34 -12
  15. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/load/manager.py +21 -12
  16. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/material/manager.py +17 -14
  17. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/node/manager.py +6 -6
  18. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/project/interface.py +5 -1
  19. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/result/__init__.py +2 -0
  20. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/result/headless.py +52 -2
  21. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/result/manager.py +27 -0
  22. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/section/manager.py +27 -62
  23. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/stage/manager.py +1 -1
  24. {osis_python-0.7.7 → osis_python-0.8.1}/LICENSE +0 -0
  25. {osis_python-0.7.7 → osis_python-0.8.1}/pyproject.toml +0 -0
  26. {osis_python-0.7.7 → osis_python-0.8.1}/setup.cfg +0 -0
  27. {osis_python-0.7.7 → osis_python-0.8.1}/src/osis_python.egg-info/dependency_links.txt +0 -0
  28. {osis_python-0.7.7 → osis_python-0.8.1}/src/osis_python.egg-info/requires.txt +0 -0
  29. {osis_python-0.7.7 → osis_python-0.8.1}/src/osis_python.egg-info/top_level.txt +0 -0
  30. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/boundary/__init__.py +0 -0
  31. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/boundary/interface.py +0 -0
  32. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/control/__init__.py +0 -0
  33. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/control/control.py +0 -0
  34. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/control/io.py +0 -0
  35. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/control/manager.py +0 -0
  36. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/control/nonlinear.py +0 -0
  37. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/core/all_func.py +0 -0
  38. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/core/apdl_sync.py +0 -0
  39. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/core/basic_manager.py +0 -0
  40. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/core/batch.py +0 -0
  41. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/core/client.py +0 -0
  42. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/core/command.py +0 -0
  43. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/core/engine.py +0 -0
  44. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/core/exceptions.py +0 -0
  45. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/core/references.py +0 -0
  46. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/core/sync_apdl_cli.py +0 -0
  47. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/display/__init__.py +0 -0
  48. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/display/interface.py +0 -0
  49. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/display/manager.py +0 -0
  50. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/dynamic/__init__.py +0 -0
  51. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/dynamic/load_to_mass.py +0 -0
  52. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/dynamic/manager.py +0 -0
  53. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/dynamic/modal.py +0 -0
  54. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/dynamic/seismic.py +0 -0
  55. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/element/__init__.py +0 -0
  56. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/element/interface.py +0 -0
  57. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/general/__init__.py +0 -0
  58. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/general/interface.py +0 -0
  59. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/geometry/__init__.py +0 -0
  60. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/geometry/interface.py +0 -0
  61. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/live/__init__.py +0 -0
  62. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/live/analysis.py +0 -0
  63. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/live/grade.py +0 -0
  64. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/live/lane.py +0 -0
  65. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/load/__init__.py +0 -0
  66. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/load/loadcase.py +0 -0
  67. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/load/static.py +0 -0
  68. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/load/tendon.py +0 -0
  69. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/material/__init__.py +0 -0
  70. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/material/interface.py +0 -0
  71. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/node/__init__.py +0 -0
  72. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/node/interface.py +0 -0
  73. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/post/__init__.py +0 -0
  74. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/post/combine.py +0 -0
  75. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/post/design_check.py +0 -0
  76. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/post/display.py +0 -0
  77. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/post/manager.py +0 -0
  78. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/project/__init__.py +0 -0
  79. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/project/manager.py +0 -0
  80. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/property/__init__.py +0 -0
  81. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/property/component_thickness.py +0 -0
  82. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/property/coordinate.py +0 -0
  83. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/property/creep_shrink.py +0 -0
  84. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/property/damping.py +0 -0
  85. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/property/manager.py +0 -0
  86. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/property/pu_curve.py +0 -0
  87. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/quick_building/__init__.py +0 -0
  88. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/quick_building/interface.py +0 -0
  89. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/result/check.py +0 -0
  90. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/result/env.py +0 -0
  91. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/result/loadcase.py +0 -0
  92. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/result/result.py +0 -0
  93. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/section/__init__.py +0 -0
  94. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/section/common.py +0 -0
  95. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/section/composite.py +0 -0
  96. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/section/numeric.py +0 -0
  97. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/section/param.py +0 -0
  98. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/section/rebar.py +0 -0
  99. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/section/rib.py +0 -0
  100. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/section/steel.py +0 -0
  101. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/settlement/__init__.py +0 -0
  102. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/settlement/interface.py +0 -0
  103. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/settlement/manager.py +0 -0
  104. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/stability/__init__.py +0 -0
  105. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/stability/buckling.py +0 -0
  106. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/stability/manager.py +0 -0
  107. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/stage/__init__.py +0 -0
  108. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/stage/define.py +0 -0
  109. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/stage/overall.py +0 -0
  110. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/thickness/__init__.py +0 -0
  111. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/thickness/interface.py +0 -0
  112. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/thickness/manager.py +0 -0
  113. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/transfer/__init__.py +0 -0
  114. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/transfer/generator.py +0 -0
  115. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/transfer/introspect.py +0 -0
  116. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/transfer/matrix.py +0 -0
  117. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/transfer/out_to_python.py +0 -0
  118. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/transfer/parser.py +0 -0
  119. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/transfer/routes.py +0 -0
  120. {osis_python-0.7.7 → osis_python-0.8.1}/src/pyosis/transfer/split.py +0 -0
  121. {osis_python-0.7.7 → osis_python-0.8.1}/tests/test_batch.py +0 -0
  122. {osis_python-0.7.7 → osis_python-0.8.1}/tests/test_delete_occupied.py +0 -0
  123. {osis_python-0.7.7 → osis_python-0.8.1}/tests/test_project_manager.py +0 -0
  124. {osis_python-0.7.7 → osis_python-0.8.1}/tests/test_transfer_fixups.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: osis-python
3
- Version: 0.7.7
3
+ Version: 0.8.1
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
@@ -55,7 +55,7 @@ pip install osis-python -i https://pypi.org/simple
55
55
 
56
56
  - OSIS >= 5.1 (short-form command names like `N`/`Ele`/`Sec` are accepted by both the converter and runtime)
57
57
  - Python >= 3.8
58
- - **Solver-only mode** additionally requires the solver distribution that ships `PySolver.dll` (e.g. `D:\OSIS_Solver\Rbin64`).
58
+ - **Solver-only mode** additionally requires the solver distribution that ships `osisSdk.dll` (e.g. `D:\OSIS_Solver\Rbin64`).
59
59
 
60
60
  > OSIS 5.1 HTTP server bug workaround: the `/OSIS_Run` command-stream splitter does not strip `//` line comments, so a comment line and the command that follows it are merged into one bad command. The pyosis `.out` converter already strips comments before sending; if you ever build a raw `.out` payload yourself, pre-process the file or use `osis_run()` through the generated `main.py`.
61
61
 
@@ -149,7 +149,7 @@ By default, `OSISEngine()` connects to an already-running OSIS GUI process. If y
149
149
  from pyosis.core.solver import OSISSolver
150
150
  from pyosis.core.engine import OSISEngine
151
151
 
152
- # Load <install>/PySolver.dll and start the HTTP server (default port 18080)
152
+ # Load <install>/osisSdk.dll and start the HTTP server (default port 18080)
153
153
  solver = OSISSolver(osis_install_path=r"D:\OSIS_Solver\Rbin64")
154
154
  engine = OSISEngine.from_solver(solver)
155
155
 
@@ -162,7 +162,8 @@ engine.solve()
162
162
 
163
163
  Notes on solver-only mode:
164
164
 
165
- - `osis_install_path` must be the directory containing `PySolver.dll` (and its dependency DLLs).
165
+ - `osis_install_path` must be the directory containing `osisSdk.dll` (and its dependency DLLs).
166
+ - `osis_init` validates a license file (`osis.lic`, HMAC-signed) before anything runs. Search order: the `OSIS_LICENSE_FILE` environment variable, then `%ProgramData%\OSIS\osis.lic`, then `osis.lic` in the install directory. Contact the OSIS vendor to obtain one.
166
167
  - The solver needs a project to exist before model commands run: call `engine.project.create()` / `open()` first.
167
168
  - Crash minidumps are written to `<install>\Error\dmp\` (created on startup).
168
169
 
@@ -305,6 +306,27 @@ lc.create_gravity()
305
306
  lc.create_nforce(1, fx=1000)
306
307
  ```
307
308
 
309
+ ### Enums
310
+
311
+ All type codes live in `pyosis.core.enums`. Each member's **name is the OSIS command-stream spelling**, so a member converts straight to a string; its value is the integer code the JSON carries:
312
+
313
+ ```python
314
+ from pyosis.core.enums import ElementType, SectionType
315
+
316
+ SectionType.Rectangle.value # 5 — code as sent by OSIS
317
+ str(SectionType.Rectangle) # "Rectangle"
318
+ SectionType.name_of(5) # "Rectangle"
319
+ SectionType.of(404) # SectionType.Unassigned — unknown code falls back
320
+ ```
321
+
322
+ Available: `ElementType`, `BoundaryType`, `MaterialType`, `MaterialCode`, `SectionType`, `LoadCaseType`, `SplineType`, `TensionType`, `LiveGradeType`. Data-class fields that carry a type expose a `type_name` / `code_name` / `grade_name` property for convenience.
323
+
324
+ The `Xxx_TYPE_NAMES` dicts from pyosis 0.x are gone; use `XxxType.name_of(code)` instead.
325
+
326
+ > **Migration note (0.8.0):** member names were normalized to the OSIS spelling, so `Enum.name` changed for some values — `SectionType.CUSTOM.name` is now `"CustomShape"`, `ElementType.UNASSIGNED.name` is now `"Unassigned"`. Code that compared against the old names, or indexed the old `*_TYPE_NAMES` dicts, needs updating. The old all-caps aliases (`SectionType.CUSTOM`, `ElementType.UNASSIGNED`, …) still resolve to the same values.
327
+
328
+ > **Migration note (0.8.1):** vehicles are no longer a separate concept. OSIS has no vehicle entity — a vehicle is just one value of the live-load grade (`LiveGradeType.VEHICLE`), alongside highway/crowd/fatigue grades. Removed: `engine.live.vehicle`, `VehicleManager`, `vehicle_manager`, `LiveGrade.is_vehicle`, `LiveGrade.live_type_for_custom`, `LiveTypeForCustom`. Use `engine.live.grade` with `LiveGrade.grade_name` instead. `SplineType` member names also moved to the OSIS spelling (`GENERAL`/`NATURAL`/`ARC3D`/`ARC2D`), so `SplineType.General.name` is now `"GENERAL"`; the old spellings remain as aliases.
329
+
308
330
  ### Explicit Numbering
309
331
 
310
332
  Some `create_*` functions support explicit numbering via the `no` parameter. If not specified, the number is automatically assigned:
@@ -24,7 +24,7 @@ pip install osis-python -i https://pypi.org/simple
24
24
 
25
25
  - OSIS >= 5.1 (short-form command names like `N`/`Ele`/`Sec` are accepted by both the converter and runtime)
26
26
  - Python >= 3.8
27
- - **Solver-only mode** additionally requires the solver distribution that ships `PySolver.dll` (e.g. `D:\OSIS_Solver\Rbin64`).
27
+ - **Solver-only mode** additionally requires the solver distribution that ships `osisSdk.dll` (e.g. `D:\OSIS_Solver\Rbin64`).
28
28
 
29
29
  > OSIS 5.1 HTTP server bug workaround: the `/OSIS_Run` command-stream splitter does not strip `//` line comments, so a comment line and the command that follows it are merged into one bad command. The pyosis `.out` converter already strips comments before sending; if you ever build a raw `.out` payload yourself, pre-process the file or use `osis_run()` through the generated `main.py`.
30
30
 
@@ -118,7 +118,7 @@ By default, `OSISEngine()` connects to an already-running OSIS GUI process. If y
118
118
  from pyosis.core.solver import OSISSolver
119
119
  from pyosis.core.engine import OSISEngine
120
120
 
121
- # Load <install>/PySolver.dll and start the HTTP server (default port 18080)
121
+ # Load <install>/osisSdk.dll and start the HTTP server (default port 18080)
122
122
  solver = OSISSolver(osis_install_path=r"D:\OSIS_Solver\Rbin64")
123
123
  engine = OSISEngine.from_solver(solver)
124
124
 
@@ -131,7 +131,8 @@ engine.solve()
131
131
 
132
132
  Notes on solver-only mode:
133
133
 
134
- - `osis_install_path` must be the directory containing `PySolver.dll` (and its dependency DLLs).
134
+ - `osis_install_path` must be the directory containing `osisSdk.dll` (and its dependency DLLs).
135
+ - `osis_init` validates a license file (`osis.lic`, HMAC-signed) before anything runs. Search order: the `OSIS_LICENSE_FILE` environment variable, then `%ProgramData%\OSIS\osis.lic`, then `osis.lic` in the install directory. Contact the OSIS vendor to obtain one.
135
136
  - The solver needs a project to exist before model commands run: call `engine.project.create()` / `open()` first.
136
137
  - Crash minidumps are written to `<install>\Error\dmp\` (created on startup).
137
138
 
@@ -274,6 +275,27 @@ lc.create_gravity()
274
275
  lc.create_nforce(1, fx=1000)
275
276
  ```
276
277
 
278
+ ### Enums
279
+
280
+ All type codes live in `pyosis.core.enums`. Each member's **name is the OSIS command-stream spelling**, so a member converts straight to a string; its value is the integer code the JSON carries:
281
+
282
+ ```python
283
+ from pyosis.core.enums import ElementType, SectionType
284
+
285
+ SectionType.Rectangle.value # 5 — code as sent by OSIS
286
+ str(SectionType.Rectangle) # "Rectangle"
287
+ SectionType.name_of(5) # "Rectangle"
288
+ SectionType.of(404) # SectionType.Unassigned — unknown code falls back
289
+ ```
290
+
291
+ Available: `ElementType`, `BoundaryType`, `MaterialType`, `MaterialCode`, `SectionType`, `LoadCaseType`, `SplineType`, `TensionType`, `LiveGradeType`. Data-class fields that carry a type expose a `type_name` / `code_name` / `grade_name` property for convenience.
292
+
293
+ The `Xxx_TYPE_NAMES` dicts from pyosis 0.x are gone; use `XxxType.name_of(code)` instead.
294
+
295
+ > **Migration note (0.8.0):** member names were normalized to the OSIS spelling, so `Enum.name` changed for some values — `SectionType.CUSTOM.name` is now `"CustomShape"`, `ElementType.UNASSIGNED.name` is now `"Unassigned"`. Code that compared against the old names, or indexed the old `*_TYPE_NAMES` dicts, needs updating. The old all-caps aliases (`SectionType.CUSTOM`, `ElementType.UNASSIGNED`, …) still resolve to the same values.
296
+
297
+ > **Migration note (0.8.1):** vehicles are no longer a separate concept. OSIS has no vehicle entity — a vehicle is just one value of the live-load grade (`LiveGradeType.VEHICLE`), alongside highway/crowd/fatigue grades. Removed: `engine.live.vehicle`, `VehicleManager`, `vehicle_manager`, `LiveGrade.is_vehicle`, `LiveGrade.live_type_for_custom`, `LiveTypeForCustom`. Use `engine.live.grade` with `LiveGrade.grade_name` instead. `SplineType` member names also moved to the OSIS spelling (`GENERAL`/`NATURAL`/`ARC3D`/`ARC2D`), so `SplineType.General.name` is now `"GENERAL"`; the old spellings remain as aliases.
298
+
277
299
  ### Explicit Numbering
278
300
 
279
301
  Some `create_*` functions support explicit numbering via the `no` parameter. If not specified, the number is automatically assigned:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: osis-python
3
- Version: 0.7.7
3
+ Version: 0.8.1
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
@@ -55,7 +55,7 @@ pip install osis-python -i https://pypi.org/simple
55
55
 
56
56
  - OSIS >= 5.1 (short-form command names like `N`/`Ele`/`Sec` are accepted by both the converter and runtime)
57
57
  - Python >= 3.8
58
- - **Solver-only mode** additionally requires the solver distribution that ships `PySolver.dll` (e.g. `D:\OSIS_Solver\Rbin64`).
58
+ - **Solver-only mode** additionally requires the solver distribution that ships `osisSdk.dll` (e.g. `D:\OSIS_Solver\Rbin64`).
59
59
 
60
60
  > OSIS 5.1 HTTP server bug workaround: the `/OSIS_Run` command-stream splitter does not strip `//` line comments, so a comment line and the command that follows it are merged into one bad command. The pyosis `.out` converter already strips comments before sending; if you ever build a raw `.out` payload yourself, pre-process the file or use `osis_run()` through the generated `main.py`.
61
61
 
@@ -149,7 +149,7 @@ By default, `OSISEngine()` connects to an already-running OSIS GUI process. If y
149
149
  from pyosis.core.solver import OSISSolver
150
150
  from pyosis.core.engine import OSISEngine
151
151
 
152
- # Load <install>/PySolver.dll and start the HTTP server (default port 18080)
152
+ # Load <install>/osisSdk.dll and start the HTTP server (default port 18080)
153
153
  solver = OSISSolver(osis_install_path=r"D:\OSIS_Solver\Rbin64")
154
154
  engine = OSISEngine.from_solver(solver)
155
155
 
@@ -162,7 +162,8 @@ engine.solve()
162
162
 
163
163
  Notes on solver-only mode:
164
164
 
165
- - `osis_install_path` must be the directory containing `PySolver.dll` (and its dependency DLLs).
165
+ - `osis_install_path` must be the directory containing `osisSdk.dll` (and its dependency DLLs).
166
+ - `osis_init` validates a license file (`osis.lic`, HMAC-signed) before anything runs. Search order: the `OSIS_LICENSE_FILE` environment variable, then `%ProgramData%\OSIS\osis.lic`, then `osis.lic` in the install directory. Contact the OSIS vendor to obtain one.
166
167
  - The solver needs a project to exist before model commands run: call `engine.project.create()` / `open()` first.
167
168
  - Crash minidumps are written to `<install>\Error\dmp\` (created on startup).
168
169
 
@@ -305,6 +306,27 @@ lc.create_gravity()
305
306
  lc.create_nforce(1, fx=1000)
306
307
  ```
307
308
 
309
+ ### Enums
310
+
311
+ All type codes live in `pyosis.core.enums`. Each member's **name is the OSIS command-stream spelling**, so a member converts straight to a string; its value is the integer code the JSON carries:
312
+
313
+ ```python
314
+ from pyosis.core.enums import ElementType, SectionType
315
+
316
+ SectionType.Rectangle.value # 5 — code as sent by OSIS
317
+ str(SectionType.Rectangle) # "Rectangle"
318
+ SectionType.name_of(5) # "Rectangle"
319
+ SectionType.of(404) # SectionType.Unassigned — unknown code falls back
320
+ ```
321
+
322
+ Available: `ElementType`, `BoundaryType`, `MaterialType`, `MaterialCode`, `SectionType`, `LoadCaseType`, `SplineType`, `TensionType`, `LiveGradeType`. Data-class fields that carry a type expose a `type_name` / `code_name` / `grade_name` property for convenience.
323
+
324
+ The `Xxx_TYPE_NAMES` dicts from pyosis 0.x are gone; use `XxxType.name_of(code)` instead.
325
+
326
+ > **Migration note (0.8.0):** member names were normalized to the OSIS spelling, so `Enum.name` changed for some values — `SectionType.CUSTOM.name` is now `"CustomShape"`, `ElementType.UNASSIGNED.name` is now `"Unassigned"`. Code that compared against the old names, or indexed the old `*_TYPE_NAMES` dicts, needs updating. The old all-caps aliases (`SectionType.CUSTOM`, `ElementType.UNASSIGNED`, …) still resolve to the same values.
327
+
328
+ > **Migration note (0.8.1):** vehicles are no longer a separate concept. OSIS has no vehicle entity — a vehicle is just one value of the live-load grade (`LiveGradeType.VEHICLE`), alongside highway/crowd/fatigue grades. Removed: `engine.live.vehicle`, `VehicleManager`, `vehicle_manager`, `LiveGrade.is_vehicle`, `LiveGrade.live_type_for_custom`, `LiveTypeForCustom`. Use `engine.live.grade` with `LiveGrade.grade_name` instead. `SplineType` member names also moved to the OSIS spelling (`GENERAL`/`NATURAL`/`ARC3D`/`ARC2D`), so `SplineType.General.name` is now `"GENERAL"`; the old spellings remain as aliases.
329
+
308
330
  ### Explicit Numbering
309
331
 
310
332
  Some `create_*` functions support explicit numbering via the `no` parameter. If not specified, the number is automatically assigned:
@@ -23,7 +23,9 @@ src/pyosis/core/batch.py
23
23
  src/pyosis/core/client.py
24
24
  src/pyosis/core/command.py
25
25
  src/pyosis/core/engine.py
26
+ src/pyosis/core/enums.py
26
27
  src/pyosis/core/exceptions.py
28
+ src/pyosis/core/normalize.py
27
29
  src/pyosis/core/references.py
28
30
  src/pyosis/core/sdk.py
29
31
  src/pyosis/core/solver.py
@@ -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.7.7"
10
+ __version__ = "0.8.1"
11
11
 
12
12
  from .core.engine import OSISEngine
13
13
  from .core.batch import batch, flush, batch_state, BatchError
@@ -9,23 +9,26 @@
9
9
  支持的边界类型:
10
10
  - GENERAL(一般边界,type=1)
11
11
  - MSTSLV(主从约束,type=2)
12
- - RELEASE(释放梁端约束,type=4)
13
- - ELSTCSPT(弹性支承,type=5)
14
- - GENERALELSTCSPT(一般弹性支承,type=6)
12
+ - RELEASE(释放梁端约束,type=3)
13
+ - ELSTCSPT(节点弹性支承,type=4)
14
+ - GENERALELSTCSPT(一般弹性支承,type=5)
15
15
 
16
- 注:截面特性调整(SECF)为独立功能,不属于边界类型
16
+ 其余类型(SECF=7 / GLINK=8 / UNISPT=9 / UNILNK=10 / LELNK=11 /
17
+ SOILSPRING=12 / SURFSPT=13)暂无专用数据类,_from_dict 落到基类 Boundary,
18
+ type_name 仍可正确取名。真实取值以 PrepEnum::Boundary 为准(见 core/enums.py)。
17
19
  """
18
20
 
19
21
  from __future__ import annotations
20
22
 
21
23
  from dataclasses import dataclass, field
22
24
  from typing import Any, Literal
23
- from enum import IntEnum
24
25
 
25
26
  from ..core.client import osis_client
26
27
  from ..core import get_references, raise_if_occupied
27
28
  from ..core.basic_manager import BasicManager
28
29
  from ..core.batch import batch_state
30
+ from ..core.enums import BoundaryType, boundary_type_name, constraints_to_dict
31
+ from ..core.normalize import as_no, as_name
29
32
  from .interface import (
30
33
  osis_boundary_general,
31
34
  osis_boundary_elstcspt,
@@ -40,21 +43,6 @@ from .interface import (
40
43
  )
41
44
 
42
45
 
43
- # ──────────────────────────────────────────────
44
- # 枚举类型
45
- # ──────────────────────────────────────────────
46
-
47
- class BoundaryType(IntEnum):
48
- """边界类型枚举"""
49
- UNASSIGNED = 0
50
- GENERAL = 1 # 一般支撑
51
- MSTSLV = 2 # 主从约束
52
- RELEASE = 3 # 释放梁端约束
53
- ELSTCSPT = 4 # 节点弹性支承
54
- GENERALELSTCSPT = 5 # 一般弹性支承
55
- RIGID = 6 # 刚性连接
56
-
57
-
58
46
  # ──────────────────────────────────────────────
59
47
  # 数据类
60
48
  # ──────────────────────────────────────────────
@@ -72,13 +60,18 @@ class Boundary:
72
60
  entity_vec: list[int] = field(default_factory=list)
73
61
  is_occupied: bool = False
74
62
  is_selected: bool = False
75
- is_ploted: bool = False
63
+ is_plotted: bool = False
64
+
65
+ @property
66
+ def type_name(self) -> str:
67
+ """边界类型名(与 OSIS 命令流一致,如 "GENERAL" / "ELSTCSPT")"""
68
+ return boundary_type_name(self.boundary_type.value)
76
69
 
77
70
  @classmethod
78
71
  def _from_dict(cls, d: dict) -> Boundary:
79
72
  """从接口 dict 构造 Boundary 对象(内部使用)"""
80
73
  raw_type = int(d.get("type"))
81
-
74
+
82
75
  # 根据类型创建具体子类
83
76
  if raw_type == BoundaryType.GENERAL:
84
77
  return GeneralBoundary._from_dict(d)
@@ -93,13 +86,13 @@ class Boundary:
93
86
  else:
94
87
  # 未知类型返回基类
95
88
  return cls(
96
- no=d.get("no"),
97
- name=d.get("name"),
98
- boundary_type=BoundaryType(raw_type) if raw_type in [t.value for t in BoundaryType] else BoundaryType.GENERAL,
99
- entity_vec=list(d.get("entityVec")),
89
+ no=as_no(d.get("no")),
90
+ name=as_name(d.get("name")),
91
+ boundary_type=BoundaryType.of(raw_type),
92
+ entity_vec=list(d.get("entityVec") or []),
100
93
  is_occupied=d.get("isOccupied"),
101
94
  is_selected=d.get("isSelected"),
102
- is_ploted=d.get("isPloted"),
95
+ is_plotted=d.get("isPlotted"),
103
96
  )
104
97
 
105
98
  def set_section_factor(
@@ -169,20 +162,28 @@ class GeneralBoundary(Boundary):
169
162
  def _from_dict(cls, d: dict) -> GeneralBoundary:
170
163
  """从接口 dict 构造 GeneralBoundary 对象"""
171
164
  return cls(
172
- no=d.get("no"),
173
- name=d.get("name"),
165
+ no=as_no(d.get("no")),
166
+ name=as_name(d.get("name")),
174
167
  boundary_type=BoundaryType.GENERAL,
175
- entity_vec=list(d.get("entityVec")),
168
+ entity_vec=list(d.get("entityVec") or []),
176
169
  is_occupied=d.get("isOccupied"),
177
170
  is_selected=d.get("isSelected"),
178
- is_ploted=d.get("isPloted"),
179
- constraints=list(d.get("constraints")),
171
+ is_plotted=d.get("isPlotted"),
172
+ constraints=list(d.get("constraints") or []),
180
173
  coor_no=d.get("coorNO"),
181
174
  )
182
175
 
183
176
  def __repr__(self) -> str:
184
177
  return f"GeneralBoundary(no={self.no}, constraints={self.constraints})"
185
178
 
179
+ @property
180
+ def constraints_dict(self) -> dict[str, bool]:
181
+ """约束状态字典 {DX, DY, DZ, RX, RY, RZ, RW},True = 约束。
182
+
183
+ C++ 侧透传的是固定顺序的 7 位整数列表,这里转成可读字典。
184
+ """
185
+ return constraints_to_dict(self.constraints)
186
+
186
187
  @property
187
188
  def ux(self) -> int:
188
189
  return self.constraints[0] if len(self.constraints) > 0 else 0
@@ -227,17 +228,22 @@ class MstSlvBoundary(Boundary):
227
228
  def _from_dict(cls, d: dict) -> MstSlvBoundary:
228
229
  """从接口 dict 构造 MstSlvBoundary 对象"""
229
230
  return cls(
230
- no=d.get("no"),
231
- name=d.get("name"),
231
+ no=as_no(d.get("no")),
232
+ name=as_name(d.get("name")),
232
233
  boundary_type=BoundaryType.MSTSLV,
233
- entity_vec=list(d.get("entityVec")),
234
+ entity_vec=list(d.get("entityVec") or []),
234
235
  is_occupied=d.get("isOccupied"),
235
236
  is_selected=d.get("isSelected"),
236
- is_ploted=d.get("isPloted"),
237
- constraints=list(d.get("constraints")),
237
+ is_plotted=d.get("isPlotted"),
238
+ constraints=list(d.get("constraints") or []),
238
239
  master_no=d.get("masterNO"),
239
240
  )
240
241
 
242
+ @property
243
+ def constraints_dict(self) -> dict[str, bool]:
244
+ """约束状态字典 {DX, DY, DZ, RX, RY, RZ}(主从约束无 RW)"""
245
+ return constraints_to_dict(self.constraints)
246
+
241
247
  def __repr__(self) -> str:
242
248
  return f"MstSlvBoundary(no={self.no}, master_no={self.master_no})"
243
249
 
@@ -245,7 +251,7 @@ class MstSlvBoundary(Boundary):
245
251
  @dataclass(frozen=True)
246
252
  class ReleaseBoundary(Boundary):
247
253
  """释放梁端约束
248
-
254
+
249
255
  I端(7) + J端(7) = 14个约束状态/值
250
256
  state: 0 = 释放,1 = 约束
251
257
  value: 0-1 表示释放后残余约束能力的百分比
@@ -259,19 +265,29 @@ class ReleaseBoundary(Boundary):
259
265
  def _from_dict(cls, d: dict) -> ReleaseBoundary:
260
266
  """从接口 dict 构造 ReleaseBoundary 对象"""
261
267
  return cls(
262
- no=d.get("no"),
263
- name=d.get("name"),
268
+ no=as_no(d.get("no")),
269
+ name=as_name(d.get("name")),
264
270
  boundary_type=BoundaryType.RELEASE,
265
- entity_vec=list(d.get("entityVec")),
271
+ entity_vec=list(d.get("entityVec") or []),
266
272
  is_occupied=d.get("isOccupied"),
267
273
  is_selected=d.get("isSelected"),
268
- is_ploted=d.get("isPloted"),
269
- i_state=list(d.get("endIState")),
270
- i_values=list(d.get("endI")),
271
- j_state=list(d.get("endJState")),
272
- j_values=list(d.get("endJ")),
274
+ is_plotted=d.get("isPlotted"),
275
+ i_state=list(d.get("endIState") or []),
276
+ i_values=list(d.get("endI") or []),
277
+ j_state=list(d.get("endJState") or []),
278
+ j_values=list(d.get("endJ") or []),
273
279
  )
274
280
 
281
+ @property
282
+ def i_state_dict(self) -> dict[str, bool]:
283
+ """I 端约束状态字典 {DX, DY, DZ, RX, RY, RZ, RW}"""
284
+ return constraints_to_dict(self.i_state)
285
+
286
+ @property
287
+ def j_state_dict(self) -> dict[str, bool]:
288
+ """J 端约束状态字典 {DX, DY, DZ, RX, RY, RZ, RW}"""
289
+ return constraints_to_dict(self.j_state)
290
+
275
291
  def __repr__(self) -> str:
276
292
  return f"ReleaseBoundary(no={self.no})"
277
293
 
@@ -293,17 +309,17 @@ class ElstcSptBoundary(Boundary):
293
309
  def _from_dict(cls, d: dict) -> ElstcSptBoundary:
294
310
  """从接口 dict 构造 ElstcSptBoundary 对象"""
295
311
  return cls(
296
- no=d.get("no"),
297
- name=d.get("name"),
312
+ no=as_no(d.get("no")),
313
+ name=as_name(d.get("name")),
298
314
  boundary_type=BoundaryType.ELSTCSPT,
299
- entity_vec=list(d.get("entityVec")),
315
+ entity_vec=list(d.get("entityVec") or []),
300
316
  is_occupied=d.get("isOccupied"),
301
317
  is_selected=d.get("isSelected"),
302
- is_ploted=d.get("isPloted"),
318
+ is_plotted=d.get("isPlotted"),
303
319
  # constraints=list(d.get("constraints")),
304
320
  coor_no=d.get("coorNO"),
305
- k_values=list(d.get("k")),
306
- elastic_k=list(d.get("elasticK")),
321
+ k_values=list(d.get("k") or []),
322
+ elastic_k=list(d.get("elasticK") or []),
307
323
  )
308
324
 
309
325
  def __repr__(self) -> str:
@@ -329,13 +345,13 @@ class GeneralElstcSptBoundary(Boundary):
329
345
  def _from_dict(cls, d: dict) -> GeneralElstcSptBoundary:
330
346
  """从接口 dict 构造 GeneralElstcSptBoundary 对象"""
331
347
  return cls(
332
- no=d.get("no"),
333
- name=d.get("name"),
348
+ no=as_no(d.get("no")),
349
+ name=as_name(d.get("name")),
334
350
  boundary_type=BoundaryType.GENERALELSTCSPT,
335
- entity_vec=list(d.get("entityVec")),
351
+ entity_vec=list(d.get("entityVec") or []),
336
352
  is_occupied=d.get("isOccupied"),
337
353
  is_selected=d.get("isSelected"),
338
- is_ploted=d.get("isPloted"),
354
+ is_plotted=d.get("isPlotted"),
339
355
  coor_no=d.get("coorNO"),
340
356
  flag_m=d.get("flagM"),
341
357
  flag_c=d.get("flagC"),
@@ -15,3 +15,14 @@ from .basic_manager import BasicManager, LazyRef
15
15
  from .exceptions import DependencyError
16
16
  from .references import get_references, raise_if_occupied
17
17
  from .sdk import health, sdk_version, list_commands, instance_info
18
+ from .enums import (
19
+ OsisEnum,
20
+ ElementType, BoundaryType, MaterialType, MaterialCode,
21
+ SectionType, LoadCaseType, SplineType, TensionType,
22
+ LiveGradeType,
23
+ element_type_name, boundary_type_name, material_type_name,
24
+ material_code_name, section_type_name, loadcase_type_name,
25
+ spline_type_name, live_grade_name,
26
+ DOF_NAMES, constraints_to_dict,
27
+ )
28
+ from .normalize import as_no, as_name