-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsmart_ide_hints_demo.py
More file actions
51 lines (38 loc) · 1.66 KB
/
smart_ide_hints_demo.py
File metadata and controls
51 lines (38 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env python3
"""
Test intelligent type hinting functionality
"""
import openseespy.opensees as original_ops
from opsparser import OpenSeesParser, OpenSeesCommand
# Optional: Keep the original test function for manual execution
def demo():
"""IDE intelligent hint demo"""
print("🧪 Testing intelligent type hinting functionality")
print("=" * 40)
# Create enhanced ops (enable debug mode)
parser = OpenSeesParser(original_ops)
ops = parser.enhance()
# Clear the model
ops.wipe()
# Basic model
ops.model('basic', '-ndm', 2, '-ndf', 3)
print("✅ Model created")
# Node - test traditional positional arguments
ops.node(1, 0.0, 1)
ops.node(2, 1.0, 0.0)
print("✅ Nodes created")
# Material - test intelligent hints
ops.uniaxialMaterial('Elastic', 1, 29000.0)
print("✅ Elastic material - IDE should show: elastic_modulus: float")
ops.uniaxialMaterial('Steel01', 2, 60.0, 29000.0, 0.02)
print("✅ Steel material - IDE should show: yield_strength, initial_stiffness, strain_hardening_ratio")
# Geometric transformation - test intelligent hints
ops.geomTransf('Linear', 1)
print("✅ Linear transformation - IDE should show: vec_x_z, vec_y_z, vec_z_z (optional)")
# Element - test intelligent hints
ops.element('truss', 1, 1, 2, 100.0, 1)
print("✅ Truss element - IDE should show: node_i, node_j, area, material_tag")
ops.element('elasticBeamColumn', 2, 1, 2, 150.0, 29000.0, 1200.0, 1)
print("✅ Beam-column element - IDE should show: area, elastic_modulus, moment_of_inertia, geom_transf_tag")
if __name__ == "__main__":
demo()