Преглед на файлове

Merge branch 'release/v1.2'

Snow преди 8 години
родител
ревизия
2ea958e9eb
променени са 5 файла, в които са добавени 130 реда и са изтрити 13 реда
  1. 85 0
      .gitignore
  2. 27 1
      README.md
  3. 8 0
      hdpg1d/cmd.py
  4. 1 1
      hdpg1d/solve.py
  5. 9 11
      setup.py

+ 85 - 0
.gitignore

@@ -1 +1,86 @@
+# Byte-compiled / optimized / DLL files
 __pycache__/
+*.py[cod]
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+env/
+bin/
+build/
+develop-eggs/
+dist/
+eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+*.egg-info/
+.installed.cfg
+*.egg
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.cache
+nosetests.xml
+coverage.xml
+
+# Translations
+*.mo
+
+# Mr Developer
+.mr.developer.cfg
+.project
+.pydevproject
+
+# Rope
+.ropeproject
+
+# Django stuff:
+*.log
+*.pot
+
+# Sphinx documentation
+docs/_build/
+
+# ctags
+tags
+
+src/.idea/*
+.idea/*
+
+# ignore mac file
+.DS_Store
+src/.DS_Store
+
+# ignore demo
+out.gif
+
+# ignore swp files
+NEMbox/*.swp
+
+# ignore TEST files
+TEST
+
+# virtualenv
+venv
+
+# org mode
+.org
+
+# temporary file
+.\#*
+\#*
+
+# Org-mode
+.org-id-locations
+*_archive

+ 27 - 1
README.md

@@ -1 +1,27 @@
-# Test
+<div id="table-of-contents">
+<h2>Table of Contents</h2>
+<div id="text-table-of-contents">
+<ul>
+<li><a href="#sec-1">1. HDPG1D</a></li>
+<li><a href="#sec-2">2. Install</a></li>
+<li><a href="#sec-3">3. Usage</a></li>
+</ul>
+</div>
+</div>
+
+# HDPG1D<a id="sec-1" name="sec-1"></a>
+
+This is a python package that solves 1-Dimensional PDEs using hybridizable discontinuous Petrov-Galerkin discretization, a novel FEA discretization that ensures the best solution quality without extra stablization mechanism. The following image shows the solution of 1D inviscid Burger's equation using HDPG discretization. Notice that the oscillations near the shock are well controlled even without any artificial stablization mechanism.
+<a href="http://imgur.com/HrWIi4s"><img src="http://i.imgur.com/HrWIi4s.png" width="50%" height="50%" title="source: imgur.com" /></a>
+
+# Install<a id="sec-2" name="sec-2"></a>
+In terminal: 
+```bash
+pip install hdpg1d
+```
+
+# Usage<a id="sec-3" name="sec-3"></a>
+In terminal, call:
+```bash
+PGsolve
+```

+ 8 - 0
hdpg1d/cmd.py

@@ -0,0 +1,8 @@
+"""
+command line interface
+"""
+from .solve import run
+
+
+def main():
+    run()

+ 1 - 1
hdpg1d/solve.py

@@ -47,7 +47,7 @@ def run():
     for key, value in sorted(menu.items()):
         print(key, value)
 
-    selection = input("Please Select:")
+    selection = input("Please Select: ")
     if selection == '1':
         hdgCoeff = getCoefficients()
         hdgSolution = HDPG1d(hdgCoeff.nele, hdgCoeff.porder)

+ 9 - 11
setup.py

@@ -1,27 +1,25 @@
 #!/usr/bin/env python
 
-from distutils.core import setup
-import codecs
+from setuptools import setup, find_packages
 import os
 
-here = os.path.abspath(os.path.dirname(__file__))
+# here = os.path.abspath(os.path.dirname(__file__))
 
 
-# def read(*parts):
-#     # intentionally *not* adding an encoding option to open
-#     return codecs.open(os.path.join(here, *parts), 'r').read()
-
-# long_description = read('README.rst')
-
 setup(name='hdpg1d',
-      version='1.1.1',
+      version='1.2',
       description='An 1D finite element solver using hybridizable discontinuous\
       Petrov-Galerkin method',
       author='Keyi Ni',
       author_email='[email protected]',
       url='test',
       license='MIT',
-      packages=['hdpg1d'],
+      packages=find_packages(),
+      entry_points={
+          'console_scripts': [
+              'PGsolve = hdpg1d.cmd:main'
+          ],
+      },
       requires=[
           'numpy',
           'matplotlib',