From 3215efcc413a956a796288df4a025bfdad39df64 Mon Sep 17 00:00:00 2001 From: "David R. Pugh" Date: Mon, 13 Jul 2015 13:51:59 +0100 Subject: [PATCH 1/8] Major project reorg! --- pycollocation/__init__.py | 9 +- .../{boundary_value_problems.py => bvp.py} | 82 ++++++++--- pycollocation/differential_equations.py | 76 ----------- pycollocation/models.py | 128 +++++++++++++++++- pycollocation/solvers.py | 4 +- pycollocation/symbolics.py | 90 ++---------- .../tests/test_polynomial_collocation.py | 12 +- pycollocation/tests/test_symbolics.py | 10 -- 8 files changed, 208 insertions(+), 203 deletions(-) rename pycollocation/{boundary_value_problems.py => bvp.py} (50%) delete mode 100644 pycollocation/differential_equations.py delete mode 100644 pycollocation/tests/test_symbolics.py diff --git a/pycollocation/__init__.py b/pycollocation/__init__.py index 41ef828..324aa50 100644 --- a/pycollocation/__init__.py +++ b/pycollocation/__init__.py @@ -2,16 +2,15 @@ Objects imported here will live in the `pycollocation` namespace """ -__all__ = ["SymbolicBoundaryValueProblem", "OrthogonalPolynomialSolver", "Visualizer"] +__all__ = ["TwoPointBVP", "TwoPointBVPLike", "SymbolicTwoPointBVPLike", + "SymbolicTwoPointBVP", "OrthogonalPolynomialSolver", "Visualizer"] - -from . import boundary_value_problems -from . import differential_equations +from . import bvp from . import models from . import orthogonal_polynomials from . import visualizers -from . boundary_value_problems import SymbolicBoundaryValueProblem +from . bvp import * from . orthogonal_polynomials import OrthogonalPolynomialSolver from . visualizers import Visualizer diff --git a/pycollocation/boundary_value_problems.py b/pycollocation/bvp.py similarity index 50% rename from pycollocation/boundary_value_problems.py rename to pycollocation/bvp.py index d2ac00c..62e9bcd 100644 --- a/pycollocation/boundary_value_problems.py +++ b/pycollocation/bvp.py @@ -1,14 +1,13 @@ """ -Classes for constructing two-point boundary value problems. +Classes for representing two-point boundary value problems. -@author : davidrpugh +@author : David R. Pugh """ -from . import differential_equations -from . import symbolics +import models -class BoundaryValueProblem(object): +class TwoPointBVPLike(object): @property def boundary_conditions(self): @@ -51,23 +50,62 @@ def _validate_boundary(self, conditions): return conditions -class SymbolicBoundaryValueProblem(BoundaryValueProblem, - symbolics.SymbolicBoundaryValueProblemLike, - differential_equations.SymbolicDifferentialEquation): - """Class for representing two-point boundary value problems.""" +class SymbolicTwoPointBVPLike(TwoPointBVPLike, models.SymbolicModelLike): + + __lower_boundary_condition = None + + __upper_boundary_condition = None + + @property + def _lower_boundary_condition(self): + """Cache lambdified lower boundary condition for numerical evaluation.""" + condition = self.boundary_conditions['lower'] + if condition is not None: + if self.__lower_boundary_condition is None: + self.__lower_boundary_condition = self._lambdify_factory(condition) + return self.__lower_boundary_condition + else: + return None + + @property + def _upper_boundary_condition(self): + """Cache lambdified upper boundary condition for numerical evaluation.""" + condition = self.boundary_conditions['upper'] + if condition is not None: + if self.__upper_boundary_condition is None: + self.__upper_boundary_condition = self._lambdify_factory(condition) + return self.__upper_boundary_condition + else: + return None + + def _validate_boundary(self, conditions): + """Validate a dictionary of lower and upper boundary conditions.""" + bcs = {'lower': self._validate_boundary_exprs(conditions['lower']), + 'upper': self._validate_boundary_exprs(conditions['upper'])} + return bcs + + def _validate_boundary_exprs(self, expressions): + """Check that lower/upper boundary_conditions are expressions.""" + if expressions is None: + return None + else: + return [self._validate_expression(expr) for expr in expressions] - def __init__(self, boundary_conditions, dependent_vars, independent_var, - rhs, params): + +class SymbolicTwoPointBVP(SymbolicTwoPointBVPLike): + """Class for representing symbolic two-point boundary value problems.""" + + def __init__(self, boundary_conditions, dependent_vars, independent_var, params, rhs): """Create an instance of a two-point boundary value problem (BVP).""" - super(SymbolicBoundaryValueProblem, self).__init__(dependent_vars, - independent_var, - rhs, - params) self.boundary_conditions = boundary_conditions + self.dependent_vars = dependent_vars + self.independent_var = independent_var + self.params = params + self.rhs = rhs def _validate_boundary(self, conditions): """Validate a dictionary of lower and upper boundary conditions.""" - super(SymbolicBoundaryValueProblem, self)._validate_boundary(conditions) + super(SymbolicTwoPointBVP, self)._validate_boundary(conditions) bcs = {'lower': self._validate_boundary_exprs(conditions['lower']), 'upper': self._validate_boundary_exprs(conditions['upper'])} return bcs @@ -78,3 +116,15 @@ def _validate_boundary_exprs(self, expressions): return None else: return [self._validate_expression(expr) for expr in expressions] + + +class TwoPointBVP(TwoPointBVPLike): + """Class for representing two-point boundary value problems.""" + + def __init__(self, boundary_conditions, dependent_vars, independent_var, params, rhs): + """Create an instance of a two-point boundary value problem (BVP).""" + self.boundary_conditions = boundary_conditions + self.dependent = dependent_vars + self.independent_var = independent_var + self.params = params + self.rhs = rhs diff --git a/pycollocation/differential_equations.py b/pycollocation/differential_equations.py deleted file mode 100644 index 483552a..0000000 --- a/pycollocation/differential_equations.py +++ /dev/null @@ -1,76 +0,0 @@ -""" -Classes for constructing systems of ordinary differential equations. - -@author : davidrpugh - -""" -import sympy as sym - -from . import models -from . import symbolics - - -class DifferentialEquation(models.ModelLike): - - def __init__(self, dependent_vars, independent_var, rhs, params): - """Create an instance of the DifferentialEquation class.""" - self._dependent_vars = self._validate_variables(dependent_vars) - self._independent_var = self._validate_variable(independent_var) - self._rhs = self._validate_rhs(rhs) - self.params = params - - def _validate_rhs(self, rhs): - """Validate the rhs attribute.""" - if not isinstance(rhs, dict): - mesg = "Attribute `rhs` must be of type `dict` not {}" - raise AttributeError(mesg.format(rhs.__class__)) - elif not (len(rhs) == len(self.dependent_vars)): - mesg = "Number of equations must equal number of dependent vars." - raise ValueError(mesg) - else: - return rhs - - @staticmethod - def _validate_variable(symbol): - """Validate the independent_var attribute.""" - if not isinstance(symbol, str): - mesg = "Attribute must be of type `string` not {}" - raise AttributeError(mesg.format(symbol.__class__)) - else: - return symbol - - @classmethod - def _validate_variables(cls, symbols): - """Validate the dependent_vars attribute.""" - return [cls._validate_variable(symbol) for symbol in symbols] - - -class SymbolicDifferentialEquation(DifferentialEquation, - symbolics.SymbolicModelLike): - - _cached_rhs_functions = {} # not sure if this is good practice! - - def _rhs_functions(self, var): - """Cache lamdified rhs functions for numerical evaluation.""" - if self._cached_rhs_functions.get(var) is None: - eqn = self.rhs[var] - self._cached_rhs_functions[var] = self._lambdify_factory(eqn) - return self._cached_rhs_functions[var] - - @staticmethod - def _validate_expression(expression): - """Validates a symbolic expression.""" - if not isinstance(expression, sym.Basic): - mesg = "Attribute must be of type `sympy.Basic` not {}" - raise AttributeError(mesg.format(expression.__class__)) - else: - return expression - - def _validate_rhs(self, rhs): - """Validate a the rhs attribute.""" - super(SymbolicDifferentialEquation, self)._validate_rhs(rhs) - exprs = {} - for var, expr in rhs.items(): - exprs[var] = self._validate_expression(expr) - else: - return exprs diff --git a/pycollocation/models.py b/pycollocation/models.py index 1c47c73..84f16a5 100644 --- a/pycollocation/models.py +++ b/pycollocation/models.py @@ -1,5 +1,15 @@ +""" +Classes for representing differential and difference equations. + +@author : David R. Pugh + +""" import collections +import sympy as sym + +import symbolics + class ModelLike(object): @@ -9,28 +19,40 @@ def dependent_vars(self): Model dependent variables. :getter: Return the model dependent variables. + :setter: Set new model dependent variables. :type: list """ return self._dependent_vars + @dependent_vars.setter + def dependent_vars(self, variables): + """Set new model dependent variables.""" + self._dependent_vars = self._validate_variables(variables) + @property def independent_var(self): """ - Symbolic variable representing the independent variable. + Model independent variable. - :getter: Return the symbol representing the independent variable. - :type: sympy.Symbol + :getter: Return the model independent variable. + :setter: Set new model independent variable. + :type: string """ return self._independent_var + @independent_var.setter + def independent_var(self, variable): + """Set new model independent variable.""" + self._independent_var = self._validate_variable(variable) + @property def params(self): """ Dictionary of model parameters. - :getter: Return the current parameter dictionary. + :getter: Return the model parameters as an ordered dictionary. :setter: Set a new parameter dictionary. :type: dict @@ -46,15 +68,20 @@ def params(self, value): @property def rhs(self): """ - Symbolic representation of the right-hand side of a system of - differential/difference equations. + Right-hand side of the system of differential/difference equations. :getter: Return the right-hand side of the system of equations. + :setter: Set new value for the right-hand side of the system of equations. :type: dict """ return self._rhs + @rhs.setter + def rhs(self, rhs): + """Set new value for the right-hand side of the system of equations.""" + self._rhs = self._validate_rhs(rhs) + @staticmethod def _order_params(params): """Cast a dictionary to an order dictionary.""" @@ -68,3 +95,92 @@ def _validate_params(value): raise AttributeError(mesg.format(value.__class__)) else: return value + + def _validate_rhs(self, rhs): + """Validate the rhs attribute.""" + if not isinstance(rhs, dict): + mesg = "Attribute `rhs` must be of type `dict` not {}" + raise AttributeError(mesg.format(rhs.__class__)) + elif not (len(rhs) == len(self.dependent_vars)): + mesg = "Number of equations must equal number of dependent vars." + raise ValueError(mesg) + else: + return rhs + + @staticmethod + def _validate_variable(symbol): + """Validate the independent_var attribute.""" + if not isinstance(symbol, str): + mesg = "Attribute must be of type `string` not {}" + raise AttributeError(mesg.format(symbol.__class__)) + else: + return symbol + + @classmethod + def _validate_variables(cls, symbols): + """Validate the dependent_vars attribute.""" + return [cls._validate_variable(symbol) for symbol in symbols] + + +class SymbolicModelLike(symbolics.SymbolicLike, ModelLike): + + _cached_rhs_functions = {} # not sure if this is good practice! + + __symbolic_jacobian = None + + @property + def _symbolic_args(self): + """List of symbolic arguments used to lambdify expressions.""" + return self._symbolic_vars + self._symbolic_params.values() + + @property + def _symbolic_jacobian(self): + """Symbolic Jacobian matrix of partial derivatives.""" + if self.__symbolic_jacobian is None: + args = self.dependent_vars + self.__symbolic_jacobian = self._symbolic_system.jacobian(args) + return self.__symbolic_jacobian + + @property + def _symbolic_params(self): + """List of symbolic model parameters.""" + return collections.OrderedDict((k, sym.symbols(k)) for (k, v) in self.params.items()) + + @property + def _symbolic_system(self): + """Represents rhs as a symbolic matrix.""" + return sym.Matrix([self.rhs[var] for var in self.dependent_vars]) + + @property + def _symbolic_vars(self): + """List of symbolic model variables.""" + return sym.symbols([self.independent_var] + self.dependent_vars) + + def _clear_cache(self): + """Clear cached symbolic Jacobian.""" + self.__symbolic_jacobian = None + + def _rhs_functions(self, var): + """Cache lamdified rhs functions for numerical evaluation.""" + if self._cached_rhs_functions.get(var) is None: + eqn = self.rhs[var] + self._cached_rhs_functions[var] = self._lambdify_factory(eqn) + return self._cached_rhs_functions[var] + + @staticmethod + def _validate_expression(expression): + """Validates a symbolic expression.""" + if not isinstance(expression, sym.Basic): + mesg = "Attribute must be of type `sympy.Basic` not {}" + raise AttributeError(mesg.format(expression.__class__)) + else: + return expression + + def _validate_rhs(self, rhs): + """Validate a the rhs attribute.""" + super(SymbolicModelLike, self)._validate_rhs(rhs) + exprs = {} + for var, expr in rhs.items(): + exprs[var] = self._validate_expression(expr) + else: + return exprs diff --git a/pycollocation/solvers.py b/pycollocation/solvers.py index a441a9b..8a1b15b 100644 --- a/pycollocation/solvers.py +++ b/pycollocation/solvers.py @@ -1,6 +1,6 @@ import numpy as np -from . import boundary_value_problems +from . import bvp class Solver(object): @@ -193,7 +193,7 @@ def residual_function(t): @staticmethod def _validate_model(model): """Validate the dictionary of parameters.""" - if not isinstance(model, boundary_value_problems.BoundaryValueProblem): + if not issubclass(model.__class__, bvp.TwoPointBVPLike): mesg = "Attribute 'model' must have type BoundaryValueProblem, not {}" raise AttributeError(mesg.format(model.__class__)) else: diff --git a/pycollocation/symbolics.py b/pycollocation/symbolics.py index 3af634d..3c8daa7 100644 --- a/pycollocation/symbolics.py +++ b/pycollocation/symbolics.py @@ -1,101 +1,27 @@ """ Classes for constructing symbolic models. -@author : davidrpugh +@author : David R. Pugh """ import numpy as np import sympy as sym -class SymbolicBase(object): +class SymbolicLike(object): _modules = [{'ImmutableMatrix': np.array}, 'numpy'] @property def _symbolic_args(self): """List of symbolic arguments used to lambdify expressions.""" - raise NotImplementedError + return self.__symbolic_args + + @_symbolic_args.setter + def _symbolic_args(self, args): + """Set new values for the symbolic arguments.""" + self.__symbolic_args = args def _lambdify_factory(self, expr): """Lambdify a symbolic expression.""" return sym.lambdify(self._symbolic_args, expr, self._modules) - - -class SymbolicModelLike(SymbolicBase): - - __symbolic_jacobian = None - - @property - def _symbolic_args(self): - """List of symbolic arguments used to lambdify expressions.""" - return self._symbolic_vars + self._symbolic_params - - @property - def _symbolic_jacobian(self): - """Symbolic Jacobian matrix of partial derivatives.""" - if self.__symbolic_jacobian is None: - args = self.dependent_vars - self.__symbolic_jacobian = self._symbolic_system.jacobian(args) - return self.__symbolic_jacobian - - @property - def _symbolic_params(self): - """List of symbolic model parameters.""" - return sym.var(list(self.params.keys())) - - @property - def _symbolic_system(self): - """Represents rhs as a symbolic matrix.""" - return sym.Matrix([self.rhs[var] for var in self.dependent_vars]) - - @property - def _symbolic_vars(self): - """List of symbolic model variables.""" - return sym.var([self.independent_var] + self.dependent_vars) - - def _clear_cache(self): - """Clear cached symbolic Jacobian.""" - self.__symbolic_jacobian = None - - -class SymbolicBoundaryValueProblemLike(SymbolicModelLike): - - __lower_boundary_condition = None - - __upper_boundary_condition = None - - @property - def _lower_boundary_condition(self): - """Cache lambdified lower boundary condition for numerical evaluation.""" - condition = self.boundary_conditions['lower'] - if condition is not None: - if self.__lower_boundary_condition is None: - self.__lower_boundary_condition = self._lambdify_factory(condition) - return self.__lower_boundary_condition - else: - return None - - @property - def _upper_boundary_condition(self): - """Cache lambdified upper boundary condition for numerical evaluation.""" - condition = self.boundary_conditions['upper'] - if condition is not None: - if self.__upper_boundary_condition is None: - self.__upper_boundary_condition = self._lambdify_factory(condition) - return self.__upper_boundary_condition - else: - return None - - def _validate_boundary(self, conditions): - """Validate a dictionary of lower and upper boundary conditions.""" - bcs = {'lower': self._validate_boundary_exprs(conditions['lower']), - 'upper': self._validate_boundary_exprs(conditions['upper'])} - return bcs - - def _validate_boundary_exprs(self, expressions): - """Check that lower/upper boundary_conditions are expressions.""" - if expressions is None: - return None - else: - return [self._validate_expression(expr) for expr in expressions] diff --git a/pycollocation/tests/test_polynomial_collocation.py b/pycollocation/tests/test_polynomial_collocation.py index 307b54d..60444b5 100644 --- a/pycollocation/tests/test_polynomial_collocation.py +++ b/pycollocation/tests/test_polynomial_collocation.py @@ -3,7 +3,7 @@ import numpy as np import sympy as sym -from .. boundary_value_problems import SymbolicBoundaryValueProblem +from .. bvp import SymbolicTwoPointBVP from .. orthogonal_polynomials import OrthogonalPolynomialSolver from .. import visualizers @@ -60,11 +60,11 @@ def setUp(self): bcs = {'lower': [k - self.k0], 'upper': None} # set the model instance - self.model = SymbolicBoundaryValueProblem(dependent_vars=['k'], - independent_var='t', - rhs=rhs, - boundary_conditions=bcs, - params=self.params) + self.model = SymbolicTwoPointBVP(boundary_conditions=bcs, + dependent_vars=['k'], + independent_var='t', + params=self.params, + rhs=rhs) # set the solver instance self.solver = OrthogonalPolynomialSolver(self.model) diff --git a/pycollocation/tests/test_symbolics.py b/pycollocation/tests/test_symbolics.py deleted file mode 100644 index cf34ff1..0000000 --- a/pycollocation/tests/test_symbolics.py +++ /dev/null @@ -1,10 +0,0 @@ -import nose - -from .. import symbolics - - -def test_symbolic_base(): - """SymbolicsBase._symbolic_args attribute is not implemented.""" - with nose.tools.assert_raises(NotImplementedError): - base = symbolics.SymbolicBase() - base._symbolic_args From 391d639a90d7ba1547d671273c53fecf0f188b4d Mon Sep 17 00:00:00 2001 From: "David R. Pugh" Date: Mon, 13 Jul 2015 13:53:28 +0100 Subject: [PATCH 2/8] Updated version number. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1447840..8e4ad94 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ def read(*paths): setup( name="pycollocation", packages=['pycollocation'], - version='0.3.0-alpha', + version='0.4.0-alpha', description=DESCRIPTION, long_description=read('README.rst'), license="MIT License", From b3f9c5b76acdaa7edc37c516a2fd62bda2100543 Mon Sep 17 00:00:00 2001 From: "David R. Pugh" Date: Mon, 13 Jul 2015 17:01:04 +0100 Subject: [PATCH 3/8] Added and equilibrium object for computing fixed points. --- pycollocation/bvp.py | 14 +++++++- pycollocation/equilibria.py | 72 +++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 pycollocation/equilibria.py diff --git a/pycollocation/bvp.py b/pycollocation/bvp.py index 62e9bcd..fb6f1e9 100644 --- a/pycollocation/bvp.py +++ b/pycollocation/bvp.py @@ -4,6 +4,7 @@ @author : David R. Pugh """ +import equilibria import models @@ -56,6 +57,17 @@ class SymbolicTwoPointBVPLike(TwoPointBVPLike, models.SymbolicModelLike): __upper_boundary_condition = None + @property + def equilibrium(self): + """ + Object representing the model equilibrium. + + :getter: Return the current object. + :type: equilibria.Equilibrium + + """ + return equilibria.Equilibrium(self) + @property def _lower_boundary_condition(self): """Cache lambdified lower boundary condition for numerical evaluation.""" @@ -124,7 +136,7 @@ class TwoPointBVP(TwoPointBVPLike): def __init__(self, boundary_conditions, dependent_vars, independent_var, params, rhs): """Create an instance of a two-point boundary value problem (BVP).""" self.boundary_conditions = boundary_conditions - self.dependent = dependent_vars + self.dependent_vars = dependent_vars self.independent_var = independent_var self.params = params self.rhs = rhs diff --git a/pycollocation/equilibria.py b/pycollocation/equilibria.py new file mode 100644 index 0000000..760a03a --- /dev/null +++ b/pycollocation/equilibria.py @@ -0,0 +1,72 @@ +""" +Classes for finding fixed point equilibria of a system of difference or +differential equations. + +@author : David R. Pugh + +""" +import numpy as np +from scipy import optimize + + +class Equilibrium(object): + """ + Class for computing fixed-point equilibria for a system of difference or + differential equations. + + """ + + def __init__(self, problem): + """ + Create an instance of the Equilbrium class. + + Parameters + ---------- + + problem : bvp.SymbolicTwoPointBVPLike + + @TODO : Need to extend this class so that it will work with arbitrary + bvp.TwoPointBVPLike object. + + """ + self.problem = problem + + def _equilibrium_system(self, X, t): + """ + System of equations representing the right-hand side of a system of + difference or differential equations. + + """ + args = np.hstack((np.array([t]), X, np.array(self.problem.params.values()))) + residuals = [self.problem._rhs_functions(var)(*args) for var in self.problem.dependent_vars] + return np.array(residuals) + + def find_equilibrium(self, initial_guess, method='hybr', **solver_opts): + """ + Compute the steady state values of capital and consumption + (per unit effective labor). + + Parameters + ---------- + initial_guess : np.ndarray + Array of values representing the initial guess for an equilibrium. + method : string (default='hybr') + Method used to solve the system of non-linear equations. See + `scipy.optimize.root` for more details. + solver_opts : dictionary + Dictionary of optional keyword arguments to pass to the non-linear + equation solver. See `scipy.optimize.root` for details. + + Returns + ------- + result : scipy.optimze.Result + Object representing the result of the non-linear equation solver. + See `scipy.optimize.root` for details. + + """ + result = optimize.root(self._equilibrium_system, + x0=initial_guess, + args=(0.0,), # independent var irrevelant at equilibrium? + method=method, + **solver_opts) + return result From 9cef87e1caee1dc7e68d6d19bf52bb5d077d1868 Mon Sep 17 00:00:00 2001 From: "David R. Pugh" Date: Mon, 13 Jul 2015 17:09:23 +0100 Subject: [PATCH 4/8] Added codacy badge to readme. --- README.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 3d76d13..5253600 100644 --- a/README.rst +++ b/README.rst @@ -1,12 +1,14 @@ pyCollocation ============= -|Build Status| |Coverage Status| |Latest Version| |Downloads| |DOI| +|Build Status| |Coverage Status| |Codacy Badge| |Latest Version| |Downloads| |DOI| .. |Build Status| image:: https://travis-ci.org/davidrpugh/pyCollocation.svg?branch=master :target: https://travis-ci.org/davidrpugh/pyCollocation .. |Coverage Status| image:: https://coveralls.io/repos/davidrpugh/pyCollocation/badge.svg?branch=master :target: https://coveralls.io/r/davidrpugh/pyCollocation?branch=master +.. |Codacy Badge| image:: https://www.codacy.com/project/badge/4838082c243c48afa392aabc7cce54ab + :target: https://www.codacy.com/app/drobert-pugh/pyCollocation .. |Latest Version| image:: https://img.shields.io/pypi/v/pyCollocation.svg :target: https://pypi.python.org/pypi/pyCollocation/ .. |Downloads| image:: https://img.shields.io/pypi/dm/pyCollocation.svg From ca59e72b4d586971085b090507306fe58597c291 Mon Sep 17 00:00:00 2001 From: "David R. Pugh" Date: Mon, 13 Jul 2015 17:25:02 +0100 Subject: [PATCH 5/8] Added scrutinzer badge to README. --- README.rst | 2 ++ pycollocation/__init__.py | 1 + 2 files changed, 3 insertions(+) diff --git a/README.rst b/README.rst index 5253600..025e8c3 100644 --- a/README.rst +++ b/README.rst @@ -9,6 +9,8 @@ pyCollocation :target: https://coveralls.io/r/davidrpugh/pyCollocation?branch=master .. |Codacy Badge| image:: https://www.codacy.com/project/badge/4838082c243c48afa392aabc7cce54ab :target: https://www.codacy.com/app/drobert-pugh/pyCollocation +.. |Scrutinizer Code Quality| image:: https://scrutinizer-ci.com/g/davidrpugh/pyCollocation/badges/quality-score.png?b=master + :target: https://scrutinizer-ci.com/g/davidrpugh/pyCollocation/?branch=master .. |Latest Version| image:: https://img.shields.io/pypi/v/pyCollocation.svg :target: https://pypi.python.org/pypi/pyCollocation/ .. |Downloads| image:: https://img.shields.io/pypi/dm/pyCollocation.svg diff --git a/pycollocation/__init__.py b/pycollocation/__init__.py index 324aa50..a1e05d0 100644 --- a/pycollocation/__init__.py +++ b/pycollocation/__init__.py @@ -6,6 +6,7 @@ "SymbolicTwoPointBVP", "OrthogonalPolynomialSolver", "Visualizer"] from . import bvp +from . import equilibria from . import models from . import orthogonal_polynomials from . import visualizers From bb3327612b5a8ced9bfa90f39386248f662d1865 Mon Sep 17 00:00:00 2001 From: "David R. Pugh" Date: Mon, 13 Jul 2015 17:29:17 +0100 Subject: [PATCH 6/8] Added sudo:false to travis.yml --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bfcd2b5..b661e61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,7 @@ +sudo: false + language: python + python: - 2.7 - 3.3 @@ -28,4 +31,4 @@ script: - nosetests --with-coverage --cover-package=pycollocation after_success: - - coveralls \ No newline at end of file + - coveralls From d749c9dc2a2fd6cf2f9b364580989f2023345445 Mon Sep 17 00:00:00 2001 From: "David R. Pugh" Date: Mon, 13 Jul 2015 17:33:26 +0100 Subject: [PATCH 7/8] Actually need sudo! --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b661e61..ee3b09c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,3 @@ -sudo: false - language: python python: From 637af3fc23aeaedbaad1408bbe044ad79ebd3e83 Mon Sep 17 00:00:00 2001 From: "David R. Pugh" Date: Mon, 13 Jul 2015 17:38:53 +0100 Subject: [PATCH 8/8] Trying to fix python3 import error. --- pycollocation/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pycollocation/__init__.py b/pycollocation/__init__.py index a1e05d0..d8852c5 100644 --- a/pycollocation/__init__.py +++ b/pycollocation/__init__.py @@ -5,8 +5,8 @@ __all__ = ["TwoPointBVP", "TwoPointBVPLike", "SymbolicTwoPointBVPLike", "SymbolicTwoPointBVP", "OrthogonalPolynomialSolver", "Visualizer"] -from . import bvp from . import equilibria +from . import bvp from . import models from . import orthogonal_polynomials from . import visualizers