Skip to content

Commit

Permalink
Fix up doctests for Numpy 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-brett committed Jun 17, 2024
1 parent 914fee8 commit 43234d8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Transforms3d
The transforms3d package, including all examples, code snippets and attached
documentation is covered by the 2-clause BSD license.

Copyright (c) 2009-2022, Matthew Brett and Christoph Gohlke
Copyright (c) 2009-2024, Matthew Brett and Christoph Gohlke
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

# General information about the project.
project = u'transforms3d'
copyright = u'2009-2022, Matthew Brett, Christoph Gohlke'
copyright = u'2009-2024, Matthew Brett, Christoph Gohlke'

def check_import(mod_name):
try:
Expand Down
3 changes: 1 addition & 2 deletions transforms3d/affines.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,7 @@ def compose(T, R, Z, S=None):
[ 0., 0., 0., 1.]])
>>> S = np.zeros(3)
>>> B = compose(T, R, Z, S)
>>> np.all(A == B)
True
>>> assert(np.all(A == B)) # True
A null set
Expand Down
9 changes: 3 additions & 6 deletions transforms3d/quaternions.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,10 @@ def fillpositive(xyz, w2_thresh=None):
--------
>>> import numpy as np
>>> wxyz = fillpositive([0,0,0])
>>> np.all(wxyz == [1, 0, 0, 0])
True
>>> assert np.all(wxyz == [1, 0, 0, 0])
>>> wxyz = fillpositive([1,0,0]) # Corner case; w is 0
>>> np.all(wxyz == [0, 1, 0, 0])
True
>>> np.dot(wxyz, wxyz)
1.0
>>> assert np.all(wxyz == [0, 1, 0, 0])
>>> assert np.dot(wxyz, wxyz) == 1
'''
# Check inputs (force error if < 3 values)
if len(xyz) != 3:
Expand Down
3 changes: 1 addition & 2 deletions transforms3d/shears.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,7 @@ def aff2sadn(aff):
>>> angle, direction, normal, point = aff2sadn(A)
>>> angle, direction, normal
(0.5, array([1., 0., 0.]), array([0., 1., 0.]))
>>> np.all(point == [0, 0, 0])
True
>>> assert np.all(point == [0, 0, 0])
>>> A_again = sadn2aff(angle, direction, normal, point)
>>> np.allclose(A, A_again)
True
Expand Down

0 comments on commit 43234d8

Please sign in to comment.