XHTML2PDF
=========

.. image:: https://img.shields.io/pypi/v/xhtml2pdf?label=PyPI&logo=PyPI&logoColor=white&color=blue
    :target: https://pypi.python.org/pypi/xhtml2pdf
    :alt: PyPI version

.. image:: https://img.shields.io/pypi/pyversions/xhtml2pdf?label=Python&logo=Python&logoColor=white
    :target: https://www.python.org/downloads
    :alt: Python versions

.. image:: https://img.shields.io/coveralls/github/xhtml2pdf/xhtml2pdf?label=Coveralls&logo=Coveralls&logoColor=white
    :target: https://coveralls.io/github/xhtml2pdf/xhtml2pdf
    :alt: Coveralls

.. image:: https://img.shields.io/readthedocs/xhtml2pdf?label=Read%20the%20Docs&logo=read%20the%20docs&logoColor=white
   :target: http://xhtml2pdf.readthedocs.io/en/latest/?badge=latest
   :alt: Read the Docs

|

Release Notes can be found here: `Release Notes <https://xhtml2pdf.readthedocs.io/en/latest/release-notes.html>`__
As with all open-source software, its use in production depends on many factors, so be aware that you may find issues in some cases.

**Big thanks** to everyone who has worked on this project so far and to those who help maintain it.

About
=====

xhtml2pdf is a HTML to PDF converter using Python, the ReportLab Toolkit, html5lib and pypdf. It supports HTML5 and CSS 2.1 (and some of CSS 3). It is completely written in pure Python, so it is platform independent.

The main benefit of this tool is that a user with web skills like HTML and CSS is able to generate PDF templates very quickly without learning new technologies.

Please consider support this project using `Patreon <https://www.patreon.com/xhtml2pdf>`__ or Bitcoins: ``bc1qmr0skzwx5scyvh2ql28f7gfh6l65ua250qv227``

Documentation
==============

The documentation of xhtml2pdf is available at `Read the Docs <http://xhtml2pdf.readthedocs.io>`__.

And we could use your help improving it! A good place to start is ``doc/source/usage.rst``.

Installation
============

This is a typical Python library and can be installed using pip::

    pip install xhtml2pdf

Requirements
============

Only Python 3.8+ is tested and guaranteed to work.

All mandatory requirements are listed in the ``pyproject.toml`` file and are installed automatically using the ``pip install xhtml2pdf`` method.

As PDF library we depend on reportlab, which needs a rendering backend to generate bitmaps and vector graphic formats.
For more information about this, have a look at the `reportlab docs <https://docs.reportlab.com/install/open_source_installation/>`__.

The recommended choice is the `cairo graphics library <https://cairographics.org/>`__ which has to be installed system-wide e.g. via the OS package manager
in combination with the ``PyCairo`` extra dependency:

    pip install xhtml2pdf[pycairo]

Alternatively, the legacy ``RenderPM`` can be used by installing:

    pip install xhtml2pdf[renderpm]

Alternatives
============

You can try `WeasyPrint <http://weasyprint.org>`__. The codebase is pretty, it has different features and it does a lot of what xhtml2pdf does.

Call for testing
================

This project is heavily dependent on getting its test coverage up! Furthermore, parts of the codebase could do well with cleanups and refactoring.

If you benefit from xhtml2pdf, perhaps look at the `test coverage <https://coveralls.io/github/xhtml2pdf/xhtml2pdf>`__ and identify parts that are yet untouched.

Development environment
=======================

#. If you don't have it, install ``pip``, the python package installer::

    sudo easy_install pip

   For more information about ``pip`` refer to http://www.pip-installer.org

#. We will recommend using ``venv`` for development.

#. Create a virtual environment for the project. This can be inside the project directory, but cannot be under version control::

    python -m venv .venv

#. Activate your virtual environment::

    source .venv/bin/activate

   Later to deactivate it use::

    deactivate

#. The next step will be to install/upgrade dependencies from the ``pyproject.toml`` file::

    pip install -e .[test,docs,build]

#. Run tests to check your configuration::

    tox

   You should have a log with the following success status::

    congratulations :) (75.67 seconds)

Python integration
==================

Some simple demos of how to integrate xhtml2pdf into a Python program may be found here: ``test/simple.py``

Running tests
=============

Two different test suites are available to assert that xhtml2pdf works reliably:

#. Unit tests. The unit testing framework is currently minimal, but is being
   improved on a regular basis (contributions welcome). They should run in the
   expected way for Python's unittest module, i.e.::

        tox

#. Functional tests. Thanks to mawe42's super cool work, a full functional
   test suite is available at ``testrender/``.

You can run them using make

.. code:: bash

        make test       # run tests
        make test-ref   # generate reference data for testrender
        make test-all   # Run all test using tox

Contact
=======

This project is community-led! Feel free to open up issues on GitHub about new ideas to improve xhtml2pdf.

History
=======

These are the major milestones and the maintainers of the project:

* 2000-2007 Dirk Holtwick (commercial project of spirito.de)
* 2007-2010 Dirk Holtwick (project named "pisa", project released as GPL)
* 2010-2012 Dirk Holtwick (project named "xhtml2pdf", changed license to Apache)
* 2012-2015 Chris Glass (@chrisglass)
* 2015-2016 Benjamin Bach (@benjaoming)
* 2016-2018 Sam Spencer (@LegoStormtroopr)
* 2018-Current Luis Zarate (@luisza)

For more history, see the `Release Notes <https://xhtml2pdf.readthedocs.io/en/latest/release-notes.html>`__.

License
=======

Copyright 2010 Dirk Holtwick, holtwick.it

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


# GPy

The Gaussian processes framework in Python.

* GPy [homepage](http://sheffieldml.github.io/GPy/)
* Tutorial [notebooks](http://nbviewer.ipython.org/github/SheffieldML/notebook/blob/master/GPy/index.ipynb)
* User [mailing-list](https://lists.shef.ac.uk/sympa/subscribe/gpy-users)
* Developer [documentation](http://gpy.readthedocs.io/) [documentation (devel branch)](https://gpy.readthedocs.io/en/devel/)
* Travis-CI [unit-tests](https://travis-ci.org/SheffieldML/GPy)
* [![licence](https://img.shields.io/badge/licence-BSD-blue.svg)](http://opensource.org/licenses/BSD-3-Clause)
  [![Research software impact](http://depsy.org/api/package/pypi/GPy/badge.svg)](http://depsy.org/package/python/GPy)

## Status

| Branch | travis-ci.org | ci.appveyor.com | coveralls.io | codecov.io |
| --- | --- | --- | --- | --- |
| Default branch (`devel`) | [![travis-devel](https://travis-ci.org/SheffieldML/GPy.svg?branch=devel)](https://travis-ci.org/SheffieldML/GPy/branches) | [![appveyor-devel](https://ci.appveyor.com/api/projects/status/662o6tha09m2jix3/branch/devel?svg=true)](https://ci.appveyor.com/project/mzwiessele/gpy/branch/devel) | [![coveralls-devel](https://coveralls.io/repos/github/SheffieldML/GPy/badge.svg?branch=devel)](https://coveralls.io/github/SheffieldML/GPy?branch=devel) | [![codecov-devel](http://codecov.io/github/SheffieldML/GPy/coverage.svg?branch=devel)](http://codecov.io/github/SheffieldML/GPy?branch=devel) |
| Deployment branch (`deploy`) | [![travis-deploy](https://travis-ci.org/SheffieldML/GPy.svg?branch=deploy)](https://travis-ci.org/SheffieldML/GPy/branches) | [![appveyor-deploy](https://ci.appveyor.com/api/projects/status/662o6tha09m2jix3/branch/deploy?svg=true)](https://ci.appveyor.com/project/mzwiessele/gpy/branch/deploy) | [![coveralls-deploy](https://coveralls.io/repos/github/SheffieldML/GPy/badge.svg?branch=deploy)](https://coveralls.io/github/SheffieldML/GPy?branch=deploy) | [![codecov-deploy](http://codecov.io/github/SheffieldML/GPy/coverage.svg?branch=deploy)](http://codecov.io/github/SheffieldML/GPy?branch=deploy) |

## What's new:

From now on we keep track of changes in the CHANGELOG.md.
If you want your changes to show up there follow the [guidelines](#gl).
In particular tag your commits by the [gitchangelog](https://github.com/vaab/gitchangelog) commit message format.

## Contributing to GPy

We welcome any contributions to GPy, after all it is an open source project. We use the GitHub feature of pull requests for contributions.

For an in depth description of pull requests, please visit https://help.github.com/articles/using-pull-requests/ .

### Steps to a successful contribution:

 1. Fork GPy: https://help.github.com/articles/fork-a-repo/
 2. Make your changes to the source in your fork.
 3. Make sure the [guidelines](#gl) are met.
 4. Set up tests to test your code. We are using unittests in the testing subfolder of GPy. There is a good chance
    that there is already a framework set up to test your new model in model_tests.py or kernel in kernel_tests.py. have a look at the source and you might be able to just add your model (or kernel or others) as an additional test in the appropriate file. There is more frameworks for testing the other bits and pieces, just head over to the testing folder and have a look.
 5. Create a pull request to the devel branch in GPy, see above.
 6. The tests will be running on your pull request. In the comments section we will be able to discuss the changes and help you with any problems. Let us know if there are any in the comments, so we can help.
 7. The pull request gets accepted and your awesome new feature will be in the next GPy release :)

For any further questions/suggestions head over to the issues section in GPy.

### Pull Request Guidelines

 - Check your code with PEP8 or pylint. Try to stick to 80 columns wide.
 - Separate commits per smallest concern.
 - Each functionality/bugfix commit should contain code, tests, and doc.
 - We are using gitchangelog to keep track of changes and log new features. So if you want your changes to show up in the changelog, make sure you follow the [gitchangelog](https://github.com/vaab/gitchangelog) commit message format.

## Support and questions to the community

Ask questions using the issues section.

## Updated Structure

We have pulled the core parameterization out of GPy. It is a package called [paramz](https://github.com/sods/paramz) and is the pure gradient based model optimization.

If you installed GPy with pip, just upgrade the package using:

    $ pip install --upgrade GPy

If you have the developmental version of GPy (using the develop or -e option) just install the dependencies by running

    $ python setup.py develop

again, in the GPy installation folder.

A warning: This usually works, but sometimes `distutils/setuptools` opens a
whole can of worms here, specially when compiled extensions are involved.
If that is the case, it is best to clean the repo and reinstall.

## Supported Platforms:

[](https://www.python.org/)
[](http://www.microsoft.com/en-gb/windows)
[](http://www.apple.com/osx/)
[](https://en.wikipedia.org/wiki/List_of_Linux_distributions)

Python 3.9 and higher

## Citation

    @Misc{gpy2014,
      author =   {{GPy}},
      title =    {{GPy}: A Gaussian process framework in python},
      howpublished = {\url{http://github.com/SheffieldML/GPy}},
      year = {since 2012}
    }

### Pronounciation:

We like to pronounce it 'g-pie'.

## Getting started: installing with pip

We are requiring a recent version (1.3.0 or later) of
[scipy](http://www.scipy.org/) and thus, we strongly recommend using
the  [anaconda python distribution](http://continuum.io/downloads).
With anaconda you can install GPy by the following:

    conda update scipy

Then potentially try,

    sudo apt-get update
    sudo apt-get install python3-dev
    sudo apt-get install build-essential
    conda update anaconda

And finally,

    pip install gpy

We've also had luck with [enthought](http://www.enthought.com). Install scipy 1.3.0 (or later)
 and then pip install GPy:

    pip install gpy

If you'd like to install from source, or want to contribute to the project (i.e. by sending pull requests via github), read on.

### Troubleshooting installation problems

If you're having trouble installing GPy via `pip install GPy` here is a probable solution:

    git clone https://github.com/SheffieldML/GPy.git
    cd GPy
    git checkout devel
    python setup.py build_ext --inplace
    pytest .

### Direct downloads

[![PyPI version](https://badge.fury.io/py/GPy.svg)](https://pypi.python.org/pypi/GPy) [![source](https://img.shields.io/badge/download-source-green.svg)](https://pypi.python.org/pypi/GPy)
[![Windows](https://img.shields.io/badge/download-windows-orange.svg)](https://pypi.python.org/pypi/GPy)
[![MacOSX](https://img.shields.io/badge/download-macosx-blue.svg)](https://pypi.python.org/pypi/GPy)

# Saving models in a consistent way across versions:

As pickle is inconsistent across python versions and heavily dependent on class structure, it behaves inconsistent across versions.
Pickling as meant to serialize models within the same environment, and not to store models on disk to be used later on.

To save a model it is best to save the m.param_array of it to disk (using numpy’s np.save).
Additionally, you save the script, which creates the model.
In this script you can create the model using initialize=False as a keyword argument and with the data loaded as normal.
You then set the model parameters by setting m.param_array[:] = loaded_params as the previously saved parameters.
Then you initialize the model by m.initialize_parameter(), which will make the model usable.
Be aware that up to this point the model is in an inconsistent state and cannot be used to produce any results.

```python
# let X, Y be data loaded above
# Model creation:
m = GPy.models.GPRegression(X, Y)
m.optimize()
# 1: Saving a model:
np.save('model_save.npy', m.param_array)
# 2: loading a model
# Model creation, without initialization:
m_load = GPy.models.GPRegression(X, Y, initialize=False)
m_load.update_model(False) # do not call the underlying expensive algebra on load
m_load.initialize_parameter() # Initialize the parameters (connect the parameters up)
m_load[:] = np.load('model_save.npy') # Load the parameters
m_load.update_model(True) # Call the algebra only once
print(m_load)
```
## For Admins and Developers:

### Running unit tests:

New way of running tests is using coverage:

Ensure pytest and coverage is installed:

    pip install pytest

Run nosetests from root directory of repository:

    python travis_tests.py

Create coverage report in htmlcov/

    coverage html

The coverage report is located in htmlcov/index.html

##### Legacy: using nosetests

Ensure nose is installed via pip:

    pip install nose

Run nosetests from the root directory of the repository:

    nosetests -v GPy/testing

or from within IPython

    import GPy; GPy.tests()

or using setuptools

    python setup.py test

### Compiling documentation:

The documentation is stored in doc/ and is compiled with the Sphinx Python documentation generator, and is written in the reStructuredText format.

The Sphinx documentation is available here: http://sphinx-doc.org/latest/contents.html

**Installing dependencies:**

To compile the documentation, first ensure that Sphinx is installed. On Debian-based systems, this can be achieved as follows:

    sudo apt-get install python-pip
    sudo pip install sphinx

**Compiling documentation:**

The documentation can be compiled as follows:

    cd doc
    sphinx-apidoc -o source/ ../GPy/
    make html

alternatively:

```{shell}
cd doc
sphinx-build -b html -d build/doctrees -D graphviz_dot='<path to dot>' source build/html
```

The HTML files are then stored in doc/build/html

### Commit new patch to devel

If you want to merge a branch into devel make sure the following steps are met:

 - Create a local branch from the pull request and merge the current devel in.
 - Look through the changes on the pull request.
 - Check that tests are there and are checking code where applicable.
 - [optional] Make changes if necessary and commit and push to run tests.
 - [optional] Repeat the above until tests pass.
 - [optional] bump up the version of GPy using bumpversion. The configuration is done, so all you need is bumpversion [major|minor|patch].
 - Update the changelog using gitchangelog: `gitchangelog > CHANGELOG.md`
 - Commit the changes of the changelog as silent update: `git commit -m "chg: pkg: CHANGELOG update" CHANGELOG.md
 - Push the changes into devel.

A usual workflow should look like this:

    $ git fetch origin
    $ git checkout -b <pull-origin>-devel origin/<pull-origin>-devel
    $ git merge devel
    $ coverage run travis_tests.py

**Make changes for tests to cover corner cases (if statements, None arguments etc.)**
Then we are ready to make the last changes for the changelog and versioning:

    $ git commit -am "fix: Fixed tests for <pull-origin>"
    $ bumpversion patch # [optional]
    $ gitchangelog > CHANGELOG.md
    $ git commit -m "chg: pkg: CHANGELOG update" CHANGELOG.md

Now we can merge the pull request into devel:

    $ git checkout devel
    $ git merge --no-ff <pull-origin>-devel
    $ git push origin devel

This will update the devel branch of GPy.

### Deploying GPy

We have set up all deployment automatic.
Thus, all you need to do is create a pull request from devel to deploy.
Wait for the tests to finish (successfully!) and merge the pull request.
This will update the package on pypi for all platforms fully automatically.

## Funding Acknowledgements

Current support for the GPy software is coming through the following projects.

* [EU FP7-HEALTH Project Ref 305626](http://radiant-project.eu) "RADIANT: Rapid Development and Distribution of Statistical Tools for High-Throughput Sequencing Data"

* [EU FP7-PEOPLE Project Ref 316861](http://staffwww.dcs.shef.ac.uk/people/N.Lawrence/projects/mlpm/) "MLPM2012: Machine Learning for Personalized Medicine"

* MRC Special Training Fellowship "Bayesian models of expression in the transcriptome for clinical RNA-seq"

*  [EU FP7-ICT Project Ref 612139](http://staffwww.dcs.shef.ac.uk/people/N.Lawrence/projects/wysiwyd/) "WYSIWYD: What You Say is What You Did"

Previous support for the GPy software came from the following projects:

- [BBSRC Project No BB/K011197/1](http://staffwww.dcs.shef.ac.uk/people/N.Lawrence/projects/recombinant/) "Linking recombinant gene sequence to protein product manufacturability using CHO cell genomic resources"
- [EU FP7-KBBE Project Ref 289434](http://staffwww.dcs.shef.ac.uk/people/N.Lawrence/projects/biopredyn/) "From Data to Models: New Bioinformatics Methods and Tools for Data-Driven Predictive Dynamic Modelling in Biotechnological Applications"
- [BBSRC Project No BB/H018123/2](http://staffwww.dcs.shef.ac.uk/people/N.Lawrence/projects/iterative/) "An iterative pipeline of computational modelling and experimental design for uncovering gene regulatory networks in vertebrates"
- [Erasysbio](http://staffwww.dcs.shef.ac.uk/people/N.Lawrence/projects/synergy/) "SYNERGY: Systems approach to gene regulation biology through nuclear receptors"


Kazoo
=====

[![Kazoo Awesome Testing](https://github.com/python-zk/kazoo/actions/workflows/testing.yml/badge.svg?branch=master)](https://github.com/python-zk/kazoo/actions/workflows/testing.yml?query=branch%3Amaster)
[![Latest Version](https://img.shields.io/pypi/v/kazoo.svg)](https://pypi.org/project/kazoo/)
[![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com)

`kazoo` implements a higher level API to [Apache
Zookeeper](http://zookeeper.apache.org/) for Python clients.

See [the full docs](http://kazoo.rtfd.org/) for more information.

License
-------

`kazoo` is offered under the Apache License 2.0.

Authors
-------

`kazoo` started under the [Nimbus
Project](http://www.nimbusproject.org/) and through collaboration with
the open-source community has been merged with code from
[Mozilla](http://www.mozilla.org/) and the [Zope
Corporation](http://zope.com/). It has since gathered an active
community of over one hundred contributors.


.. image:: https://github.com/wireservice/agate/workflows/CI/badge.svg
    :target: https://github.com/wireservice/agate/actions
    :alt: Build status

.. image:: https://coveralls.io/repos/wireservice/agate/badge.svg?branch=master
    :target: https://coveralls.io/r/wireservice/agate
    :alt: Coverage status

.. image:: https://img.shields.io/pypi/dm/agate.svg
    :target: https://pypi.python.org/pypi/agate
    :alt: PyPI downloads

.. image:: https://img.shields.io/pypi/v/agate.svg
    :target: https://pypi.python.org/pypi/agate
    :alt: Version

.. image:: https://img.shields.io/pypi/l/agate.svg
    :target: https://pypi.python.org/pypi/agate
    :alt: License

.. image:: https://img.shields.io/pypi/pyversions/agate.svg
    :target: https://pypi.python.org/pypi/agate
    :alt: Support Python versions

agate is a Python data analysis library that is optimized for humans instead of machines. It is an alternative to numpy and pandas that solves real-world problems with readable code.

agate was previously known as journalism.

Important links:

* Documentation:    https://agate.rtfd.org
* Repository:       https://github.com/wireservice/agate
* Issues:           https://github.com/wireservice/agate/issues


<img src="https://github.com/kellya/bumblebee-status-icon/blob/main/img/bumblebee_status_rtl.svg" width="50" style="display:inline-block">bumblebee-status
=====================================================

logo courtesy of [kellya](https://github.com/kellya) - thank you!

[![Documentation Status](https://readthedocs.org/projects/bumblebee-status/badge/?version=main)](https://bumblebee-status.readthedocs.io/en/main/?badge=main)
![Commits since release](https://img.shields.io/github/commits-since/tobi-wan-kenobi/bumblebee-status/latest)
![AUR version (release)](https://img.shields.io/aur/version/bumblebee-status)
![AUR version (git)](https://img.shields.io/aur/version/bumblebee-status-git)
![PyPI version](https://img.shields.io/pypi/v/bumblebee-status)
![Contributors](https://img.shields.io/github/contributors-anon/tobi-wan-kenobi/bumblebee-status)
[![Tests](https://github.com/tobi-wan-kenobi/bumblebee-status/actions/workflows/autotest.yml/badge.svg?branch=main)](https://github.com/tobi-wan-kenobi/bumblebee-status/actions/workflows/autotest.yml)

[![Code Climate](https://codeclimate.com/github/tobi-wan-kenobi/bumblebee-status/badges/gpa.svg)](https://codeclimate.com/github/tobi-wan-kenobi/bumblebee-status)
[![Test Coverage](https://codeclimate.com/github/tobi-wan-kenobi/bumblebee-status/badges/coverage.svg)](https://codeclimate.com/github/tobi-wan-kenobi/bumblebee-status/coverage)
[![Issue Count](https://codeclimate.com/github/tobi-wan-kenobi/bumblebee-status/badges/issue_count.svg)](https://codeclimate.com/github/tobi-wan-kenobi/bumblebee-status)
[![CodeQL](https://github.com/tobi-wan-kenobi/bumblebee-status/actions/workflows/codeql-analysis.yml/badge.svg?branch=main)](https://github.com/tobi-wan-kenobi/bumblebee-status/actions/workflows/codeql-analysis.yml)
![License](https://img.shields.io/github/license/tobi-wan-kenobi/bumblebee-status)

**Many, many thanks to all contributors! I am still amazed by and deeply grateful for how many PRs this project gets.**

[Click here for a list of available modules](https://bumblebee-status.readthedocs.io/en/main/modules.html)

![Solarized Powerline](screenshots/themes/powerline-solarized.png)

bumblebee-status is a modular, theme-able status line generator for the [i3 window manager](https://i3wm.org/).

Focus is on:
* ease of use, sane defaults (no mandatory configuration file)
* [easy creation of custom themes](https://bumblebee-status.readthedocs.io/en/main/development/theme.html)
* [easy creation of custom modules](https://bumblebee-status.readthedocs.io/en/main/development/module.html)

I hope you like it and I appreciate any kind of feedback: bug reports, feature requests, etc. :)

Thanks a lot!

Required i3wm version: 4.12+ (in earlier versions, blocks won't have background colors)

Supported Python versions: 3.4, 3.5, 3.6, 3.7, 3.8, 3.9

Supported FontAwesome version: 4 (free version of 5 doesn't include some of the icons)

---
***NOTE***

The default branch for this project is `main`. If you are curious why: [ZDNet:github-master-alternative](https://www.zdnet.com/article/github-to-replace-master-with-alternative-term-to-avoid-slavery-references/)

---

Example usage:

```
bar {
	status_command <path>/bumblebee-status -m cpu memory battery time \
		pasink pasource -p time.format="%H:%M" -t solarized
}
```

# Documentation
See [the docs](https://bumblebee-status.readthedocs.io) for detailed documentation.

See [FAQ](https://bumblebee-status.readthedocs.io/en/main/FAQ.html) for. well, FAQs.

Other resources:

* A list of [available modules](https://bumblebee-status.readthedocs.io/en/main/modules.html)
* [How to write a module](https://bumblebee-status.readthedocs.io/en/main/development/module.html)
* [How to write a theme](https://bumblebee-status.readthedocs.io/en/main/development/theme.html)

# Installation
```
# from git (development snapshot)
$ git clone git://github.com/tobi-wan-kenobi/bumblebee-status

# from AUR:
git clone https://aur.archlinux.org/bumblebee-status.git
cd bumblebee-status
makepkg -sicr

# from PyPI (thanks @tony):
# will install bumblebee-status into ~/.local/bin/bumblebee-status
pip install --user bumblebee-status
```

There is also a SlackBuild available here: [slackbuilds:bumblebee-status](http://slackbuilds.org/repository/14.2/desktop/bumblebee-status/) - many thanks to [@Tonus1](https://github.com/Tonus1)!

An ebuild, for Gentoo Linux, is available on [gallifrey overlay](https://github.com/fedeliallalinea/gallifrey/tree/master/x11-misc/bumblebee-status). Instructions for adding the overlay can be found [here](https://github.com/fedeliallalinea/gallifrey/blob/master/README.md).

bumblebee-status is also avaliable in nixpkgs unstable channel- many thanks to [@augustebaum][https://github.com/augustebaum]!

For installing from nixpkgs, add the following snippet into your `configuration.nix`:

```nix
{
  environment.systemPackages = with pkgs; [
      (bumblebee-status.override{plugins = p:[p.cpu];})
  ];
}
```
replace `[p.cpu]` with the list of plugins that you want to use.

# Dependencies
[Available modules](https://bumblebee-status.readthedocs.io/en/main/modules.html) lists the dependencies (Python modules and external executables)
for each module. If you are not using a module, you don't need the dependencies.

Some themes (e.g. all ‘powerline’ themes) require Font Awesome http://fontawesome.io/ and a powerline-compatible font (powerline-fonts) https://github.com/powerline/fonts

# Usage
## Normal usage
In your i3wm configuration, modify the *status_command* for your i3bar like this:

```bash
bar {
	status_command <path to bumblebee-status/bumblebee-status> \
		-m <list of modules> \
		-p <list of module parameters> \
		-t <theme>
}
```

You can retrieve a list of modules (and their parameters) and themes by entering:
```bash
$ cd bumblebee-status
$ ./bumblebee-status -l themes
$ ./bumblebee-status -l modules
```

To change the update interval, use:
```bash
$ ./bumblebee-status -m <list of modules> -p interval=<interval in seconds>
```

The update interval can also be changed on a per-module basis, like this:
```bash
$ ./bumblebee-status -m cpu memory -p cpu.interval=5s memory.interval=1m
```

All modules can be given "aliases" using `<module name>:<alias>`, by which they can be parametrized, for example:

```bash
$ ./bumblebee-status -m disk:root disk:home -p root.path=/ home.path=/home
```

As a simple example, this is what my i3 configuration looks like:

```bash
bar {
	font pango:Inconsolata 10
	position top
	tray_output none
	status_command ~/.i3/bumblebee-status/bumblebee-status -m nic disk:root cpu \
		memory battery date time pasink pasource dnf \
		-p root.path=/ time.format="%H:%M CW %V" date.format="%a, %b %d %Y" \
		-t solarized-powerline
}

```

Restart i3wm and - that's it!

# Examples

[List of themes](https://bumblebee-status.readthedocs.io/en/main/themes.html)


# DeepState

[![Slack Chat](http://slack.empirehacking.nyc/badge.svg)](https://slack.empirehacking.nyc/)

DeepState is a framework that provides C and C++ developers with a common interface to various symbolic execution and fuzzing engines. Users can write one test harness using a Google Test-like API, then execute it using multiple backends without having to learn the complexities of the underlying engines. It supports writing unit tests and API sequence tests, as well as automatic test generation. Read more about the goals and design of DeepState in our [paper](https://agroce.github.io/bar18.pdf).

The
[2018 IEEE Cybersecurity Development Conference](https://secdev.ieee.org/2018/home)
included a
[full tutorial](https://github.com/trailofbits/publications/tree/master/workshops/DeepState:%20Bringing%20vulnerability%20detection%20tools%20into%20the%20development%20lifecycle%20-%20SecDev%202018)
on effective use of DeepState.

Table of Contents
=================
  * [DeepState in a Nutshell](#deepstate-in-a-nutshell)
  * [Articles describing DeepState](#articles-describing-deepstate)
  * [Overview of Features](#overview-of-features)
  * [Build'n'run](#buildnrun)
     * [Supported Platforms](#supported-platforms)
     * [Dependencies](#dependencies)
     * [Building on Ubuntu 18.04 (Bionic)](#building-on-ubuntu-1804-bionic)
     * [Building on Windows 10](#building-on-windows-10)
     * [Installing](#installing)
     * [Installation testing](#installation-testing)
     * [Docker](#docker)
  * [Documentation](#documentation)
  * [Contributing](#contributing)
  * [Trophy case](#trophy-case)
  * [License](#license)

## DeepState in a Nutshell

If you want to jump right in, or are having trouble with building DeepState, you can just use a Docker that is pre-built and has compiled versions of several of the easiest examples of DeepState in use:

```shell
docker pull agroce/deepstate_examples_aflpp
docker run -it agroce/deepstate_examples_aflpp
```

Then within the DeepState docker container, go to an example:
```shell
cd ~/examples/fuzz_tcas
deepstate-afl ./TCAS_AFL -o fuzz_afl --fuzzer_out --timeout 120
./TCAS_cov --input_test_files_dir fuzz_afl/the_fuzzer/queue/
llvm-cov-9 gcov TCAS_driver.cpp  -b
```

This runs the AFL++ fuzzer on the TCAS code (https://en.wikipedia.org/wiki/Traffic_collision_avoidance_system), a long-used example program in software testing.  After two minutes of fuzzing, we run a version of the test driver that collects code coverage, and see how much of the code AFL has managed to cover in two minutes.

NOTE 1: The above docker is built using AFL++ instead of AFL for "AFL" fuzzing.  You can use agroce/deepstate_examples instead if for some reason you prefer "classic" AFL.

NOTE 2: You may need to modify `/proc/sys/kernel/core_pattern` on your host for AFL to run properly, e.g.:

```shell
echo core | sudo tee /proc/sys/kernel/core_pattern
```

Finally, we can look at the failing tests AFL produces:

```shell
./TCAS --input_test_files_dir fuzz_afl/the_fuzzer/crashes/ --min_log_level=0
```

Inspecting `TCAS_driver.cpp` and `Makefile` will give a good idea of how DeepState can be used.  The other examples, including the one in the original DeepState blog post, are similar in structure and usage.

## Articles describing DeepState

* [Fuzzing an API with DeepState (Part 1)](https://blog.trailofbits.com/2019/01/22/fuzzing-an-api-with-deepstate-part-1)
* [Fuzzing an API with DeepState (Part 2)](https://blog.trailofbits.com/2019/01/23/fuzzing-an-api-with-deepstate-part-2)
* [Fuzzing Unit Tests with DeepState and Eclipser](https://blog.trailofbits.com/2019/05/31/fuzzing-unit-tests-with-deepstate-and-eclipser)
* [DeepState Now Supports Ensemble Fuzzing](https://blog.trailofbits.com/2019/09/03/deepstate-now-supports-ensemble-fuzzing/)
* [Everything You Ever Wanted To Know About Test-Case Reduction, But Didn’t Know to Ask](https://blog.trailofbits.com/2019/11/11/test-case-reduction/)

## Overview of Features

* Tests look like Google Test, but can use symbolic execution/fuzzing to generate data (parameterized unit testing)
  * Easier to learn than binary analysis tools/fuzzers, but provides similar functionality
* Already supports Manticore, Angr, libFuzzer, file-based fuzzing with
  e.g., AFL or Eclipser; more back-ends likely in future
  * Switch test generation tool without re-writing test harness
    * Work around show-stopper bugs
    * Find out which tool works best for your code under test
    * Different tools find different bugs/vulnerabilities
    * Fair way to benchmark/bakeoff tools
* Provides test replay for regression [plus effective automatic test case reduction to aid debugging](https://blog.trailofbits.com/2019/11/11/test-case-reduction/)
* Supports API-sequence generation with extensions to Google Test interface
  * Concise readable way (OneOf) to say "run one of these blocks of code"
  * Same construct supports fixed value set non-determinism
  * E.g., writing a POSIX file system tester is pleasant, not painful as in pure Google Test idioms
* Provides high-level strategies for improving symbolic execution/fuzzing effectiveness
  * Pumping (novel to DeepState) to pick concrete values when symbolic execution is too expensive
  * Automatic decomposition of integer compares to guide coverage-driven fuzzers
  * Strong support for automated [swarm testing](https://agroce.github.io/issta12.pdf)

To put it another way, DeepState sits at the intersection of
*property-based testing*, *traditional unit testing*, *fuzzing*, and
*symbolic execution*.  It lets you perform property-based unit testing
using fuzzing or symbolic execution as a back end to generate data, and saves the
results so that what DeepState finds can easily be used in
deterministic settings such as regression testing or CI.

## Build'n'run

### Supported Platforms

DeepState currently targets Linux, Windows, with macOS support in progress
(the fuzzers work fine, but symbolic execution is not well-supported
yet, without a painful cross-compilation process). No current support for ARM64 architecture,
 this includes Apple Silicon processors, as there is no support for multilib compilers.

### Dependencies

Build:

- CMake
- GCC and G++ with multilib support
- Python 3.6 (or newer)
- Setuptools

Runtime:

- Python 3.6 (or newer)
- Z3 (for the Manticore backend)

### Building on Ubuntu 18.04 (Bionic)

First make sure you install [Python 3.6 or greater](https://askubuntu.com/a/865569). Then use this command line to install additional requirements and compile DeepState:

**Building Deepstate**
```shell
sudo apt update && sudo apt-get install build-essential gcc-multilib g++-multilib cmake python3-setuptools python3-dev libffi-dev z3
sudo apt-add-repository ppa:sri-csl/formal-methods
sudo apt-get update
sudo apt-get install yices2
git clone https://github.com/trailofbits/deepstate deepstate
mkdir deepstate/build && cd deepstate/build
cmake ../
make
sudo make install
```

### Changing file permissions
```shell
cd deepstate
sudo chmod -R 755 .
sudo chown -R username:groupname .
```

### Installing Dependencies on Ubuntu if issues arise
**CMake:**
```shell
sudo apt install cmake
```

**GCC & G++ with multilib support:**
```shell
sudo apt-get install gcc-multilib
sudo apt-get install g++-multilib
```

**Installing the latest version of Python via CLI:**
```shell
sudo apt-get update && sudo apt upgrade
sudo apt install wget build-essential libncursesw5-dev libssl-dev \
libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.11
```

**Setup Tools:**

Skip the first command below if pip is already installed.
```shell
sudo apt install python3-pip
pip3 install setuptools
```

**Z3:**
```shell
sudo apt install z3
```

### Building on Windows 10
If you want to compile DeepState on Windows make sure to install MinGW with MSYS2 by following the [installation instructions](https://www.msys2.org/#installation). After the installation is finished, select an environment and launch that version of the environment from the Windows programs menu(if in doubt, choose MINGW64 or UCRT64). Then, use the command below to install all of your environment's dependencies and compile DeepState:
```shell
pacman -Syyu
pacman -S mingw-w64-x86_64-python3 mingw-w64-x86_64-python-setuptools mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-libffi mingw-w64-x86_64-make
pacman -S make git

git clone https://github.com/trailofbits/deepstate deepstate
mkdir deepstate/build && cd deepstate/build
cmake -G "Unix Makefiles" ../
make
make install
```

NOTE: If you decide to use UCRT64, keep in mind to change `x86_64` to `ucrt-x86_64` in the second pacman command, i.e. `mingw-w64-x86_64-python3` gets replaced with `mingw-w64-ucrt-x86_64-python3`.

### Installing

Assuming the DeepState build resides in `$DEEPSTATE`, run the following commands to install the DeepState python package:

```shell
virtualenv venv
. venv/bin/activate
python $DEEPSTATE/build/setup.py install
```

The `virtualenv`-enabled `$PATH` should now include two executables: `deepstate` and `deepstate-angr`. These are _executors_, which are used to run DeepState test binaries with specific backends (automatically installed as Python dependencies). The `deepstate` or `deepstate-manticore` executor uses the Manticore backend while `deepstate-angr` uses angr. They share a common interface where you may specify a number of workers and an output directory for saving backend-generated test cases.

If you try using Manticore, and it doesn't work, but you definitely have the latest Manticore installed, check the `.travis.yml` file.  If that grabs a Manticore other than the master version, you can try using the version of Manticore we use in our CI tests.  Sometimes Manticore makes a breaking change, and we are behind for a short time.

### Installation testing

You can check your build using the test binaries that were (by default) built and emitted to `deepstate/build/examples`. For example, to use angr to symbolically execute the `IntegerOverflow` test harness with 4 workers, saving generated test cases in a directory called `out`, you would invoke:

```shell
deepstate-angr --num_workers 4 --output_test_dir out $DEEPSTATE/build/examples/IntegerOverflow
```

 The resulting `out` directory should look something like:

 ```
 out
└── IntegerOverflow.cpp
    ├── SignedInteger_AdditionOverflow
    │   ├── a512f8ffb2c1bb775a9779ec60b699cb.fail
    │   └── f1d3ff8443297732862df21dc4e57262.pass
    └── SignedInteger_MultiplicationOverflow
        ├── 6a1a90442b4d898cb3fac2800fef5baf.fail
        └── f1d3ff8443297732862df21dc4e57262.pass
```

To run these tests, you can just use the native executable, e.g.:

```shell
$DEEPSTATE/build/examples/IntegerOverflow --input_test_dir out
```

to run all the generated tests, or

```shell
$DEEPSTATE/build/examples/IntegerOverflow --input_test_files_dir out/IntegerOverflow.cpp/SignedInteger_AdditionOverflow --input_which_test SignedInteger_AdditionOverflow
```

to run the tests in one directory (in this case, you want to specify
which test to run, also).  You can also run a single test, e.g.:

```shell
$DEEPSTATE/build/examples/IntegerOverflow --input_test_file out/IntegerOverflow.cpp/SignedInteger_AdditionOverflow/a512f8ffb2c1bb775a9779ec60b699cb.fail--input_which_test SignedInteger_AdditionOverflow
```

In the absence of an `--input_which_test` argument, DeepState defaults
to the first-defined test.  Run the native executable with the `--help`
argument to see all DeepState options.

### Docker

You can also try out Deepstate with Docker, which is the easiest way
to get all the fuzzers and tools up and running on any system.

The build may take about 40 minutes, because some fuzzers require us
building huge projects like QEMU or LLVM.

**Ensure that docker is installed:**

- Check out the docker website [here](https://docs.docker.com/engine/install/) for installation instructions.

**Check if docker is installed correctly:**
```bash
docker run hello-world
```

**Run these commands to install deepstate via docker:**
```bash
git clone https://github.com/trailofbits/deepstate deepstate
$ cd deepstate
$ docker build -t deepstate-base -f docker/base/Dockerfile docker/base
$ docker build -t deepstate --build-arg make_j=6 -f ./docker/Dockerfile .
$ docker run -it deepstate bash
user@a17bc44fd259:~/deepstate$ cd build/examples
user@a17bc44fd259:~/deepstate/build/examples$ deepstate-angr ./Runlen
user@a17bc44fd259:~/deepstate/build/examples$ mkdir tmp && deepstate-eclipser ./Runlen -o tmp --timeout 30
user@a17bc44fd259:~/deepstate/build/examples$ cd ../../build_libfuzzer/examples
user@a17bc44fd259:~/deepstate/build_libfuzzer/examples$ ./Runlen_LF -max_total_time=30
user@a17bc44fd259:~/deepstate/build_libfuzzer/examples$ cd ../../build_afl/examples
user@a17bc44fd259:~/deepstate/build_afl/examples$ mkdir foo && echo x > foo/x && mkdir afl_Runlen2
user@a17bc44fd259:~/deepstate/build_afl/examples$ $AFL_HOME/afl-fuzz -i foo -o afl_Runlen -- ./Runlen_AFL --input_test_file @@ --no_fork --abort_on_fail
user@a17bc44fd259:~/deepstate/build_afl/examples$ deepstate-afl -o afl_Runlen2 ./Runlen_AFL --fuzzer_out
```

**How to use docker without sudo:**
```bash
sudo groupadd docker
sudo gpasswd -a $USER docker
newgrp docker
```

**If this error occurs:**
```bash
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
```
**Run this command:**
```bash
systemctl start docker
```

## Documentation

Check out [docs](/docs) folder:

* [Basic usage](/docs/basic_usage.md)
* [Writing a test harness](/docs/test_harness.md)
* [Fuzzing](/docs/fuzzing.md)
* [Swarm testing](/docs/swarm_testing.md)

## External Tools

DeepState can be used to test R packages written using the popular Rcpp package.  The [Rcppdeepstate tool](https://github.com/akhikolla/RcppDeepState) is described in a [paper presented at the 2021 IEEE International Symposium on Software Reliability Engineering](https://agroce.github.io/issre21.pdf).

## Contributing

All accepted PRs are awarded bounties by Trail of Bits. Join the #deepstate channel on the [Empire Hacking Slack](https://slack.empirehacking.nyc/) to discuss ongoing development and claim bounties. Check the [good first issue](https://github.com/trailofbits/deepstate/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) label for suggested contributions.

## Trophy case

We have not yet applied DeepState to many targets, but it was responsible for finding the following confirmed bugs (serious faults are in bold):

- https://github.com/Blosc/c-blosc2/issues/93
- https://github.com/Blosc/c-blosc2/issues/94
- **https://github.com/Blosc/c-blosc2/issues/95** (bug causing compression engine to return incorrect uncompressed data) **FIXED**
- **https://github.com/FooBarWidget/boyer-moore-horspool/issues/4** (implementation of Turbo version of Boyer-Moore string search can fail to find present string)

## License

DeepState is released under [The Apache License 2.0](LICENSE).


# svtplay-dl
[![Build Status Actions](https://img.shields.io/github/actions/workflow/status/spaam/svtplay-dl/tests.yaml?label=Build%20status%20action)](https://github.com/spaam/svtplay-dl/actions) [![Discord](https://img.shields.io/static/v1?label=chat&message=discord&color=green&style=flat&logo=discord)](https://discord.gg/S2YK6Jtb3P)

## Installation

### MacOS

If you have [Homebrew](https://brew.sh/) on your machine you can install by running:

```
    brew install svtplay-dl
```
You will need to run `brew install ffmpeg` afterwards, if you don't already have one of these packages.

### Debian and Ubuntu

svtplay-dl is available in Debian strech and later and on Ubuntu 16.04 and later, which means you can install it straight away using apt. The version in their repo is often old and thus we **strongly** recommend using our own apt repo, which always include the latest version. The svtplay-dl repo for Debian / Ubuntu can be found at [apt.svtplay-dl.se](https://apt.svtplay-dl.se/).

##### Add the release PGP keys:
```
    curl -s https://svtplay-dl.se/release-key.txt | sudo apt-key add -
```

##### Add the "release" channel to your APT sources:
```
    echo "deb https://apt.svtplay-dl.se/ svtplay-dl release" | sudo tee /etc/apt/sources.list.d/svtplay-dl.list
```

##### Update and install svtplay-dl:
```
    sudo apt-get update

    sudo apt-get install svtplay-dl
```

### Solus

svtplay-dl is avaliable in the [Solus](https://getsol.us.com/) repository and can be installed by simply running:

```
sudo eopkg it svtplay-dl
```

### Windows

You can download the Windows binaries from [svtplay-dl.se](https://svtplay-dl.se/)

If you want to build your own Windows binaries:

1. Install [cx_freeze](https://anthony-tuininga.github.io/cx_Freeze/)
3. Follow the steps listed under [From source](#from-source)
4. cd path\to\svtplay-dl && mkdir build
5. `pip install -e .`
6. `python setversion.py`  # this will change the version string to a more useful one
7. `python %PYTHON%\\Scripts\\cxfreeze --include-modules=cffi,queue,idna.idnadata --target-dir=build bin/svtplay-dl`
8. Find binary in build folder. you need `svtplay-dl.exe` and `pythonXX.dll` from that folder to run `svtplay-dl.exe`

### Other systems with python

```
    pip3 install svtplay-dl
```

### Any UNIX (Linux, BSD, macOS, etc.)

##### Download with curl
```
sudo curl -L https://svtplay-dl.se/download/latest/svtplay-dl -o /usr/local/bin/svtplay-dl
```

##### Make it executable
```
sudo chmod a+rx /usr/local/bin/svtplay-dl
```

### From source

If packaging isn’t available for your operating system, or you want to
use a non-released version, you’ll want to install from source. Use git
to download the sources:

```
    git clone https://github.com/spaam/svtplay-dl
```

svtplay-dl requires the following additional tools and libraries. They
are usually available from your distribution’s package repositories. If
you don’t have them, some features will not be working.

-  [Python](https://www.python.org) 3.6 or higher
-  [cryptography](https://cryptography.io/en/latest) to download encrypted HLS streams
-  [PyYaml](https://github.com/yaml/pyyaml) for configure file
-  [Requests](https://2.python-requests.org)
-  [PySocks](https://github.com/Anorov/PySocks) to enable proxy support
-  [ffmpeg](https://ffmpeg.org) for postprocessing and/or for DASH streams ([ffmpeg](https://ffmpeg.zeranoe.com) for Windows)

##### To install it, run:

```
    sudo python3 setup.py install
```

## After install

```
    svtplay-dl [options] URL
```

If you encounter any bugs or problems, don’t hesitate to open an issue [on github](https://github.com/spaam/svtplay-dl/issues).
Or why not join the ``#svtplay-dl`` IRC channel on Freenode?

## Supported services

This script works for:

-  aftonbladet.se
-  bambuser.com
-  comedycentral.se
-  di.se
-  dn.se
-  dplay.se
-  dr.dk
-  efn.se
-  expressen.se
-  hbo.com
-  kanal9play.se
-  nickelodeon.nl
-  nickelodeon.no
-  nickelodeon.se
-  nrk.no
-  oppetarkiv.se
-  pluto.tv (former viafree.se, viafree.dk, viafree.no)
-  ruv.is
-  svd.se
-  sverigesradio.se
-  svtplay.se
-  tv3play.ee
-  tv3play.lt
-  tv3play.lv
-  tv4.se
-  tv4play.se
-  twitch.tv
-  ur.se
-  urplay.se
-  vg.no
-  viagame.com

## License

This project is licensed under [The MIT License (MIT)](LICENSE)
Homepage: [svtplay-dl.se](https://svtplay-dl.se/)


.. raw:: html

django-machina

        A Django forum engine for building powerful community driven websites.

|
|

Django-machina is a forum framework for Django providing a way to build community-driven websites.
It offers a full-featured yet very extensible forum solution:

* Topic and post editing
* Forums tree management
* Per-forum permissions
* Anonymous posting
* Polls and attachments
* Moderation and pre-moderation
* Forum conversations search
* ...

Django-machina was built with integration in mind: the application is designed to be used inside
existing Django applications. It is not a standalone forum solution.

Django-machina was built with customization and extensibility in mind: each single functionality
of the application can be customized or overriden to accommodate with your needs.

.. contents:: Table of Contents
    :local:

Documentation
=============

Online browsable documentation is available at https://django-machina.readthedocs.org.

Head over to the documentation for all the details on how to set up your forum and how to customize
it to suit your needs.

Requirements
============

Python 3.6+, Django 3.2+. Please refer to the requirements_ section of the documentation for a full
list of dependencies.

.. _requirements: https://django-machina.readthedocs.org/en/stable/getting_started.html#requirements

Authors
=======

Morgan Aubert (`@ellmetha <https://github.com/ellmetha>`_) and contributors_. See ``AUTHORS`` for
more details.

.. _contributors: https://github.com/ellmetha/django-machina/contributors

License
=======

BSD. See ``LICENSE`` for more details.


[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/commitizen-tools/commitizen/pythonpackage.yml?label=python%20package&logo=github&logoColor=white&style=flat-square)](https://github.com/commitizen-tools/commitizen/actions)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=flat-square)](https://conventionalcommits.org)
[![PyPI Package latest release](https://img.shields.io/pypi/v/commitizen.svg?style=flat-square)](https://pypi.org/project/commitizen/)
[![PyPI Package download count (per month)](https://img.shields.io/pypi/dm/commitizen?style=flat-square)](https://pypi.org/project/commitizen/)
[![Supported versions](https://img.shields.io/pypi/pyversions/commitizen.svg?style=flat-square)](https://pypi.org/project/commitizen/)
[![homebrew](https://img.shields.io/homebrew/v/commitizen?color=teal&style=flat-square)](https://formulae.brew.sh/formula/commitizen)
[![Codecov](https://img.shields.io/codecov/c/github/commitizen-tools/commitizen.svg?style=flat-square)](https://codecov.io/gh/commitizen-tools/commitizen)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?style=flat-square&logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)

![Using commitizen cli](images/demo.gif)

---

**Documentation:** [https://commitizen-tools.github.io/commitizen/](https://commitizen-tools.github.io/commitizen/)

---

## About

Commitizen is release management tool designed for teams.

Commitizen assumes your team uses a standard way of committing rules
and from that foundation, it can bump your project's version, create
the changelog, and update files.

By default, commitizen uses [conventional commits][conventional_commits], but you
can build your own set of rules, and publish them.

Using a standardized set of rules to write commits, makes commits easier to read, and enforces writing
descriptive commits.

### Features

- Command-line utility to create commits with your rules. Defaults: [Conventional commits][conventional_commits]
- Bump version automatically using [semantic versioning][semver] based on the commits. [Read More](./commands/bump.md)
- Generate a changelog using [Keep a changelog][keepchangelog]
- Update your project's version files automatically
- Display information about your commit rules (commands: schema, example, info)
- Create your own set of rules and publish them to pip. Read more on [Customization](./customization.md)

## Requirements

[Python](https://www.python.org/downloads/) `3.8+`

[Git][gitscm] `1.8.5.2+`

## Installation

To make commitizen available in your system

```bash
pip install --user -U Commitizen
```

### Python project

You can add it to your local project using one of these:

```bash
pip install -U commitizen
```

for Poetry >= 1.2.0:

```bash
poetry add commitizen --group dev
```

for Poetry < 1.2.0:

```bash
poetry add commitizen --dev
```

### macOS

via [homebrew](https://formulae.brew.sh/formula/commitizen):

```bash
brew install commitizen
```

## Usage

Most of the time this is the only command you'll run:

```sh
cz bump
```

On top of that, you can use commitizen to assist you with the creation of commits:

```sh
cz commit
```

Read more in the section [Getting Started](./getting_started.md).

### Help

```sh
$ cz --help
usage: cz [-h] [--debug] [-n NAME] [-nr NO_RAISE] {init,commit,c,ls,example,info,schema,bump,changelog,ch,check,version} ...

Commitizen is a cli tool to generate conventional commits.
For more information about the topic go to https://conventionalcommits.org/

optional arguments:
  -h, --help            show this help message and exit
  --config              the path of configuration file
  --debug               use debug mode
  -n NAME, --name NAME  use the given commitizen (default: cz_conventional_commits)
  -nr NO_RAISE, --no-raise NO_RAISE
                        comma separated error codes that won't rise error, e.g: cz -nr 1,2,3 bump. See codes at https://commitizen-
                        tools.github.io/commitizen/exit_codes/

commands:
  {init,commit,c,ls,example,info,schema,bump,changelog,ch,check,version}
    init                init commitizen configuration
    commit (c)          create new commit
    ls                  show available commitizens
    example             show commit example
    info                show information about the cz
    schema              show commit schema
    bump                bump semantic version based on the git log
    changelog (ch)      generate changelog (note that it will overwrite existing file)
    check               validates that a commit message matches the commitizen schema
    version             get the version of the installed commitizen or the current project (default: installed commitizen)
```

## Setting up bash completion

When using bash as your shell (limited support for zsh, fish, and tcsh is available), Commitizen can use [argcomplete](https://kislyuk.github.io/argcomplete/) for auto-completion. For this argcomplete needs to be enabled.

argcomplete is installed when you install Commitizen since it's a dependency.

If Commitizen is installed globally, global activation can be executed:

```bash
sudo activate-global-python-argcomplete
```

For permanent (but not global) Commitizen activation, use:

```bash
register-python-argcomplete cz >> ~/.bashrc
```

For one-time activation of argcomplete for Commitizen only, use:

```bash
eval "$(register-python-argcomplete cz)"
```

For further information on activation, please visit the [argcomplete website](https://kislyuk.github.io/argcomplete/).

## Sponsors

These are our cool sponsors!

<!-- sponsors --><!-- sponsors -->

[conventional_commits]: https://www.conventionalcommits.org
[semver]: https://semver.org/
[keepchangelog]: https://keepachangelog.com/
[gitscm]: https://git-scm.com/downloads


.. |badge package| image:: https://badge.fury.io/py/pyathena.svg
  :target: https://badge.fury.io/py/pyathena
.. |badge pypi| image:: https://img.shields.io/pypi/pyversions/PyAthena.svg
  :target: https://pypi.org/project/PyAthena/
.. |badge test| image:: https://github.com/laughingman7743/PyAthena/actions/workflows/test.yaml/badge.svg
  :target: https://github.com/laughingman7743/PyAthena/actions/workflows/test.yaml
.. |badge docs| image:: https://github.com/laughingman7743/PyAthena/actions/workflows/docs.yaml/badge.svg
  :target: https://github.com/laughingman7743/PyAthena/actions/workflows/docs.yaml
.. |badge license| image:: https://img.shields.io/pypi/l/PyAthena.svg
  :target: https://github.com/laughingman7743/PyAthena/blob/master/LICENSE
.. |badge downloads| image:: https://static.pepy.tech/badge/pyathena/month
  :target: https://pepy.tech/project/pyathena
.. |badge ruff| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
  :target: https://github.com/astral-sh/ruff
  :alt: Ruff
.. |badge mypy| image:: https://www.mypy-lang.org/static/mypy_badge.svg
  :target: https://mypy-lang.org/
  :alt: mypy

PyAthena
========

PyAthena is a Python `DB API 2.0 (PEP 249)`_ client for `Amazon Athena`_.

+---------+------------------------------------------------+
| Package | |badge package| |badge pypi| |badge downloads| |
+---------+------------------------------------------------+
| CI/CD   | |badge test| |badge docs|                      |
+---------+------------------------------------------------+
| Meta    | |badge license| |badge ruff| |badge mypy|      |
+---------+------------------------------------------------+

.. _`DB API 2.0 (PEP 249)`: https://www.python.org/dev/peps/pep-0249/
.. _`Amazon Athena`: https://docs.aws.amazon.com/athena/latest/APIReference/Welcome.html

.. _requirements:

Requirements
------------

* Python

  - CPython 3.8 3.9 3.10, 3.11 3.12

.. _installation:

Installation
------------

.. code:: bash

    $ pip install PyAthena

Extra packages:

+---------------+---------------------------------------+------------------+
| Package       | Install command                       | Version          |
+===============+=======================================+==================+
| SQLAlchemy    | ``pip install PyAthena[SQLAlchemy]``  | >=1.0.0          |
+---------------+---------------------------------------+------------------+
| Pandas        | ``pip install PyAthena[Pandas]``      | >=1.3.0          |
+---------------+---------------------------------------+------------------+
| Arrow         | ``pip install PyAthena[Arrow]``       | >=7.0.0          |
+---------------+---------------------------------------+------------------+
| fastparquet   | ``pip install PyAthena[fastparquet]`` | >=0.4.0          |
+---------------+---------------------------------------+------------------+

.. _usage:

Usage
-----

.. code:: python

    from pyathena import connect

    cursor = connect(s3_staging_dir="s3://YOUR_S3_BUCKET/path/to/",
                     region_name="us-west-2").cursor()
    cursor.execute("SELECT * FROM one_row")
    print(cursor.description)
    print(cursor.fetchall())

.. _license:

License
-------

`MIT license`_

Many of the implementations in this library are based on `PyHive`_, thanks for `PyHive`_.

.. _`MIT license`: LICENSE
.. _`PyHive`: https://github.com/dropbox/PyHive

Links
-----

- Documentation: https://laughingman7743.github.io/PyAthena/
- PyPI Releases: https://pypi.org/project/PyAthena/
- Source Code: https://github.com/laughingman7743/PyAthena/
- Issue Tracker: https://github.com/laughingman7743/PyAthena/issues


Live Coding in Python
=====================

[![Python Build Status]][actions]
[![HTML Build Status]][actions]
[![Code Coverage]][codecov]
[![OpenSSF Best Practices]][openssf]
[![PyCharm downloads]][pycharm plugin]
[![Emacs downloads]][emacs plugin]
[![Sublime downloads]][sublime plugin]
[![space-tracer downloads]][space-tracer]
[![Supported Python versions]][space-tracer]
[![DOI]][zenodo]

Visualize your Python code while you type it in PyCharm, Emacs, Sublime Text, or
even your browser.

[Python Build Status]: https://github.com/donkirkby/live-py-plugin/actions/workflows/py-build.yml/badge.svg?branch=master
[HTML Build Status]: https://github.com/donkirkby/live-py-plugin/actions/workflows/html-build.yml/badge.svg?branch=master
[actions]: https://github.com/donkirkby/live-py-plugin/actions
[Code Coverage]: https://codecov.io/gh/donkirkby/live-py-plugin/coverage.svg
[codecov]: https://app.codecov.io/gh/donkirkby/live-py-plugin
[OpenSSF Best Practices]: https://bestpractices.coreinfrastructure.org/projects/7182/badge
[openssf]: https://bestpractices.coreinfrastructure.org/projects/7182
[PyCharm downloads]: https://img.shields.io/jetbrains/plugin/d/9742?label=PyCharm%20%E2%86%93
[pycharm plugin]: https://plugins.jetbrains.com/plugin/9742
[Emacs downloads]: https://img.shields.io/badge/Emacs%20%E2%86%93-377k-brightgreen
[emacs plugin]: https://melpa.org/#/live-py-mode
[Sublime downloads]: https://img.shields.io/packagecontrol/dt/Live%20Coding%20in%20Python?label=Sublime%20%E2%86%93
[sublime plugin]: https://packagecontrol.io/packages/Live%20Coding%20in%20Python
[space-tracer downloads]: https://static.pepy.tech/personalized-badge/space-tracer?left_color=grey&right_color=brightgreen&left_text=space-tracer%20%E2%86%93&period=total
[space-tracer]: https://pypi.org/project/space-tracer/
[Supported Python versions]: https://img.shields.io/pypi/pyversions/space-tracer.svg
[DOI]: https://zenodo.org/badge/4332096.svg
[zenodo]: https://zenodo.org/badge/latestdoi/4332096

Live coding tightens the feedback loop between making a change to your code
and seeing the behaviour change. As you type your code, it will run over and
over, showing a visualization of the program state, a matplotlib graph, a
Pillow image, or turtle graphics. If you make a mistake, you'll immediately see
the problem and where it went wrong.

To see how to use one of the Live Coding in Python plugins, watch the
[demo video][video] or read the getting started pages for [PyCharm], [Emacs],
or [Sublime Text]. Want to try it without installing anything? Try the
[browser version]. You can also try [Space Tracer], the command-line tool that
trades time for space when you debug. You might also find some useful examples
in the [tools folder][tools]. To learn more, read about [how it works][how].

![Screenshot of a star diagram][screenshot]

Special thanks to [James Davies] for contributing the Sublime Text support,
to [Antti Kaihola][akaihola] and [Christoph Paulik][cpaulik] for
contributing the Emacs support, and to [Brecht Willems] for the idea of flag
tutorials. Thanks to [all the contributors][hatrack] for
helping in all kinds of ways, and thanks to [JetBrains] for the free PyCharm and
IDEA licenses.

If you like this project, check out some of my [other projects][projects].

[how]: http://donkirkby.github.io/live-py-plugin/howitworks.html
[screenshot]: https://donkirkby.github.io/live-py-plugin/images/demo_star.png
[akaihola]: https://github.com/akaihola
[cpaulik]: https://github.com/cpaulik
[JetBrains]: https://www.jetbrains.com/?from=live-py-plugin
[browser version]: https://donkirkby.github.io/live-py-plugin/demo/
[PyCharm]: https://donkirkby.github.io/live-py-plugin/starting_pycharm.html
[Emacs]: https://donkirkby.github.io/live-py-plugin/starting_emacs.html
[Sublime Text]: https://donkirkby.github.io/live-py-plugin/starting_sublime_text.html
[Space Tracer]: https://donkirkby.github.io/live-py-plugin/space_tracer.html
[James Davies]: https://github.com/Derfies
[Brecht Willems]: https://github.com/BTWS2

Feature Comparison
------------------
So far, the Emacs mode seems to be the most popular way to use live coding in
Python, and the PyCharm plugin has the most features. The browser version might
be the best for students, because it has tutorials and doesn't need to be
installed.

| Feature              | PyCharm |  Emacs  | Sublime | browser | space_tracer |
| -------------------- | ------- | ------- | ------- | ------- | ------------ |
| variable assignments |    Y    |    Y    |    Y    |    Y    |       Y      |
| looping              |    Y    |    Y    |    Y    |    Y    |       Y      |
| function calls       |    Y    |    Y    |    Y    |    Y    |       Y      |
| errors and exceptions|    Y    |    Y    |    Y    |    Y    |       Y      |
| print function       |    Y    |    Y    |    Y    |    Y    |       Y      |
| unit tests           |    Y    |    Y    |    Y    |         |       Y      |
| turtle graphics      |    Y    |         |         |    Y    |              |
| matplotlib preview   |    Y    |         |    Y    |         |              |
| pyglet preview       |    Y    |         |    Y    |         |              |
| tutorials and goals  |         |         |         |    Y    |              |

If you find the project useful, help us [make it better][contributing].

Installing the PyCharm plugin
-----------------------------
This assumes you already have [PyCharm] installed, you have configured a
Python interpreter, and you can run a Python script normally.

1. From the File menu, choose Settings....
2. Click on the Plugins section.
3. Click the Browse Repositories... button.
4. Type live coding in the search box, and click on the "Live Coding in Python"
   entry in the list below.
5. Click the green Install button on the right.
6. Click the Restart PyCharm button.
7. Close all the dialog boxes by clicking OK, then let PyCharm restart when it
   asks.
8. Open a Python file.
9. Run the Python file normally, as a script or a unit test.
10. With the same run configuration selected in the drop down, choose Start
    Live Coding from the Run menu.

Uninstalling the PyCharm plugin
-------------------------------
1. From the File menu, choose Settings....
2. Click on the Plugins section.
3. In the list of plugins, click on Live Coding in Python.
4. Click the Uninstall button on the right.
5. Click the Restart PyCharm button.
6. Close all the dialog boxes by clicking OK, then let PyCharm restart.

Installing the Emacs mode
-------------------------
It's probably easiest to use the MELPA package archive, as described in this
section, but the next section gives instructions for installing without MELPA.

1. [Install GNU Emacs] if you don't already have it.
2. [Install MELPA][melpa]. You probably want to follow the instructions
   for the stable version, instead of the default bleeding-edge version.
3. Launch the package installer with `M-x package-list-packages`.
4. Find the package with `C-s live-py-mode`. If you can't find it, run
   `M-x package-refresh-contents`, and try again.
5. Mark the package to install with `i`, then execute the installation with
   `x`.
6. Open any Python file, and activate live-py-mode with `M-x live-py-mode`.
   You should see an extra window on the right that shows the results of running
   your code.
7. Type `C-h m` and scroll down to the **Live-Py** section to see all the
   advanced features that let you run other versions of Python or drive your
   live coding from another script or a unit test.

[melpa]: https://melpa.org/#/getting-started

Installing the Emacs mode without MELPA
---------------------------------------
1. [Install GNU Emacs] if you don't already have it.
2. Clone the latest version of the live-py Emacs mode:

        git clone https://github.com/donkirkby/live-py-plugin.git

3. Copy the Emacs Lisp file and the supporting Python files into a directory
   which is in your Emacs `load-path`. For example:

        cd live-py-plugin
        mkdir -p ~/.emacs.d/packages
        cp emacs-live-py-mode/live-py-mode.el plugin/PySrc/space_tracer ~/.emacs.d/packages

   Add ~/.emacs.d/ to your `load-path` in `~/.emacs.d/init.el` or `~/.emacs`:

        (add-to-list 'load-path "~/.emacs.d/packages")
4. Load the Lisp library in your `~/.emacs.d/init.el` or `~/.emacs`:

        (require 'live-py-mode)
5. Restart Emacs.
6. Open any Python file, and activate live-py-mode with `M-x live-py-mode`.
   You should see an extra window on the right that shows the results of running
   your code.
7. Type `C-h m` and scroll down to the **Live-Py** section to see all the
    advanced features that let you run other versions of Python or drive your
    live coding from another script or a unit test.

Uninstalling the Emacs mode
---------------------------
If you installed with MELPA, just use it to uninstall. If not, follow these
steps:

1. Remove the files you copied into `~/.emacs.d/`:
2. Revert additions to `~/.emacs.d/init.el` or `~/.emacs`.
3. Restart Emacs.

Installing the Sublime Text plugin
----------------------------------
It's easiest to install from package control, but you can find a manual method
in the CONTRIBUTING file.

1. Install [package control].
2. Open the command palette by typing
    Ctrl+Shift+P.
3. Type "Package" and then select Package Control: Install Package.
4. Start typing "Live Coding in Python" and select it when it appears in the
    list.
5. When it finishes installing, you should see a new "Live Coding" menu.
6. Live coding should now work for simple scripts.
7. Navigate to Preferences -> Package settings -> Live Coding.
8. Set the path to your preferred Python executable, particularly if you want to
    use a virtual environment. The default is `python`.
9. Save and close this pane.
10. Open or create a Python file.
11. Navigate to Live Coding -> Start
12. This should bring up a new pane on the right with the live coding display.
13. Begin typing in the left pane and see the code trace results on the right.

[package control]: https://packagecontrol.io/installation

Uninstalling the Sublime Text plugin
------------------------------------

1. Open Sublime Text 3.
2. Open the command palette by typing
    Ctrl+Shift+P.
3. Type "Package" and then select Package Control: Remove Package.
4. Start typing "Live Coding in Python" and select it when it appears in the
    list.

[video]: https://www.youtube.com/watch?v=Vdr2l3yNFH4
[Install GNU Emacs]: http://www.gnu.org/software/emacs/
[tools]: https://github.com/donkirkby/live-py-plugin/tree/master/test/PySrc/tools
[projects]: https://donkirkby.github.io/
[contributing]: https://github.com/donkirkby/live-py-plugin/blob/master/CONTRIBUTING.md
[hatrack]: https://labhr.github.io/hatrack/#repo=donkirkby/live-py-plugin


---

![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 - Status](https://img.shields.io/pypi/status/NiaPy.svg)
![PyPI - Downloads](https://img.shields.io/pypi/dm/NiaPy.svg)
[![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)
[![Packaging status](https://repology.org/badge/tiny-repos/python:niapy.svg)](https://repology.org/project/python:niapy/versions)
[![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)

![GitHub commit activity](https://img.shields.io/github/commit-activity/w/NiaOrg/NiaPy.svg)
[![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)

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1205048.svg)](https://doi.org/10.5281/zenodo.1205048)
[![DOI](http://joss.theoj.org/papers/10.21105/joss.00613/status.svg)](https://doi.org/10.21105/joss.00613)

Nature-inspired algorithms are a very popular tool for solving optimization problems. Numerous variants of nature-inspired algorithms have been developed ([paper 1](https://arxiv.org/abs/1307.4186), [paper 2](https://www.mdpi.com/2076-3417/8/9/1521)) since the beginning of their era. To prove their versatility, those were tested in various domains on various applications, especially when they are hybridized, modified or adapted. However, implementation of nature-inspired algorithms is sometimes a difficult, complex and tedious task. In order to break this wall, NiaPy is intended for simple and quick use, without spending time for implementing algorithms from scratch.

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

# Mission

Our mission is to build a collection of nature-inspired algorithms and create a simple interface for managing the optimization process. NiaPy offers:

- numerous optimization problem implementations,
- use of various nature-inspired algorithms without struggle and effort with a simple interface,
- easy comparison between nature-inspired algorithms, and
- export of results in various formats such as Pandas DataFrame, JSON or even Excel.

# Installation

Install NiaPy with pip:

```sh
pip install niapy
```

To install NiaPy with conda, use:

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

To install NiaPy on Fedora, use:

```sh
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
```

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

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

To install NiaPy on NixOS, please use:

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

To install NiaPy on Void Linux, use:

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

## Install from source

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

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

# Algorithms

[Click here](Algorithms.md) for the list of implemented algorithms.

# Problems

[Click here](Problems.md) for the list of implemented test problems.

# Usage

After installation, you can import NiaPy as any other Python module:

```sh
$ python
>>> import niapy
>>> niapy.__version__
```

Let's go through a basic and advanced example.

## Basic Example
Let’s say, we want to try out PSO against the Pintér problem function. Firstly, we have to create new file, with name, for example *basic_example.py*. Then we have to import chosen algorithm from NiaPy, so we can use it. Afterwards we initialize ParticleSwarmAlgorithm class instance and run the algorithm. Given bellow is the complete source code of basic example.

```python
from niapy.algorithms.basic import ParticleSwarmAlgorithm
from niapy.task import Task

# we will run 10 repetitions of Weighted, velocity clamped PSO on the Pinter problem
for i in range(10):
    task = Task(problem='pinter', dimension=10, max_evals=10000)
    algorithm = ParticleSwarmAlgorithm(population_size=100, w=0.9, c1=0.5, c2=0.3, min_velocity=-1, max_velocity=1)
    best_x, best_fit = algorithm.run(task)
    print(best_fit)
```

Given example can be run with *python basic_example.py* command and should give you similar output as following:

```sh
0.008773534890863646
0.036616190934621755
186.75116812592546
0.024186452828927896
263.5697469837348
45.420706924365916
0.6946753611091367
7.756100204780568
5.839673314425907
0.06732518679742806
```

## Advanced Example

In this example we will show you how to implement a custom problem class and use it with any of
implemented algorithms. First let's create new file named advanced_example.py. As in the previous examples
we wil import algorithm we want to use from niapy module.

For our custom optimization function, we have to create new class. Let's name it *MyProblem*. In the initialization
method of *MyProblem* class we have to set the *dimension*, *lower* and *upper* bounds of the problem. Afterwards we have to
override the abstract method _evaluate which takes a parameter *x*, the solution to be evaluated, and returns the function value.
Now we should have something similar as is shown in code snippet bellow.

```python
import numpy as np
from niapy.task import Task
from niapy.problems import Problem
from niapy.algorithms.basic import ParticleSwarmAlgorithm

# our custom problem class
class MyProblem(Problem):
    def __init__(self, dimension, lower=-10, upper=10, *args, **kwargs):
        super().__init__(dimension, lower, upper, *args, **kwargs)

    def _evaluate(self, x):
        return np.sum(x ** 2)
```

Now, all we have to do is to initialize our algorithm as in previous examples and pass an instance of our MyProblem class as the problem argument.

```python
my_problem = MyProblem(dimension=20)
for i in range(10):
    task = Task(problem=my_problem, max_iters=100)
    algo = ParticleSwarmAlgorithm(population_size=100, w=0.9, c1=0.5, c2=0.3, min_velocity=-1, max_velocity=1)

    # running algorithm returns best found minimum
    best_x, best_fit = algo.run(task)
    # printing best minimum
    print(best_fit)
```

Now we can run our advanced example with following command: *python advanced_example.py*. The results should be similar to those bellow.

```sh
0.002455614050761476
0.000557652972392164
0.0029791325679865413
0.0009443595274525336
0.001012658824492069
0.0006837236892816072
0.0026789725774685495
0.005017746993004601
0.0011654473402322196
0.0019074442166293853
```

For more usage examples please look at [examples](/examples) folder.

More advanced examples can also be found in the [NiaPy-examples repository](https://github.com/NiaOrg/NiaPy-examples).

# Cite us

Are you using NiaPy in your project or research? Please cite us!

## Plain format

```
      Vrbančič, G., Brezočnik, L., Mlakar, U., Fister, D., & Fister Jr., I. (2018).
      NiaPy: Python microframework for building nature-inspired algorithms.
      Journal of Open Source Software, 3(23), 613\. <https://doi.org/10.21105/joss.00613>
```

## Bibtex format

```
    @article{NiaPyJOSS2018,
        author  = {Vrban{\v{c}}i{\v{c}}, Grega and Brezo{\v{c}}nik, Lucija
                  and Mlakar, Uro{\v{s}} and Fister, Du{\v{s}}an and {Fister Jr.}, Iztok},
        title   = {{NiaPy: Python microframework for building nature-inspired algorithms}},
        journal = {{Journal of Open Source Software}},
        year    = {2018},
        volume  = {3},
        issue   = {23},
        issn    = {2475-9066},
        doi     = {10.21105/joss.00613},
        url     = {https://doi.org/10.21105/joss.00613}
    }
```

## RIS format

```
    TY  - JOUR
    T1  - NiaPy: Python microframework for building nature-inspired algorithms
    AU  - Vrbančič, Grega
    AU  - Brezočnik, Lucija
    AU  - Mlakar, Uroš
    AU  - Fister, Dušan
    AU  - Fister Jr., Iztok
    PY  - 2018
    JF  - Journal of Open Source Software
    VL  - 3
    IS  - 23
    DO  - 10.21105/joss.00613
    UR  - http://joss.theoj.org/papers/10.21105/joss.00613
```

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

Grega Vrbančič
💻 📖 🐛 💡 🚧 📦 📆 👀

firefly-cpp
💻 📖 🐛 💡 👀 💬 ⚠ 📦

Lucija Brezočnik
💻 📖 🐛 💡

mlaky88
💻 📖 💡

rhododendrom
💻 📖 💡 🐛 👀

Klemen
💻 📖 💡 🐛 👀

Jan Popič
💻 📖 💡

Luka Pečnik
💻 📖 💡 🐛

Jan Banko
💻 📖 💡

RokPot
💻 📖 💡

mihaelmika
💻 📖 💡

Jace Browning
💻

Musa Adamu Wakili
💬

Florian Schaefer
🤔

Jan-Hendrik Menke
💬

brett18618
💬

Timotej Zaťko
🐛

sisco0
💻

zStupan
💻 🐛 📖 💡 ⚠

Tomáš Hrnčiar
💻

Ikko Ashimine
💻

andrazperson
💻

Oromion
📦

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind are welcome!

## Contributing

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).

## Licence

This package is distributed under the MIT License. This license can be found online at <http://www.opensource.org/licenses/MIT>.

## Disclaimer

This framework is provided as-is, and there are no guarantees that it fits your purposes or that it is bug-free. Use it at your own risk!


.. image:: https://raw.github.com/simpeg/discretize/main/docs/images/discretize-logo.png
    :alt: Discretize Logo

discretize
==========

.. image:: https://img.shields.io/pypi/v/discretize.svg
    :target: https://pypi.python.org/pypi/discretize
    :alt: Latest PyPI version

.. image:: https://anaconda.org/conda-forge/discretize/badges/version.svg
    :target: https://anaconda.org/conda-forge/discretize
    :alt: Latest conda-forge version

.. image:: https://img.shields.io/github/license/simpeg/simpeg.svg
    :target: https://github.com/simpeg/discretize/blob/main/LICENSE
    :alt: MIT license

.. image:: https://dev.azure.com/simpeg/discretize/_apis/build/status/simpeg.discretize?branchName=main
    :target: https://dev.azure.com/simpeg/discretize/_build/latest?definitionId=1&branchName=main
    :alt: Azure pipelines build status

.. image:: https://codecov.io/gh/simpeg/discretize/branch/main/graph/badge.svg
    :target: https://codecov.io/gh/simpeg/discretize
    :alt: Coverage status

.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.596411.svg
   :target: https://doi.org/10.5281/zenodo.596411

.. image:: https://img.shields.io/discourse/users?server=http%3A%2F%2Fsimpeg.discourse.group%2F
    :target: http://simpeg.discourse.group/

.. image:: https://img.shields.io/badge/simpeg-purple?logo=mattermost&label=Mattermost
    :target: https://mattermost.softwareunderground.org/simpeg

.. image:: https://img.shields.io/badge/Youtube%20channel-GeoSci.xyz-FF0000.svg?logo=youtube
    :target: https://www.youtube.com/channel/UCBrC4M8_S4GXhyHht7FyQqw

**discretize** - A python package for finite volume discretization.

The vision is to create a package for finite volume simulation with a
focus on large scale inverse problems.
This package has the following features:

* modular with respect to the spacial discretization
* built with the inverse problem in mind
* supports 1D, 2D and 3D problems
* access to sparse matrix operators
* access to derivatives to mesh variables

.. image:: https://raw.githubusercontent.com/simpeg/figures/master/finitevolume/cell-anatomy-tensor.png

Currently, discretize supports:

* Tensor Meshes (1D, 2D and 3D)
* Cylindrically Symmetric Meshes
* QuadTree and OcTree Meshes (2D and 3D)
* Logically Rectangular Meshes (2D and 3D)
* Triangular (2D) and Tetrahedral (3D) Meshes

Installing
^^^^^^^^^^
**discretize** is on conda-forge

.. code:: shell

    conda install -c conda-forge discretize

**discretize** is on pypi

.. code:: shell

    pip install discretize

To install from source

.. code:: shell

    git clone https://github.com/simpeg/discretize.git
    python setup.py install

Citing discretize
^^^^^^^^^^^^^^^^^

Please cite the SimPEG paper when using discretize in your work:

    Cockett, R., Kang, S., Heagy, L. J., Pidlisecky, A., & Oldenburg, D. W. (2015). SimPEG: An open source framework for simulation and gradient based parameter estimation in geophysical applications. Computers & Geosciences.

**BibTex:**

.. code:: Latex

    @article{cockett2015simpeg,
      title={SimPEG: An open source framework for simulation and gradient based parameter estimation in geophysical applications},
      author={Cockett, Rowan and Kang, Seogi and Heagy, Lindsey J and Pidlisecky, Adam and Oldenburg, Douglas W},
      journal={Computers \& Geosciences},
      year={2015},
      publisher={Elsevier}
    }

Links
^^^^^

Website:
http://simpeg.xyz

Documentation:
http://discretize.simpeg.xyz

Code:
https://github.com/simpeg/discretize

Tests:
https://travis-ci.org/simpeg/discretize

Bugs & Issues:
https://github.com/simpeg/discretize/issues

Questions:
http://simpeg.discourse.group/

Chat:
https://mattermost.softwareunderground.org/simpeg