Skip to content

Commit

Permalink
updated gradient calculation
Browse files Browse the repository at this point in the history
instead of using the module auto_differentiation.py (removed) to compute the gradient (for the geofencing behavior), the package numdifftools is now integrated.
  • Loading branch information
mrsonandrade committed Oct 16, 2023
1 parent 10d9e36 commit 9585691
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 406 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
2 changes: 1 addition & 1 deletion .github/workflows/tests_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest numpy matplotlib
pip install flake8 pytest numpy numdifftools matplotlib
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![Tests](https://github.com/mrsonandrade/pyswarming/actions/workflows/tests_package.yml/badge.svg)](https://github.com/mrsonandrade/pyswarming/actions/workflows/tests_package.yml)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Documentation Status](https://readthedocs.org/projects/pyswarming/badge/?version=latest)](https://pyswarming.readthedocs.io/en/latest/?badge=latest)
![version](https://img.shields.io/badge/version-1.1.3-blue)
![version](https://img.shields.io/badge/version-1.1.4-blue)
[![Downloads](https://static.pepy.tech/personalized-badge/pyswarming?period=total&units=none&left_color=black&right_color=blue&left_text=Downloads)](https://pepy.tech/project/pyswarming)
[![DOI](https://joss.theoj.org/papers/10.21105/joss.05647/status.svg)](https://doi.org/10.21105/joss.05647)

Expand All @@ -19,7 +19,7 @@ pip install pyswarming

## Dependencies

`pyswarming`'s dependencies are: `numpy` and `matplotlib`.
`pyswarming`'s dependencies are: `numpy`, `numdifftools` and `matplotlib`.


## Documentation
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ipykernel
numpy
numdifftools
pyswarming
matplotlib
nbsphinx
Expand Down
3 changes: 1 addition & 2 deletions docs/source/example_notebooks/03_Custom_Animations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,7 @@
"robot4, = ax.plot([], [], marker='o', lw=0)\n",
"\n",
"# sphere function: used as region to be filled\n",
"def sphere(x, y, z, x0=0, y0=0, z0=0, radius=4.0):\n",
" return (x-x0)**2 + (y-y0)**2 + (z-z0)**2 - radius\n",
"sphere = lambda x: x[0]**2 + x[1]**2 + x[2]**2 - 4.0\n",
"\n",
"# initialization function: plot the background of each frame\n",
"def init():\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ You can install ``pyswarming`` from PyPI using pip (**Recommended**)::
Dependencies
============

``pyswarming``'s dependencies are: ``numpy`` and ``matplotlib``.
``pyswarming``'s dependencies are: ``numpy``, ``numdifftools`` and ``matplotlib``.


Algorithms covered
Expand Down
3 changes: 1 addition & 2 deletions examples/example_customized_aggregation_area_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@
robot4, = ax.plot([], [], marker='o', lw=0)

# sphere function: used as region to be filled
def sphere(x, y, z, x0=0, y0=0, z0=0, radius=4.0):
return (x-x0)**2 + (y-y0)**2 + (z-z0)**2 - radius
sphere = lambda x: x[0]**2 + x[1]**2 + x[2]**2 - 4.0

# initialization function: plot the background of each frame
def init():
Expand Down
3 changes: 1 addition & 2 deletions notebooks/03_Custom_Animations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,7 @@
"robot4, = ax.plot([], [], marker='o', lw=0)\n",
"\n",
"# sphere function: used as region to be filled\n",
"def sphere(x, y, z, x0=0, y0=0, z0=0, radius=4.0):\n",
" return (x-x0)**2 + (y-y0)**2 + (z-z0)**2 - radius\n",
"sphere = lambda x: x[0]**2 + x[1]**2 + x[2]**2 - 4.0\n",
"\n",
"# initialization function: plot the background of each frame\n",
"def init():\n",
Expand Down
2 changes: 1 addition & 1 deletion pyswarming/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@
__all__.append(module_j)

name = "pyswarming"
__version__ = "1.1.3"
__version__ = "1.1.4"
__author__ = "Emerson Martins de Andrade, Antonio Carlos Fernandes and Joel Sena Sales Jr"
__author_email__ = "[email protected]"
Loading

0 comments on commit 9585691

Please sign in to comment.