Skip to content

Commit

Permalink
Merge pull request #408 from zStupan/update-docs
Browse files Browse the repository at this point in the history
update docs
  • Loading branch information
firefly-cpp authored Oct 31, 2023
2 parents f17d5f9 + d179362 commit befd68e
Show file tree
Hide file tree
Showing 13 changed files with 197 additions and 140 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2

updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"

- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "monthly"
26 changes: 23 additions & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
requirements_file: docs/requirements.txt
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
image: latest
os: ubuntu-22.04
tools:
python: "3.12"

sphinx:
configuration: docs/source/conf.py
fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
formats: all

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
version: 3.9
install:
- requirements: docs/requirements.txt
31 changes: 11 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,17 @@



![Check codestyle and test build](https://github.com/NiaOrg/NiaPy/workflows/Check%20and%20Test/badge.svg)
![Check codestyle and test build](https://github.com/NiaOrg/NiaPy/actions/workflows/main.yml/badge.svg)
[![PyPI Version](https://img.shields.io/pypi/v/NiaPy.svg)](https://pypi.python.org/pypi/NiaPy)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/NiaPy.svg)
![PyPI - Status](https://img.shields.io/pypi/status/NiaPy.svg)
![PyPI - Downloads](https://img.shields.io/pypi/dm/NiaPy.svg)
[![Downloads](https://pepy.tech/badge/niapy)](https://pepy.tech/project/niapy)
![GitHub Release Date](https://img.shields.io/github/release-date/NiaOrg/NiaPy.svg)
[![Anaconda-Server Badge](https://anaconda.org/niaorg/niapy/badges/installer/conda.svg)](https://conda.anaconda.org/niaorg)
[![Anaconda Badge](https://anaconda.org/niaorg/niapy/badges/version.svg)](https://conda.anaconda.org/niaorg)
[![Fedora package](https://img.shields.io/fedora/v/python3-niapy?color=blue&label=Fedora%20Linux&logo=fedora)](https://src.fedoraproject.org/rpms/python-niapy)
[![AUR package](https://img.shields.io/aur/version/python-niapy?color=blue&label=Arch%20Linux&logo=arch-linux)](https://aur.archlinux.org/packages/python-niapy)
[![Documentation Status](https://readthedocs.org/projects/niapy/badge/?version=latest)](http://niapy.readthedocs.io/en/latest/?badge=latest)
[![GitHub license](https://img.shields.io/github/license/NiaOrg/NiaPy.svg)](https://github.com/NiaOrg/NiaPy/blob/master/LICENSE)

[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/NiaOrg/NiaPy/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/NiaOrg/NiaPy/?branch=master)
[![Coverage Status](https://img.shields.io/coveralls/NiaOrg/NiaPy/master.svg)](https://coveralls.io/r/NiaOrg/NiaPy)
![GitHub commit activity](https://img.shields.io/github/commit-activity/w/NiaOrg/NiaPy.svg)
[![Updates](https://pyup.io/repos/github/NiaOrg/NiaPy/shield.svg)](https://pyup.io/repos/github/NiaOrg/NiaPy/)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/NiaOrg/NiaPy.svg)](http://isitmaintained.com/project/NiaOrg/NiaPy "Average time to resolve an issue")
[![Percentage of issues still open](http://isitmaintained.com/badge/open/NiaOrg/NiaPy.svg)](http://isitmaintained.com/project/NiaOrg/NiaPy "Percentage of issues still open")
![GitHub contributors](https://img.shields.io/github/contributors/NiaOrg/NiaPy.svg)
Expand All @@ -33,7 +27,7 @@ Nature-inspired algorithms are a very popular tool for solving optimization prob

* **Free software:** MIT license
* **Documentation:** https://niapy.readthedocs.io/en/stable/
* **Python versions:** 3.9.x, 3.10.x, 3.11.x
* **Python versions:** 3.9.x, 3.10.x, 3.11.x, 3.12.x
* **Dependencies:** [click here](CONTRIBUTING.md#development-dependencies)

# Mission
Expand All @@ -51,52 +45,51 @@ Our mission is to build a collection of nature-inspired algorithms and create a
Install NiaPy with pip:

```sh
$ pip install niapy
pip install niapy
```

To install NiaPy with conda, use:

```sh
$ conda install -c niaorg niapy
conda install -c niaorg niapy
```

To install NiaPy on Fedora, use:

```sh
$ dnf install python3-niapy
dnf install python3-niapy
```

To install NiaPy on Arch Linux, please use an [AUR helper](https://wiki.archlinux.org/title/AUR_helpers):

```sh
$ yay -Syyu python-niapy
yay -Syyu python-niapy
```

To install NiaPy on Alpine Linux, please enable Community repository and use:

```sh
$ apk add py3-niapy
apk add py3-niapy
```

To install NiaPy on NixOS, please use:

```sh
$ nix-env -iA nixos.python310Packages.niapy
nix-env -iA nixos.python310Packages.niapy
```

To install NiaPy on Void Linux, use:

```sh
$ xbps-install -S python3-niapy
xbps-install -S python3-niapy
```

## Install from source

In case you want to install directly from the source code, use:

```sh
$ git clone https://github.com/NiaOrg/NiaPy.git
$ pip install NiaPy/
pip install git+https://github.com/NiaOrg/NiaPy.git
```

# Algorithms
Expand Down Expand Up @@ -309,8 +302,6 @@ This project follows the [all-contributors](https://github.com/all-contributors/

## Contributing

[![Open Source Helpers](https://www.codetriage.com/niaorg/niapy/badges/users.svg)](https://www.codetriage.com/niaorg/niapy)

We encourage you to contribute to NiaPy! Please check out the [Contributing to NiaPy guide](CONTRIBUTING.md) for guidelines about how to proceed.

Everyone interacting in NiaPy's codebases, issue trackers, chat rooms and mailing lists is expected to follow the NiaPy [code of conduct](CODE_OF_CONDUCT.md).
Expand Down
11 changes: 0 additions & 11 deletions dependabot.yml

This file was deleted.

88 changes: 62 additions & 26 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,62 @@
alabaster>=0.7.10
Babel>=2.5.3
certifi>=2018.1.18
chardet>=3.0.4
docutils>=0.14
idna>=2.6
imagesize>=1.0.0
Jinja2>=2.10
MarkupSafe>=1.0
packaging>=16.8
Pygments>=2.2.0
pyparsing>=2.2.0
pytz>=2018.3
requests>=2.18.4
six>=1.11.0
snowballstemmer>=1.2.1
sphinx>=1.8.5
#sphinx-rtd-theme>=0.2.4
sphinx-press-theme>=0.5.1
sphinxcontrib-napoleon>=0.7
sphinxcontrib-websupport>=1.0.1
urllib3>=1.22
xlsxWriter>=1.1.5
numpy>=1.16.2
scipy>=1.2.1
matplotlib>=3.0.2
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile requirements.in
#
alabaster==0.7.13
# via sphinx
babel==2.13.1
# via sphinx
certifi==2023.7.22
# via requests
charset-normalizer==3.3.1
# via requests
docutils==0.18.1
# via
# sphinx
# sphinx-rtd-theme
idna==3.4
# via requests
imagesize==1.4.1
# via sphinx
jinja2==3.1.2
# via sphinx
markupsafe==2.1.3
# via jinja2
packaging==23.2
# via sphinx
pygments==2.16.1
# via sphinx
requests==2.31.0
# via sphinx
snowballstemmer==2.2.0
# via sphinx
sphinx==7.2.6
# via
# -r requirements.in
# sphinx-rtd-theme
# sphinxcontrib-applehelp
# sphinxcontrib-devhelp
# sphinxcontrib-htmlhelp
# sphinxcontrib-jquery
# sphinxcontrib-qthelp
# sphinxcontrib-serializinghtml
sphinx-rtd-theme==1.3.0
# via -r requirements.in
sphinxcontrib-applehelp==1.0.7
# via sphinx
sphinxcontrib-devhelp==1.0.5
# via sphinx
sphinxcontrib-htmlhelp==2.0.4
# via sphinx
sphinxcontrib-jquery==4.1
# via sphinx-rtd-theme
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==1.0.6
# via sphinx
sphinxcontrib-serializinghtml==1.1.9
# via sphinx
urllib3==2.0.7
# via requests
7 changes: 7 additions & 0 deletions docs/source/api/niapy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,10 @@
:members:
:undoc-members:
:show-inheritance:

:mod:`niapy.callbacks`
----------------------
.. automodule:: niapy.callbacks
:members:
:undoc-members:
:show-inheritance:
12 changes: 4 additions & 8 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# -- Project information -----------------------------------------------------

project = u'NiaPy'
copyright = u'2018-2020, NiaOrg'
copyright = u'2018-2023, NiaOrg'
author = u'Grega Vrbančič, Lucija Brezočnik, Uroš Mlakar, Dušan Fister, Iztok Fister Jr., Klemen Berkovič, Jan Popič'

# The short X.Y version
Expand Down Expand Up @@ -82,7 +82,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'press' #'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"

html_logo = '_static/NiaPyLogo.png'

Expand All @@ -91,9 +91,8 @@
# documentation.
#
html_theme_options = {
"external_links": [
("Github", "https://github.com/NiaOrg/NiaPy"),
]
"logo_only": True,
"display_version": False,
}

# Add any paths that contain custom static files (such as style sheets) here,
Expand Down Expand Up @@ -200,6 +199,3 @@
napoleon_use_rtype = True
napoleon_use_keyword = True
napoleon_custom_sections = None

import matplotlib
matplotlib.use('agg')
7 changes: 3 additions & 4 deletions docs/source/documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ Documentation
We suppose that you already followed the :doc:`/installation` guide. If not, please do so
before you continue to read this section.

To locally generate and preview documentation run the following command in the project root folder:
To locally generate the documentation run the following command in the project root folder:

.. code-block:: bash
pipenv run sphinx-autobuild docs/source docs/build/html
If the build of the documentation is successful, you can preview the documentation by navigating to the http://127.0.0.1:8000.
poetry run sphinx-build docs/source docs/build/html
You can then view it by opening docs/build/html/index.html in your browser
12 changes: 4 additions & 8 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
.. _reference:

.. image:: _static/NiaPyLogo.png
:align: center

NiaPy's documentation
=================================

Expand All @@ -28,7 +23,7 @@ implementing algorithms from scratch.

* **Free software:** MIT license
* **Github repository:** https://github.com/NiaOrg/NiaPy
* **Python versions:** 3.9.x, 3.10.x, 3.11.x
* **Python versions:** 3.9.x, 3.10.x, 3.11.x, 3.12.x

The main documentation is organized into a couple sections:

Expand Down Expand Up @@ -74,6 +69,7 @@ The main documentation is organized into a couple sections:
.. _api-docs:

.. toctree::
:caption: API Documentation
:maxdepth: 2
:caption: API Documentation

api/index
api/index
20 changes: 6 additions & 14 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,18 @@ Requirements
Installation of development dependencies
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**NiaPy dependencies:**

+-----------+-----------+----------+
| Package | Version | Platform |
+===========+===========+==========+
| numpy | >=1.26.1 | All |
+-----------+-----------+----------+
| matplotlib| >=3.8.0 | All |
+-----------+-----------+----------+
| pandas | >=2.1.1 | All |
+-----------+-----------+----------+
| openpyxl | >=3.1.2 | All |
+-----------+-----------+----------+

Install project dependencies into a virtual environment:

.. code-block:: bash
poetry install
Install documentation dependencies with:

.. code-block:: bash
poetry install --with docs
Run tests with:

.. code-block:: bash
Expand Down
2 changes: 1 addition & 1 deletion docs/source/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ For the purpose of checking if all test are passing locally you can run followin

.. code-block:: bash
make test
poetry run pytest
If all tests passed running this command it is most likely that the tests would pass on
our build system to.
Loading

0 comments on commit befd68e

Please sign in to comment.