diff --git a/.gitignore b/.gitignore index 2fd012a..82f9228 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,7 @@ env/ .ipynb_checkpoints/ .idea/ dist/ -MANIFEST \ No newline at end of file +MANIFEST +build/ +test.py +space_time_astar.egg-info/ diff --git a/setup.py b/setup.py index eed2783..c6057c2 100644 --- a/setup.py +++ b/setup.py @@ -1,21 +1,18 @@ -from distutils.core import setup +import setuptools # read the contents of your README file -from os import path -this_directory = path.abspath(path.dirname(__file__)) -with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: - long_description = f.read() +with open("README.md", "r") as fh: + long_description = fh.read() -setup( +setuptools.setup( name = 'space-time-astar', # How you named your package folder (MyLib) - packages = ['stastar'], # Chose the same as "name" - version = '0.2', # Start with a small number and increase it with every change you make + packages=setuptools.find_packages(), + version = '0.3.4', # Start with a small number and increase it with every change you make license='MIT', # Chose a license from here: https://help.github.com/articles/licensing-a-repository description = 'A* search algorithm with an added time dimension to deal with dynamic obstacles.', # Give a short description about your library author = 'Haoran Peng', # Type in your name author_email = 'gavinsweden@gmail.com', # Type in your E-Mail url = 'https://github.com/GavinPHR/Space-Time-AStar', # Provide either the link to your github or to your website - download_url = 'https://github.com/GavinPHR/Space-Time-AStar/archive/v0.1-alpha.tar.gz', # I explain this later on keywords = ['astar-algorithm', 'obstacle-avoidance', 'time-dimension'], # Keywords that define your package best install_requires=[ # I get to this in a second 'numpy', @@ -26,14 +23,12 @@ 'Intended Audience :: Developers', # Define that your audience are developers 'Topic :: Software Development :: Build Tools', 'License :: OSI Approved :: MIT License', # Again, pick a license - 'Programming Language :: Python :: 3', #Specify which pyhton versions that you want to support - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', ], + python_requires='>=3.5', long_description=long_description, long_description_content_type='text/markdown' ) +# python3 setup.py sdist bdist_wheel +# twine upload dist/* # Tutorial at https://medium.com/@joel.barmettler/how-to-upload-your-python-package-to-pypi-65edc5fe9c56 \ No newline at end of file diff --git a/stastar/__init__.py b/stastar/__init__.py index c7cee50..f11dba8 100644 --- a/stastar/__init__.py +++ b/stastar/__init__.py @@ -1 +1,9 @@ -from space-time-astar.planner import Planner \ No newline at end of file +#!/usr/bin/env python3 +''' +Author: Haoran Peng +Email: gavinsweden@gmail.com +''' +from . import planner +from . import neighbour_table +from . import grid +from . import state \ No newline at end of file diff --git a/stastar/planner.py b/stastar/planner.py index 611aabc..ac5af50 100644 --- a/stastar/planner.py +++ b/stastar/planner.py @@ -8,9 +8,9 @@ import numpy as np from scipy.spatial import KDTree -from neighbour_table import NeighbourTable -from grid import Grid -from state import State +from .neighbour_table import NeighbourTable +from .grid import Grid +from .state import State # static obstacles must include the boundary @@ -120,12 +120,4 @@ def reconstruct_path(self, came_from: Dict[State, State], current: State) -> np. return np.array(total_path[::-1]) -if __name__ == '__main__': - grid_size = 1 - robot_radius = 2 - start = (2, 2) - goal = (50, 50) - static_obstacles = [(0, 0), (60, 70)] - dynamic_obstacles = {0: [(5, 16)], 1: [(5, 17)], 2: [(5, 18), (11, 20)]} - planner = Planner(grid_size, robot_radius, start, goal, static_obstacles, dynamic_obstacles) - print(planner.plan()) +