Skip to content

Commit

Permalink
DP-481 : cleanup to get all python tests but one to pass
Browse files Browse the repository at this point in the history
 - working around numpy API for passing variables for now
  • Loading branch information
rhoope committed Feb 1, 2022
1 parent ef4c1e5 commit 43e98be
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion cmake/DakotaExamplesAddTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ function(apply_test_properties _test_name _depends_on)

add_conditional_dependence(${_test_name} "${_depends_on}")

get_filename_component(_python_exe_dir ${Python_EXECUTABLE} DIRECTORY)
set(_env_path
"PATH=${DAKOTA_DPREPRO_PATH}:${DAKOTA_TEST_DRIVERS_PATH}:$ENV{PATH}")
"PATH=${_python_exe_dir}:${DAKOTA_DPREPRO_PATH}:${DAKOTA_TEST_DRIVERS_PATH}:$ENV{PATH}")
set(_env_python_path "PYTHONPATH=${DAKOTA_PYTHON_PATH}:$ENV{PYTHONPATH}")

# Can only have generator expressions in certain commands:
Expand Down
4 changes: 2 additions & 2 deletions official/drivers/Python/linked/rosenbrock.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
def rosenbrock_list(**kwargs):
def rosenbrock_list(kwargs):

num_fns = kwargs['functions']
# if num_fns > 1:
Expand Down Expand Up @@ -38,7 +38,7 @@ def rosenbrock_list(**kwargs):

return(retval)

def rosenbrock_numpy(**kwargs):
def rosenbrock_numpy(kwargs):

from numpy import array

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ variables,
descriptors 'x1' 'x2' 'x3'

interface,
pybind11
python
analysis_driver = 'driver-np-or-list:text_book'

responses,
Expand Down
4 changes: 2 additions & 2 deletions official/surrogates/library/benchmark_functions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np

def unpack_inputs(params):
x = params["cv"]
x = np.array(params["cv"])
ASV = params["asv"]
return x, ASV

Expand Down Expand Up @@ -86,7 +86,7 @@ def Dette_and_Peplyshev(**kwargs):
retval["fns"] = np.array([f])
return retval

def Morris(**kwargs):
def Morris(kwargs):
"""
input space: [0, 1]**20
"""
Expand Down

0 comments on commit 43e98be

Please sign in to comment.