Skip to content

Commit 1834609

Browse files
committedNov 8, 2022
Changed numpy from nm to np.
1 parent 2076f25 commit 1834609

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed
 

‎box_example.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#------------------------------------------------------------------------------
88
import math as m
99

10-
import numpy as nm
10+
import numpy as np
1111

1212
import dot as dot
1313

@@ -57,9 +57,9 @@ def myEvaluate(x, obj, g, param):
5757

5858
# Create numpy arrays for the initial values and lower and upper bounds of the
5959
# design variables
60-
x = nm.empty(nDvar, float)
61-
xl = nm.empty(nDvar, float)
62-
xu = nm.empty(nDvar, float)
60+
x = np.empty(nDvar, float)
61+
xl = np.empty(nDvar, float)
62+
xu = np.empty(nDvar, float)
6363

6464
# Set the initial values and upper and lower bounds for the design variables
6565
for i in range(nDvar):

‎dot.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import platform
88
from ctypes import byref as B
99

10-
import numpy as nm
10+
import numpy as np
1111

1212

1313
# Define the Python wrapper to the DOT shared library as a Python class
@@ -19,9 +19,9 @@ class dot:
1919
nPrint = 0
2020
nMinMax = 0
2121
nMaxInt = 20000000
22-
nmParam = nm.empty(1, float)
23-
nmRPRM = nm.zeros(20, float)
24-
nmIPRM = nm.zeros(20, int)
22+
nmParam = np.empty(1, float)
23+
nmRPRM = np.zeros(20, float)
24+
nmIPRM = np.zeros(20, int)
2525

2626
# ---------------------------------------------------------
2727
# Initialize the class - this loads the DOT shared library
@@ -115,7 +115,7 @@ def dotcall(self, x, xl, xu, nCons):
115115
self.evaluate(X, OBJ, G, self.nmParam)
116116

117117
# Process the DOT output into a return value array
118-
rslt = nm.empty( 2+nDvar, float)
118+
rslt = np.empty( 2+nDvar, float)
119119
rslt[0] = OBJ.value
120120
rslt[1] = 0.0
121121
if len(G) > 0 :

0 commit comments

Comments
 (0)
Please sign in to comment.