diff --git a/.gitignore b/.gitignore index 85dc3ec..7231c38 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.pyc __pycache__/ -build/ \ No newline at end of file +build/ +*.egg-info diff --git a/setup.py b/setup.py index 82252a3..1c81850 100644 --- a/setup.py +++ b/setup.py @@ -25,5 +25,6 @@ license='LGPL', url='http://seis.bris.ac.uk/~enxjn/xppy', platforms='All-platforms', - packages=['xppy','xppy.parser','xppy.utils'] + packages=['xppy','xppy.parser','xppy.utils'], + install_requires=['numpy', 'matplotlib'], ) diff --git a/xppy/parser/__init__.py b/xppy/parser/__init__.py index 6d46082..c65a043 100644 --- a/xppy/parser/__init__.py +++ b/xppy/parser/__init__.py @@ -1,4 +1,4 @@ -from parse import * -from run import * +from .parse import * +from .run import * #__all__ = ['ode', 'set', 'run'] diff --git a/xppy/parser/parse.py b/xppy/parser/parse.py index ac0f3dc..389853a 100644 --- a/xppy/parser/parse.py +++ b/xppy/parser/parse.py @@ -26,6 +26,8 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ''' +from __future__ import print_function +from __future__ import absolute_import import os import numpy as np @@ -38,7 +40,7 @@ def change_ode(ode_file=tmp_ode, new_pars=[]): Function changes the parameters and initial conditions specified in new_pars in given ode_file. ''' - print 'Warning! Function is obsolete, use changeOde instead!' + print('Warning! Function is obsolete, use changeOde instead!') changeOde(new_pars, ode_file) def changeOde(new_pars, ode_file=tmp_ode): @@ -177,7 +179,7 @@ def change_set(set_file, new_pars): Function changes the parameters and initial conditions specified in new_pars in given ode_file. ''' - print 'Warning! Function is obsolete, use changeSet instead!' + print('Warning! Function is obsolete, use changeSet instead!') changeSet(new_pars, set_file) def changeSet(new_pars, set_file=tmp_set): diff --git a/xppy/parser/run.py b/xppy/parser/run.py index 355eba5..daabfcc 100644 --- a/xppy/parser/run.py +++ b/xppy/parser/run.py @@ -26,6 +26,9 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ''' +from __future__ import print_function +from __future__ import absolute_import + import os import shutil from xppy.parser import parse @@ -39,7 +42,7 @@ def set_cmd(xpp_path): global c_g c_g = os.path.join(xpp_path, c_g) - print "XPP Path set: %s" % (c_g,) + print("XPP Path set: %s" % (c_g,)) return c_g def run(ode_file=tmp_ode, set_file=tmp_set, verbose=False): @@ -94,7 +97,7 @@ def createTmp(ode_file=None, set_file=None): if set_file != None: shutil.copy(set_file, tmp_set) if ode_file == None and set_file == None: - print 'Warning! No files where created, both ode and set arguments are None.' + print('Warning! No files where created, both ode and set arguments are None.') def deleteTmp(del_ode=True, del_set=True): ''' diff --git a/xppy/utils/allutils.py b/xppy/utils/allutils.py index dcf3193..657756d 100644 --- a/xppy/utils/allutils.py +++ b/xppy/utils/allutils.py @@ -26,8 +26,8 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ''' -from allinfo import * -from data import * -from diagram import * -from solution import * -from output import * +from .allinfo import * +from .data import * +from .diagram import * +from .solution import * +from .output import * diff --git a/xppy/utils/plot.py b/xppy/utils/plot.py index 18c26dd..c093577 100644 --- a/xppy/utils/plot.py +++ b/xppy/utils/plot.py @@ -26,6 +26,9 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ''' +from __future__ import print_function +from __future__ import absolute_import + import numpy as np #@UnresolvedImport from xppy.utils import allinfo import matplotlib.pyplot as pl #@UnresolvedImport diff --git a/xppy/utils/solution.py b/xppy/utils/solution.py index 775d307..9faf454 100644 --- a/xppy/utils/solution.py +++ b/xppy/utils/solution.py @@ -26,7 +26,7 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ''' - +from __future__ import print_function import numpy as np #@UnresolvedImport ####