Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
language: python
python:
- '2.7'
- '3.6'
#- '3.7-dev'
- '3.7-dev'

git:
depth: 200
Expand All @@ -14,9 +13,9 @@ before_install:
- gcc --version
- export START=$(pwd)
install:
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh
-O miniconda.sh; export VADD="py27"; else wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
-O miniconda.sh; export VADD="py36"; fi
- if [[ "$TRAVIS_PYTHON_VERSION" == "3.7-dev" ]]; then export VADD="py37"; else export VADD="py36"; fi
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
-O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,14 @@ Do you want to use **tofu** on IMAS and don't know where to start? [See our wiki
Install dependencies


python (2.7 or 3)
python (>= 3)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not >=3.5 ? or >= 3.6?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right !

numpy
scipy
matplotlib
cython >= 0.26
nose
pygments
pandas
polygon3 (or polygon2 if you are using python 2.7)


Checkout the tofu git repository and from the top directory
Expand Down
2 changes: 0 additions & 2 deletions conda_recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ requirements:
- cython >=0.26
- nose
- pygments
- funcsigs # [py27]


# for running the library
Expand All @@ -43,7 +42,6 @@ requirements:
- cython >=0.26
- nose
- pygments
- funcsigs # [py27]

test:
requires:
Expand Down
49 changes: 9 additions & 40 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,8 @@ def check_for_openmp(cc_var):
openmp_installed = not check_for_openmp("cc")
print("................ checking if openmp installed... > ", openmp_installed)

# To compile the relevant version
if sys.version[:3] in ["2.7", "3.6", "3.7"]:
gg = "_GG0%s" % sys.version[0]
else:
raise Exception("Pb. with python version in setup.py file: " + sys.version)


if sys.version[0] == "2":
extralib = ["funcsigs"]
else:
extralib = []
# ==============================================================================


Expand All @@ -176,30 +167,19 @@ def get_version_tofu(path=_HERE):
isgit = ".git" in os.listdir(path)
if isgit:
try:
if sys.version[0] == "2":
git_branch = subprocess.check_output(
git_branch = (
subprocess.check_output(
[
"git",
"rev-parse",
"--symbolic-full-name",
"--abbrev-ref",
"HEAD",
]
).rstrip()
elif sys.version[0] == "3":
git_branch = (
subprocess.check_output(
[
"git",
"rev-parse",
"--symbolic-full-name",
"--abbrev-ref",
"HEAD",
]
)
.rstrip()
.decode()
)
.rstrip()
.decode()
)
if git_branch in ["master"]:
version_tofu = up.updateversion(os.path.join(path, "tofu"))
else:
Expand All @@ -224,14 +204,6 @@ def get_version_tofu(path=_HERE):
print("")


# Getting relevant compilable files
if sys.version[0] == "3":
# if not '_GG03.pyx' in os.listdir(os.path.join(_HERE,'tofu/geom/')):
shutil.copy2(
os.path.join(_HERE, "tofu/geom/_GG02.pyx"),
os.path.join(_HERE, "tofu/geom/_GG03.pyx"),
)

# Get the long description from the README file
# Get the readme file whatever its extension (md vs rst)
_README = [
Expand Down Expand Up @@ -259,8 +231,8 @@ def get_version_tofu(path=_HERE):

extensions = [
Extension(
name="tofu.geom." + gg,
sources=["tofu/geom/" + gg + ".pyx"],
name="tofu.geom._GG",
sources=["tofu/geom/_GG.pyx"],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
),
Expand Down Expand Up @@ -300,7 +272,6 @@ def get_version_tofu(path=_HERE):

setup(
name="tofu",
# version="1.2.27",
version="{ver}".format(ver=version_tofu),
# Use scm to get code version from git tags
# cf. https://pypi.python.org/pypi/setuptools_scm
Expand Down Expand Up @@ -335,7 +306,6 @@ def get_version_tofu(path=_HERE):
"License :: OSI Approved :: MIT License",
# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
# In which language most of the code is written ?
Expand Down Expand Up @@ -368,9 +338,8 @@ def get_version_tofu(path=_HERE):
# your project is installed. For an analysis of "install_requires" vs pip's
# requirements files see:
# https://packaging.python.org/en/latest/requirements.html
install_requires=["numpy", "scipy", "matplotlib", "cython>=0.26"]
+ extralib,
python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*",
install_requires=["numpy", "scipy", "matplotlib", "cython>=0.26"],
python_requires=">=3.6",
# List additional groups of dependencies here (e.g. development
# dependencies). You can install these using the following syntax,
# for example:
Expand Down
26 changes: 3 additions & 23 deletions tofu/data/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
import copy
import warnings
from abc import ABCMeta, abstractmethod
if sys.version[0] == '3':
import inspect
else:
# Python 2 back-porting
import funcsigs as inspect
import inspect

# Common
import numpy as np
Expand Down Expand Up @@ -173,11 +169,6 @@ def __init__(self, data=None, t=None, X=None, lamb=None,
fromdict=None, SavePath=os.path.abspath('./'),
SavePath_Include=tfpf.defInclude):

# To replace __init_subclass__ for Python 2
if sys.version[0]=='2':
self._dstrip = utils.ToFuObjectBase._dstrip.copy()
self.__class__._strip_init()

# Create a dplot at instance level
#self._dplot = copy.deepcopy(self.__class__._dplot)

Expand Down Expand Up @@ -817,10 +808,7 @@ def _strip_init(cls):
2: dgeom pathfiles + clear data
"""
doc = utils.ToFuObjectBase.strip.__doc__.format(doc,nMax)
if sys.version[0]=='2':
cls.strip.__func__.__doc__ = doc
else:
cls.strip.__doc__ = doc
cls.strip.__doc__ = doc

def strip(self, strip=0, verb=True):
# super()
Expand Down Expand Up @@ -2281,11 +2269,6 @@ def __init__(self, dtime=None, dradius=None, d0d=None, d1d=None,
fromdict=None, SavePath=os.path.abspath('./'),
SavePath_Include=tfpf.defInclude):

# To replace __init_subclass__ for Python 2
if sys.version[0]=='2':
self._dstrip = utils.ToFuObjectBase._dstrip.copy()
self.__class__._strip_init()

# Create a dplot at instance level
#self._dplot = copy.deepcopy(self.__class__._dplot)

Expand Down Expand Up @@ -2839,10 +2822,7 @@ def _strip_init(cls):
1: dgeom pathfiles
"""
doc = utils.ToFuObjectBase.strip.__doc__.format(doc,nMax)
if sys.version[0]=='2':
cls.strip.__func__.__doc__ = doc
else:
cls.strip.__doc__ = doc
cls.strip.__doc__ = doc

def strip(self, strip=0, verb=True):
# super()
Expand Down
16 changes: 2 additions & 14 deletions tofu/data/_core_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
import copy
import warnings
from abc import ABCMeta, abstractmethod
if sys.version[0] == '3':
import inspect
else:
# Python 2 back-porting
import funcsigs as inspect
import inspect

# Common
import numpy as np
Expand Down Expand Up @@ -86,11 +82,6 @@ def __init__(self, dref=None, ddata=None,
fromdict=None, SavePath=os.path.abspath('./'),
SavePath_Include=tfpf.defInclude):

# To replace __init_subclass__ for Python 2
if sys.version[0] == '2':
self._dstrip = utils.ToFuObjectBase._dstrip.copy()
self.__class__._strip_init()

# Create a dplot at instance level
# self._dplot = copy.deepcopy(self.__class__._dplot)

Expand Down Expand Up @@ -495,10 +486,7 @@ def _strip_init(cls):
1: None
"""
doc = utils.ToFuObjectBase.strip.__doc__.format(doc, nMax)
if sys.version[0] == '2':
cls.strip.__func__.__doc__ = doc
else:
cls.strip.__doc__ = doc
cls.strip.__doc__ = doc

def strip(self, strip=0, verb=True):
# super()
Expand Down
17 changes: 0 additions & 17 deletions tofu/geom/_GG.py

This file was deleted.

File renamed without changes.
Loading