Skip to content

Commit 034dad0

Browse files
committed
Initial skeleton for the traittype repository with naive Array trait type implementation
1 parent ac8a216 commit 034dad0

File tree

12 files changed

+197
-3
lines changed

12 files changed

+197
-3
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,6 @@ docs/_build/
5555

5656
# PyBuilder
5757
target/
58+
59+
# OS X
60+
.DS_Store

.travis.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
language: python
2+
python:
3+
- 3.5
4+
- 3.4
5+
- 2.7
6+
- 3.3
7+
sudo: false
8+
install:
9+
- pip install . coveralls
10+
script:
11+
- nosetests --with-coverage --cover-package traittypes traittypes
12+
after_success:
13+
- coveralls

LICENSE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
Copyright (c) 2015,
1+
Copyright (c) IPython Development Team.
2+
23
All rights reserved.
34

45
Redistribution and use in source and binary forms, with or without

MANIFEST.in

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
CONTRIBUTING.md
2+
README.md
3+
LICENSE
4+
5+
# Documentation
6+
graft docs
7+
exclude docs/\#*
8+
9+
# Examples
10+
graft examples
11+
12+
# docs subdirs we want to skip
13+
prune docs/build
14+
prune docs/gh-pages
15+
prune docs/dist
16+
17+
# Patterns to exclude from any directory
18+
global-exclude *~
19+
global-exclude *.pyc
20+
global-exclude *.pyo
21+
global-exclude .git
22+
global-exclude .ipynb_checkpoints

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
1-
# traittypes
2-
Traitlets types for NumPy, SciPy and friends
1+
# Scipy Trait Types
2+
Trait types for NumPy, SciPy and friends
3+
4+
### Goals
5+
6+
Provide a reference implementation of trait types for common data structures used in the scipy stack such as
7+
- numpy arrays
8+
- pandas / xray data structures
9+
10+
which are out of the scope of the main [traitlets](https://github.com/ipython/traitlets) project but are a common requirement to build applications with traitlets in combination with the scipy stack.
11+
12+
Another goal is to create adequate serialization and deserialization routines for these trait types to be used with the [ipywidgets](https://github.com/ipython/ipywidgets) project (`to_json` and `from_json`). These could also return a list of binary buffers as allowed by the current message protocol.

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[bdist_wheel]
2+
universal=1

setup.py

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#!/usr/bin/env python
2+
# coding: utf-8
3+
4+
# Copyright (c) IPython Development Team.
5+
# Distributed under the terms of the Modified BSD License.
6+
7+
from __future__ import print_function
8+
9+
# the name of the project
10+
name = 'traittypes'
11+
12+
#-----------------------------------------------------------------------------
13+
# Minimal Python version sanity check
14+
#-----------------------------------------------------------------------------
15+
16+
import sys
17+
18+
v = sys.version_info
19+
if v[:2] < (2,7) or (v[0] >= 3 and v[:2] < (3,3)):
20+
error = "ERROR: %s requires Python version 2.7 or 3.3 or above." % name
21+
print(error, file=sys.stderr)
22+
sys.exit(1)
23+
24+
PY3 = (sys.version_info[0] >= 3)
25+
26+
#-----------------------------------------------------------------------------
27+
# get on with it
28+
#-----------------------------------------------------------------------------
29+
30+
import os
31+
from glob import glob
32+
33+
from distutils.core import setup
34+
35+
pjoin = os.path.join
36+
here = os.path.abspath(os.path.dirname(__file__))
37+
pkg_root = pjoin(here, name)
38+
39+
packages = []
40+
for d, _, _ in os.walk(pjoin(here, name)):
41+
if os.path.exists(pjoin(d, '__init__.py')):
42+
packages.append(d[len(here)+1:].replace(os.path.sep, '.'))
43+
44+
version_ns = {}
45+
with open(pjoin(here, name, '_version.py')) as f:
46+
exec(f.read(), {}, version_ns)
47+
48+
49+
setup_args = dict(
50+
name = name,
51+
version = version_ns['__version__'],
52+
scripts = glob(pjoin('scripts', '*')),
53+
packages = packages,
54+
description = "Scipy trait types",
55+
long_description= "Custom trait types for scientific computing.",
56+
author = 'IPython Development Team',
57+
author_email = '[email protected]',
58+
url = 'http://ipython.org',
59+
license = 'BSD',
60+
platforms = "Linux, Mac OS X, Windows",
61+
keywords = ['Interactive', 'Interpreter', 'Shell', 'Web'],
62+
classifiers = [
63+
'Intended Audience :: Developers',
64+
'Intended Audience :: System Administrators',
65+
'Intended Audience :: Science/Research',
66+
'License :: OSI Approved :: BSD License',
67+
'Programming Language :: Python',
68+
'Programming Language :: Python :: 2.7',
69+
'Programming Language :: Python :: 3',
70+
'Programming Language :: Python :: 3.3',
71+
],
72+
)
73+
74+
if 'develop' in sys.argv or any(a.startswith('bdist') for a in sys.argv):
75+
import setuptools
76+
77+
setuptools_args = {}
78+
79+
install_requires = setuptools_args['install_requires'] = [
80+
'traitlets'
81+
]
82+
83+
extras_require = setuptools_args['extras_require'] = {
84+
}
85+
86+
if 'setuptools' in sys.modules:
87+
setup_args.update(setuptools_args)
88+
89+
if __name__ == '__main__':
90+
setup(**setup_args)

traittypes/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from .traittypes import *
2+
from ._version import version_info, __version__

traittypes/_version.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
version_info = (0, 1, 0, 'dev')
2+
__version__ = '.'.join(map(str, version_info))

traittypes/tests/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)