Skip to content

Commit

Permalink
Merge pull request #1215 from DKilkenny/future_removes
Browse files Browse the repository at this point in the history
Removing Futures imports
  • Loading branch information
swryan committed Mar 2, 2020
2 parents 8f86a8a + 30dd7df commit 5f166b5
Show file tree
Hide file tree
Showing 191 changed files with 2 additions and 307 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ env:
- PY=3 NUMPY=1.18 SCIPY=1.4 PETSc=3.12 UPLOAD_DOCS=1
- PY=3.7 NUMPY=1.17 SCIPY=1.3
- PY=3.6 NUMPY=1.16 SCIPY=1.2 PETSc=3.10.1
- PY=2.7 NUMPY=1.15 SCIPY=1.2 PETSc=3.9
- PY=2.7 NUMPY=1.14 SCIPY=1.1

git:
depth: 99999
Expand Down
3 changes: 0 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ environment:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PYTHON: 3

- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PYTHON: 2

# - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
# PYTHON: 3
# PETSc: 3.12
Expand Down
1 change: 0 additions & 1 deletion benchmark/benchmark_multipoint.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
import time
import unittest
from six.moves import range
Expand Down
2 changes: 0 additions & 2 deletions openmdao/approximation_schemes/approximation_scheme.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""Base class used to define the interface for derivative approximation schemes."""
from __future__ import print_function, division

from six import iteritems
from collections import defaultdict
from scipy.sparse import coo_matrix
Expand Down
2 changes: 0 additions & 2 deletions openmdao/approximation_schemes/complex_step.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""Complex Step derivative approximations."""
from __future__ import division, print_function

from six import iteritems, itervalues
from six.moves import range
from collections import defaultdict
Expand Down
2 changes: 0 additions & 2 deletions openmdao/approximation_schemes/finite_difference.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""Finite difference derivative approximations."""
from __future__ import division, print_function

from collections import namedtuple, defaultdict
from six import iteritems
from six.moves import range, zip
Expand Down
2 changes: 0 additions & 2 deletions openmdao/code_review/test_lint_attributes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import unittest
import os.path
import importlib
Expand Down
10 changes: 1 addition & 9 deletions openmdao/code_review/test_lint_docstrings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import ast
import unittest
import os.path
Expand Down Expand Up @@ -314,13 +312,7 @@ def check_returns(self, func, numpy_doc_string, name_required=False):
dedented_src = textwrap.dedent(method_src)

f = ReturnFinder()
try:
f.visit(ast.parse(dedented_src))
except SyntaxError:
# ast.parse in python 2 will fail if we use certain print function syntax in
# our function.
dedented_src = 'from __future__ import print_function\n' + dedented_src
f.visit(ast.parse(dedented_src))
f.visit(ast.parse(dedented_src))

# If the function does nothing but pass, return
if f.passes:
Expand Down
2 changes: 0 additions & 2 deletions openmdao/code_review/test_lint_peps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import unittest
import os
from fnmatch import fnmatch, filter as fnfilter
Expand Down
2 changes: 0 additions & 2 deletions openmdao/components/balance_comp.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Define the BalanceComp class."""

from __future__ import print_function, division, absolute_import

from types import FunctionType
from numbers import Number
from six import iteritems
Expand Down
2 changes: 0 additions & 2 deletions openmdao/components/eq_constraint_comp.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Define the EQConstraintComp class."""

from __future__ import print_function, division, absolute_import

from numbers import Number
from six import iteritems

Expand Down
2 changes: 0 additions & 2 deletions openmdao/components/external_code_comp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""Define the ExternalCodeComp and ExternalCodeImplicitComp classes."""
from __future__ import print_function

import os
import sys
import re
Expand Down
1 change: 0 additions & 1 deletion openmdao/components/interp_util/interp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
Based on Tables in NPSS, and was added to bridge the gap between some of the slower scipy
implementations.
"""
from __future__ import division, print_function, absolute_import
from six.moves import range

import numpy as np
Expand Down
1 change: 0 additions & 1 deletion openmdao/components/interp_util/interp_akima.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
Based on NPSS implementation, with improvements from Andrew Ning (BYU).
"""
from __future__ import division, print_function, absolute_import
from six.moves import range

import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions openmdao/components/interp_util/interp_algorithm.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"""
Base class for interpolation methods. New methods should inherit from this class.
"""
from __future__ import division, print_function, absolute_import

from openmdao.utils.options_dictionary import OptionsDictionary


Expand Down
2 changes: 0 additions & 2 deletions openmdao/components/interp_util/interp_bsplines.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"""
Interpolation usng simple B-splines.
"""
from __future__ import division, print_function, absolute_import

import numpy as np
from scipy.sparse import csc_matrix, csr_matrix

Expand Down
1 change: 0 additions & 1 deletion openmdao/components/interp_util/interp_cubic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
Based on NPSS implementation.
"""
from __future__ import division, print_function, absolute_import
from six.moves import range

import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions openmdao/components/interp_util/interp_lagrange2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
Based on NPSS implementation.
"""
from __future__ import division, print_function, absolute_import

import numpy as np

from openmdao.components.interp_util.interp_algorithm import InterpAlgorithm
Expand Down
2 changes: 0 additions & 2 deletions openmdao/components/interp_util/interp_lagrange3.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
Based on NPSS implementation.
"""
from __future__ import division, print_function, absolute_import

import numpy as np

from openmdao.components.interp_util.interp_algorithm import InterpAlgorithm
Expand Down
2 changes: 0 additions & 2 deletions openmdao/components/interp_util/interp_scipy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""Grid interpolation using scipy splines."""
from __future__ import division, print_function, absolute_import

from six.moves import range

from scipy import __version__ as scipy_version
Expand Down
2 changes: 0 additions & 2 deletions openmdao/components/interp_util/interp_slinear.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
Based on NPSS implementation.
"""
from __future__ import division, print_function, absolute_import

import numpy as np

from openmdao.components.interp_util.interp_algorithm import InterpAlgorithm
Expand Down
1 change: 0 additions & 1 deletion openmdao/components/interp_util/outofbounds_error.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Exception rasied by grid interpolators when they go out of bounds."""
from __future__ import division, print_function, absolute_import


class OutOfBoundsError(Exception):
Expand Down
1 change: 0 additions & 1 deletion openmdao/components/interp_util/tests/test_interp_nd.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""
Unit tests for the spline interpolator component.
"""
from __future__ import division, print_function, absolute_import
from copy import deepcopy
import unittest

Expand Down
2 changes: 0 additions & 2 deletions openmdao/components/linear_system_comp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""Define the LinearSystemComp class."""
from __future__ import division, print_function

from six.moves import range

import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions openmdao/components/meta_model_structured_comp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""Define the MetaModelStructured class."""
from __future__ import division, print_function, absolute_import

from six import raise_from, iteritems, itervalues
from six.moves import range

Expand Down
2 changes: 0 additions & 2 deletions openmdao/components/tests/test_add_subtract_comp.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function, division, absolute_import

import unittest

import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions openmdao/components/tests/test_balance_comp.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"""
Unit tests for the BalanceComp.
"""
from __future__ import print_function, division, absolute_import

import os
import unittest
import warnings
Expand Down
2 changes: 0 additions & 2 deletions openmdao/components/tests/test_bsplines_comp.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"""
Test the B-spline interpolation component.
"""
from __future__ import print_function

import unittest

import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions openmdao/components/tests/test_cross_product_comp.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function, division, absolute_import

import unittest

import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions openmdao/components/tests/test_demux_comp.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function, division, absolute_import

import unittest

import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions openmdao/components/tests/test_dot_product_comp.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"""
Unit test for DotProductComp.
"""
from __future__ import print_function, division, absolute_import

import unittest

import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions openmdao/components/tests/test_exec_comp.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function, division, absolute_import

import itertools
import unittest
import math
Expand Down
2 changes: 0 additions & 2 deletions openmdao/components/tests/test_external_code_comp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
""" Test the ExternalCodeComp. """
from __future__ import print_function

import os
import sys
import shutil
Expand Down
2 changes: 0 additions & 2 deletions openmdao/components/tests/test_ks_comp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
""" Test the KSFunction component. """
from __future__ import print_function

import unittest

import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions openmdao/components/tests/test_matrix_vector_product_comp.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function, division, absolute_import

import unittest

import numpy as np
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""
Unit tests for the structured metamodel component.
"""
from __future__ import division, print_function, absolute_import
import unittest
from six import assertRaisesRegex

Expand Down
2 changes: 0 additions & 2 deletions openmdao/components/tests/test_mux_comp.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function, division, absolute_import

import unittest

import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions openmdao/components/tests/test_vector_magnitude_comp.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function, division, absolute_import

import unittest

import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions openmdao/core/component.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Define the Component class."""

from __future__ import division

from collections import OrderedDict, Counter, defaultdict

# note: this is a Python 3.3 change, clean this up for OpenMDAO 3.x
Expand Down
2 changes: 0 additions & 2 deletions openmdao/core/driver.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""Define a base class for all Drivers in OpenMDAO."""
from __future__ import print_function

from collections import OrderedDict
import pprint
import sys
Expand Down
2 changes: 0 additions & 2 deletions openmdao/core/explicitcomponent.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Define the ExplicitComponent class."""

from __future__ import division

import numpy as np
from six import itervalues, iteritems
from six.moves import range
Expand Down
2 changes: 0 additions & 2 deletions openmdao/core/group.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""Define the Group class."""
from __future__ import division

import os
from collections import Counter, OrderedDict, defaultdict

Expand Down
2 changes: 0 additions & 2 deletions openmdao/core/implicitcomponent.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Define the ImplicitComponent class."""

from __future__ import division

import numpy as np
from six import itervalues, iteritems
from six.moves import range
Expand Down
2 changes: 0 additions & 2 deletions openmdao/core/indepvarcomp.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Define the IndepVarComp class."""

from __future__ import division

# note: this is a Python 3.3 change, clean this up for OpenMDAO 3.x
try:
from collections.abc import Iterable
Expand Down
2 changes: 0 additions & 2 deletions openmdao/core/problem.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Define the Problem class and a FakeComm class for non-MPI users."""

from __future__ import division, print_function

import sys
import pprint
import os
Expand Down
2 changes: 0 additions & 2 deletions openmdao/core/system.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""Define the base System class."""
from __future__ import division

import sys
import os
from contextlib import contextmanager
Expand Down
1 change: 0 additions & 1 deletion openmdao/core/tests/test_add_var.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Acceptance and developer tests for add_input and add_output."""
from __future__ import division
import unittest

import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions openmdao/core/tests/test_aviary_mpi_bug.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function, division

import unittest
import numpy as np

Expand Down
1 change: 0 additions & 1 deletion openmdao/core/tests/test_coloring.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function

import os
import sys
Expand Down
2 changes: 0 additions & 2 deletions openmdao/core/tests/test_component.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""Component unittests."""
from __future__ import division

import numpy as np
import unittest

Expand Down
1 change: 0 additions & 1 deletion openmdao/core/tests/test_core_simple.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import division
import numpy as np
import unittest

Expand Down
2 changes: 0 additions & 2 deletions openmdao/core/tests/test_deriv_transfers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

from __future__ import division, print_function

import unittest
import itertools

Expand Down
2 changes: 0 additions & 2 deletions openmdao/core/tests/test_des_vars_responses.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
""" Unit tests for the design_variable and response interface to system."""
from __future__ import print_function

from six.moves import range

import unittest
Expand Down
Loading

0 comments on commit 5f166b5

Please sign in to comment.