feat: convert PyVector properties to use macros
Properties x and y now use MCRF_PROPERTY for consistency. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
		
							parent
							
								
									07e8207a08
								
							
						
					
					
						commit
						a8a257eefc
					
				| 
						 | 
					@ -4,8 +4,10 @@
 | 
				
			||||||
#include <cmath>
 | 
					#include <cmath>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
PyGetSetDef PyVector::getsetters[] = {
 | 
					PyGetSetDef PyVector::getsetters[] = {
 | 
				
			||||||
    {"x", (getter)PyVector::get_member, (setter)PyVector::set_member, "X/horizontal component",   (void*)0},
 | 
					    {"x", (getter)PyVector::get_member, (setter)PyVector::set_member,
 | 
				
			||||||
    {"y", (getter)PyVector::get_member, (setter)PyVector::set_member, "Y/vertical component",     (void*)1},
 | 
					     MCRF_PROPERTY(x, "X coordinate of the vector (float)"), (void*)0},
 | 
				
			||||||
 | 
					    {"y", (getter)PyVector::get_member, (setter)PyVector::set_member,
 | 
				
			||||||
 | 
					     MCRF_PROPERTY(y, "Y coordinate of the vector (float)"), (void*)1},
 | 
				
			||||||
    {NULL}
 | 
					    {NULL}
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -23,5 +23,17 @@ assert "Return a unit vector" in normalize_doc
 | 
				
			||||||
assert "Returns:" in normalize_doc
 | 
					assert "Returns:" in normalize_doc
 | 
				
			||||||
assert "Note:" in normalize_doc
 | 
					assert "Note:" in normalize_doc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Check Vector.x property docstring
 | 
				
			||||||
 | 
					x_doc = mcrfpy.Vector.x.__doc__
 | 
				
			||||||
 | 
					print("x property doc:", x_doc)
 | 
				
			||||||
 | 
					assert "X coordinate of the vector" in x_doc
 | 
				
			||||||
 | 
					assert "float" in x_doc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Check Vector.y property docstring
 | 
				
			||||||
 | 
					y_doc = mcrfpy.Vector.y.__doc__
 | 
				
			||||||
 | 
					print("y property doc:", y_doc)
 | 
				
			||||||
 | 
					assert "Y coordinate of the vector" in y_doc
 | 
				
			||||||
 | 
					assert "float" in y_doc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
print("SUCCESS: All docstrings present and complete")
 | 
					print("SUCCESS: All docstrings present and complete")
 | 
				
			||||||
sys.exit(0)
 | 
					sys.exit(0)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue