Navigation Menu

Skip to content

Commit

Permalink
Merge d448903 into b375e11
Browse files Browse the repository at this point in the history
  • Loading branch information
swryan committed May 21, 2019
2 parents b375e11 + d448903 commit f204401
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
14 changes: 8 additions & 6 deletions .travis.yml
Expand Up @@ -50,23 +50,25 @@ notifications:
secure: Dd+tpZkz48Q47Y+PtdL4b+KAs55PsvWjt9ybhip6xljhA5kVsba9oZS+KsAC8RLWSzVJLOSjz3Cu3MsRym4sTd/g4Pbqyh0ldK2Xnl+n2JOgpPFSXtFuH4Ln3uWB6kYtUK6+aGIC8qhbvEt8tukTBT0RduEmdRyVIZ3oN7YjETPSZXvujeiUFLssfpZW2mqoA/tIgJHFSlySAp6J5694t2Z/p8sHOrK8G/Nm+qlk4xqXHvJ3xablcSBG4BZCrpqmMMdTLXBt2E2K9Rc1P2ZBIrSHVWfSLx+4n79U2385+og7miN1Zuf3gY3YuGKIwnBTtEzTu20905idkr4QdKELCBEcU4azdznwjvUkXWkiFAJII9UELTluSQmZX602zWk4AgJNeHxhN3EbBSMezfYVZjprhlAlwnZZv6t4qAkvuzb7KOA4s679xWzWOBOn1wkynfIF8A66APqssveyz/PvZHSjnHQoLgMU+kwzoX759o0Z/HuRlhCcjv0W9DWxU2bFNi/zVh9YyvR8fG15biGthzOyuf+CHjxohw+J6M+YdR1RIf1g/60nGUPHx4j4SN3kEFPmEDxzZT/f349gvaZGOmKXBi0wH8iY/i9RinM9LJB4t6chj2MkKwUA26bYaVaIO6FYPfE7r+tTG6OXdck4voCs/s4aa9VKEX97yhh0i9g=

before_install:
# Check for existence of files to determine if cache exists
# When building master (e.g. after a merge), we will create a fresh env as a thorough test.
# For other builds (e.g. pull requests), try to use cached env for faster testing.
# Need to check for existence of files to determine if cache exists.
# If the dir doesn't exist, but is slated to be cached later,
# Travis unhelpfully creates it, which then causes "dir already exists"
# errors when you go to actually install the thing, so we must non-intuitively
# delete the file before re-creating it later.
- if [ -d $HOME/miniconda/envs/PY$PY ]; then
- if [ "$TRAVIS_REPO_SLUG" = "OpenMDAO/OpenMDAO" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
echo "building master";
MASTER_BUILD=1;
rm -rf $HOME/miniconda;
elif [ -d $HOME/miniconda/envs/PY$PY ]; then
echo "cached miniconda environment found";
CACHED_ENV=1;
else
echo "cached miniconda environment not found";
rm -rf $HOME/miniconda;
fi

- if [ "$TRAVIS_REPO_SLUG" = "OpenMDAO/OpenMDAO" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
MASTER_BUILD=1;
fi

install:
# get key decrypted, placed, chmodded, and added for passwordless access to WebFaction
- if [ "$encrypted_74d70a284b7d_key" ]; then
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Expand Up @@ -20,7 +20,7 @@ environment:

- APPVEYOR_BUILD_WORKER_IMAGE: Previous Ubuntu
PYTHON: 2.7
NUMPY: 1.15
NUMPY: 1.13
SCIPY: 1.0.1
PETSc: 3.9.1 # 3.9.1 released 2018-05-02

Expand Down
6 changes: 4 additions & 2 deletions openmdao/core/tests/test_discrete.py
@@ -1,4 +1,4 @@
""" Unit tests for the problem interface."""
""" Unit tests for discrete variables."""

import sys
import unittest
Expand All @@ -18,6 +18,7 @@
from openmdao.test_suite.components.sellar import StateConnection, \
SellarDis1withDerivatives, SellarDis2withDerivatives


class ModCompEx(ExplicitComponent):
def __init__(self, modval, **kwargs):
super(ModCompEx, self).__init__(**kwargs)
Expand Down Expand Up @@ -394,6 +395,7 @@ def test_deriv_err(self):
self.assertEqual(str(ctx.exception),
"Total derivative with respect to 'indep.x' depends upon discrete output variables ['G.G1.C1.y'].")


class SolverDiscreteTestCase(unittest.TestCase):
def _setup_model(self, solver_class):
prob = Problem()
Expand Down Expand Up @@ -524,7 +526,6 @@ def test_obj_pass(self):
self.assertEqual(prob['C4.y'].getval(), 52)



class DiscreteFeatureTestCase(unittest.TestCase):
def test_feature_discrete(self):
import numpy as np
Expand Down Expand Up @@ -567,5 +568,6 @@ def compute(self, inputs, outputs, discrete_inputs, discrete_outputs):
# minimum value
assert_rel_error(self, prob['SolidityComp.blade_solidity'], 0.02984155, 1e-4)


if __name__ == "__main__":
unittest.main()

0 comments on commit f204401

Please sign in to comment.