diff --git a/.github/workflows/CADRE_test_workflow.yml b/.github/workflows/CADRE_test_workflow.yml index 97c49ad..70c4aca 100644 --- a/.github/workflows/CADRE_test_workflow.yml +++ b/.github/workflows/CADRE_test_workflow.yml @@ -40,14 +40,14 @@ jobs: - name: Setup conda uses: conda-incubator/setup-miniconda@v2 with: - python-version: 3 + python-version: 3.11 conda-version: "*" channels: conda-forge,defaults channel-priority: true - name: Create Environment run: | - conda install numpy scipy -q -y + conda install numpy=1.23 scipy -q -y python -m pip install --upgrade pip diff --git a/CADRE/test/test_mdp.py b/CADRE/test/test_mdp.py index 593e2ae..e5bd96f 100644 --- a/CADRE/test/test_mdp.py +++ b/CADRE/test/test_mdp.py @@ -10,8 +10,11 @@ import pickle import unittest +from packaging.version import Version + import numpy as np +from openmdao import __version__ as om_version from openmdao.api import Problem, PETScKrylov from openmdao.utils.mpi import MPI @@ -161,7 +164,15 @@ def test_CADRE_MDP(self): bkey2 = '.'.join(parts) actual = Ja[key1][key2] - computed = Jb[bkey1, bkey2] + if Version(om_version) <= Version("3.30"): + computed = Jb[bkey1, bkey2] + else: + # as of OpenMDAO 3.31.0, the keys in the jac are the 'user facing' names + # given to the design vars and responses, rather than the absolute names + # that were used previously + computed = Jb[prob.model._var_allprocs_abs2prom['output'][bkey1], + prob.model._var_allprocs_abs2prom['output'][bkey2]] + if isinstance(computed, np.ndarray): rel = np.linalg.norm(actual - computed)/np.linalg.norm(actual) else: