Skip to content

Commit f941880

Browse files
sassy-asjpNatsoulas
authored andcommitted
Add support for numpy 2.1
numpy/numpy#26292 included in numpy 2.1.0 breaks usage of `order` as a positional argument into `np.reshape`.
1 parent 621ac12 commit f941880

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pandas
22
matplotlib
3-
numpy<=2.0.1
3+
numpy
44
colorama
55
tqdm
66
Pillow

src/fswAlgorithms/effectorInterfaces/rwMotorTorque/_UnitTest/test_rwMotorTorqueParametrized.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def rwMotorTorqueTest(show_plots, numControlAxes, numWheels, RWAvailMsg):
235235
MAX_EFF_CNT, testFailCount, testMessages)
236236

237237

238-
GsMatrix = np.transpose(np.reshape(rwConfigParams.GsMatrix_B,(MAX_EFF_CNT,3),"C"))
238+
GsMatrix = np.transpose(np.reshape(rwConfigParams.GsMatrix_B, (MAX_EFF_CNT, 3), order="C"))
239239
F = np.transpose(moduleOutput[0])
240240
receivedTorque = -1.0*np.array([np.matmul(GsMatrix,F)])
241241
receivedTorque = np.append(np.array([]), receivedTorque)

src/fswAlgorithms/effectorInterfaces/thrForceMapping/_UnitTest/Support/Results_thrForceMapping.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def __init__(self, Lr, COrig, COM, rData, gData, thrForceSign, thrForceMag, angE
1616
self.numThrusters = numThrusters # number of explicitly configured thrusters
1717

1818
self.C = np.array(COrig) # Control "Frame" (could be 1, 2, or 3 axii controllable)
19-
self.C = np.reshape(self.C, ((len(self.C)//3),3),'C')
19+
self.C = np.reshape(self.C, ((len(self.C)//3), 3), order='C')
2020

2121
self.epsilon = epsilon
2222
self.use2ndLoop = use2ndLoop
@@ -52,7 +52,7 @@ def results_thrForceMapping(self):
5252
for i in range(0,len(F)):
5353
if t[i]:
5454
DNew = np.append(DNew, np.cross((self.rData[i,:] - self.COM), self.gData[i]))
55-
DNew = np.reshape(DNew, (3, (len(DNew) // 3)), 'F')
55+
DNew = np.reshape(DNew, (3, (len(DNew) // 3)), order='F')
5656
FNew = self.mapToForce(DNew, Lr_Bar)
5757
if (self.thrForceSign > 0):
5858
FNew = self.subtractMin(FNew,len(DNew[0])) # Produced negative forces when doing 2nd loop, dropped thruster, and COM offset

0 commit comments

Comments
 (0)