From 8e0aad8633ea3484a5a679fef6d04f7249f1400a Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Tue, 20 Sep 2016 17:28:55 +0800 Subject: Setup package structures Credit: https://github.com/kennethreitz/samplemod TODO: Add the 'docs' part --- Makefile | 10 ++++++++++ fg21sim/__init__.py | 1 + fg21sim/core.py | 9 +++++++++ fg21sim/helpers.py | 0 requirements.txt | 2 ++ setup.py | 23 +++++++++++++++++++++++ tests/__init__.py | 0 tests/context.py | 8 ++++++++ tests/test_advanced.py | 16 ++++++++++++++++ tests/test_basic.py | 16 ++++++++++++++++ 10 files changed, 85 insertions(+) create mode 100644 Makefile create mode 100644 fg21sim/__init__.py create mode 100644 fg21sim/core.py create mode 100644 fg21sim/helpers.py create mode 100644 requirements.txt create mode 100755 setup.py create mode 100644 tests/__init__.py create mode 100644 tests/context.py create mode 100644 tests/test_advanced.py create mode 100644 tests/test_basic.py diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..23ecffa --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +# Makefile for "fg21sim" +# +# 2016-09-20 +# + +init: + pip3 install --user -r requirements.txt + +test: + nosetests tests diff --git a/fg21sim/__init__.py b/fg21sim/__init__.py new file mode 100644 index 0000000..f4633fa --- /dev/null +++ b/fg21sim/__init__.py @@ -0,0 +1 @@ +from .core import hmm \ No newline at end of file diff --git a/fg21sim/core.py b/fg21sim/core.py new file mode 100644 index 0000000..2cea5dc --- /dev/null +++ b/fg21sim/core.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- + +def get_hmm(): + """Get a thought.""" + return 'hmmm...' + +def hmm(): + """Contemplation...""" + print get_hmm() \ No newline at end of file diff --git a/fg21sim/helpers.py b/fg21sim/helpers.py new file mode 100644 index 0000000..e69de29 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..b118ad0 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +nose +sphinx diff --git a/setup.py b/setup.py new file mode 100755 index 0000000..dc40675 --- /dev/null +++ b/setup.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +from setuptools import setup, find_packages + + +with open('README.rst') as f: + readme = f.read() + +with open('LICENSE') as f: + license = f.read() + +setup( + name='fg21sim', + version='0.0.1', + description='Realistic Foregrounds Simulation for EoR 21cm Signal Detection', + long_description=readme, + author='Weitian LI', + author_email='liweitianux@live.com', + url='https://github.com/liweitianux/fg21sim', + license=license, + packages=find_packages(exclude=('tests', 'docs')) +) diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/context.py b/tests/context.py new file mode 100644 index 0000000..352a47b --- /dev/null +++ b/tests/context.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- + +import sys +import os + +sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) + +import fg21sim diff --git a/tests/test_advanced.py b/tests/test_advanced.py new file mode 100644 index 0000000..1ae151c --- /dev/null +++ b/tests/test_advanced.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- + +from .context import fg21sim + +import unittest + + +class AdvancedTestSuite(unittest.TestCase): + """Advanced test cases.""" + + def test_thoughts(self): + sample.hmm() + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/test_basic.py b/tests/test_basic.py new file mode 100644 index 0000000..ea50cf3 --- /dev/null +++ b/tests/test_basic.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- + +from .context import fg21sim + +import unittest + + +class BasicTestSuite(unittest.TestCase): + """Basic test cases.""" + + def test_absolute_truth_and_meaning(self): + assert True + + +if __name__ == '__main__': + unittest.main() -- cgit v1.2.2