feat: convert PyVector to use documentation macros
Converts magnitude, normalize, and dot methods to MCRF_METHOD macro. Docstrings now include complete Args/Returns/Raises sections. Addresses issue #92.
This commit is contained in:
parent
a08003bda4
commit
91461d0f87
2 changed files with 41 additions and 3 deletions
19
tools/test_vector_docs.py
Normal file
19
tools/test_vector_docs.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import mcrfpy
|
||||
import sys
|
||||
|
||||
# Check Vector.magnitude docstring
|
||||
mag_doc = mcrfpy.Vector.magnitude.__doc__
|
||||
print("magnitude doc:", mag_doc)
|
||||
assert "magnitude()" in mag_doc
|
||||
assert "Calculate the length/magnitude" in mag_doc
|
||||
assert "Returns:" in mag_doc
|
||||
|
||||
# Check Vector.dot docstring
|
||||
dot_doc = mcrfpy.Vector.dot.__doc__
|
||||
print("dot doc:", dot_doc)
|
||||
assert "dot(other: Vector)" in dot_doc
|
||||
assert "Args:" in dot_doc
|
||||
assert "other:" in dot_doc
|
||||
|
||||
print("SUCCESS: All docstrings present and complete")
|
||||
sys.exit(0)
|
||||
Loading…
Add table
Add a link
Reference in a new issue