diff --git a/.github/templates/FEATURE_REQUEST.md b/.github/templates/FEATURE_REQUEST.md new file mode 100644 index 0000000..5a1ccc4 --- /dev/null +++ b/.github/templates/FEATURE_REQUEST.md @@ -0,0 +1,16 @@ +### Feature Request + +**About**: +**Title**: + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. \ No newline at end of file diff --git a/.github/templates/ISSUE_TEMPLATE.md b/.github/templates/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..90325f5 --- /dev/null +++ b/.github/templates/ISSUE_TEMPLATE.md @@ -0,0 +1,18 @@ +### Bug Report + +**About**: +**Title**: + +**Steps to reproduce** +Tell us how to reproduce the bug. + +**Expected behavior** +Tell us what should happen. + +**Actual behavior** +Tell us what happens instead. + +**System configuration** + + - OS: + - Python version: \ No newline at end of file diff --git a/.github/templates/PULL_REQUEST.md b/.github/templates/PULL_REQUEST.md new file mode 100644 index 0000000..9a87d5d --- /dev/null +++ b/.github/templates/PULL_REQUEST.md @@ -0,0 +1,14 @@ +### Summary + +Provide a general description of the code changes in your pull +request... were there any bugs you had fixed? If so, mention them. If +these bugs have open GitHub issues, be sure to tag them here as well, +to keep the conversation linked together. + +### Other Information + +If there's anything else that's important and relevant to your pull +request, mention that information here. This could include +benchmarks, or other information. + +Thanks for contributing to Firefly Algorithm! \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 18d1380..2964d4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,34 @@ # Changelog +## [0.4.1](https://github.com/firefly-cpp/FireflyAlgorithm/tree/0.4.1) (2023-11-10) + +[Full Changelog](https://github.com/firefly-cpp/FireflyAlgorithm/compare/0.4.0...0.4.1) + +**Closed issues:** + +- Create Problems.md [\#18](https://github.com/firefly-cpp/FireflyAlgorithm/issues/18) + +**Merged pull requests:** + +- Add Test Function definitions [\#19](https://github.com/firefly-cpp/FireflyAlgorithm/pull/19) ([zStupan](https://github.com/zStupan)) + +## [0.4.0](https://github.com/firefly-cpp/FireflyAlgorithm/tree/0.4.0) (2023-11-06) + +[Full Changelog](https://github.com/firefly-cpp/FireflyAlgorithm/compare/0.3.4...0.4.0) + +**Closed issues:** + +- Enhance tests [\#16](https://github.com/firefly-cpp/FireflyAlgorithm/issues/16) +- Provide Command Line Interface \(CLI\) [\#13](https://github.com/firefly-cpp/FireflyAlgorithm/issues/13) +- Add installation instructions for Arch Linux [\#11](https://github.com/firefly-cpp/FireflyAlgorithm/issues/11) + +**Merged pull requests:** + +- Add tests [\#17](https://github.com/firefly-cpp/FireflyAlgorithm/pull/17) ([zStupan](https://github.com/zStupan)) +- Added a Command Line Interface [\#15](https://github.com/firefly-cpp/FireflyAlgorithm/pull/15) ([zStupan](https://github.com/zStupan)) +- Improve workflows [\#14](https://github.com/firefly-cpp/FireflyAlgorithm/pull/14) ([firefly-cpp](https://github.com/firefly-cpp)) +- Add instructions for install FireflyAlgorithm in Arch Linux [\#12](https://github.com/firefly-cpp/FireflyAlgorithm/pull/12) ([carlosal1015](https://github.com/carlosal1015)) + ## [0.3.4](https://github.com/firefly-cpp/FireflyAlgorithm/tree/0.3.4) (2022-12-13) [Full Changelog](https://github.com/firefly-cpp/FireflyAlgorithm/compare/0.3.3...0.3.4) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..7e77a3a --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,46 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..6162d8d --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,54 @@ +# Contributing to Firefly Algorithm +:+1::tada: First off, thanks for taking the time to contribute! :tada::+1: + +## Code of Conduct +This project and everyone participating in it is governed by the [Firefly Algorithm Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [iztok.fister1@um.si](mailto:iztok.fister1@um.si). + +## How Can I Contribute? + +### Reporting Bugs +Before creating bug reports, please check existing issues list as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible in the [issue template](.github/templates/ISSUE_TEMPLATE.md). + +### Suggesting Enhancements + +Open new issue using the [feature request template](.github/templates/FEATURE_REQUEST.md). + +### Pull requests + +Fill in the [pull request template](.github/templates/PULL_REQUEST.md) and make sure your code is documented. + +## Setup development environment + +### Requirements + +* Poetry: [https://python-poetry.org/docs](https://python-poetry.org/docs) + +After installing Poetry and cloning the project from GitHub, you should run the following command from the root of the cloned project: + +```sh +poetry install +``` + +All of the project's dependencies should be installed and the project ready for further development. **Note that Poetry creates a separate virtual environment for your project.** + +### Dependencies + +| Package | Version | Platform | +|----------|:-------:|:--------:| +| numpy | ^1.26.1 | All | + +#### Development dependencies + +| Package | Version | Platform | +|---------|:--------:|:--------:| +| pytest | ^7.4.3 | Any | + +## Development Tasks + +### Testing + +Manually run the tests: + +```sh +poetry run pytest +``` \ No newline at end of file diff --git a/README.md b/README.md index 9fcb701..df9880d 100644 --- a/README.md +++ b/README.md @@ -19,11 +19,11 @@ [![Percentage of issues still open](http://isitmaintained.com/badge/open/firefly-cpp/FireflyAlgorithm.svg)](http://isitmaintained.com/project/firefly-cpp/FireflyAlgorithm "Percentage of issues still open") ![GitHub contributors](https://img.shields.io/github/contributors/firefly-cpp/FireflyAlgorithm.svg) -## About +## About πŸ“‹ -This package implements a nature-inspired algorithm for optimization called Firefly Algorithm (FA) in Python programming language. +This package implements a nature-inspired algorithm for optimization called Firefly Algorithm (FA) in Python programming language. πŸŒΏπŸ”πŸ’» -## Installation: +## Installation πŸ“¦ Install FireflyAlgorithm with pip: ```sh @@ -37,8 +37,12 @@ To install FireflyAlgorithm on Arch Linux, please use an [AUR helper](https://wi ```sh $ yay -Syyu python-fireflyalgorithm ``` +To install FireflyAlgorithm on Alpine Linux: +```sh +$ apk add py3-fireflyalgorithm +``` -## Usage: +## Usage πŸš€ ```python from fireflyalgorithm import FireflyAlgorithm @@ -50,7 +54,7 @@ best = FA.run(function=sphere, dim=10, lb=-5, ub=5, max_evals=10000) print(best) ``` -### Test functions +### Test functions πŸ“ˆ In the `fireflyalgorithm.problems` module, you can find the implementations of 33 popular optimization test problems. Additionally, the module provides a utility function, `get_problem`, that allows you to retrieve a specific optimization problem function by providing its name as a string: @@ -61,12 +65,11 @@ from fireflyalgorithm.problems import get_problem rosenbrock = get_problem('rosenbrock') ``` -For more information about the implemented test functions, [click here](Problems.md) +For more information about the implemented test functions, [click here](Problems.md). -### Command line interface +### Command line interface πŸ–₯️ -The package also comes with a simple command line interface which allows you to evaluate the algorithm on several -popular test functions +The package also comes with a simple command line interface which allows you to evaluate the algorithm on several popular test functions. πŸ”¬ ```shell firefly-algorithm -h @@ -96,10 +99,10 @@ options: --seed SEED Seed for the random number generator ``` -**Note:** The CLI script can also run as a python module (python -m niaarm ...) +**Note:** The CLI script can also run as a python module (python -m fireflyalgorithm ...). -## Reference Papers: +## Reference Papers πŸ“š I. Fister Jr., X.-S. Yang, I. Fister, J. Brest. [Memetic firefly algorithm for combinatorial optimization](http://www.iztok-jr-fister.eu/static/publications/44.pdf) in Bioinspired Optimization Methods and their Applications (BIOMA 2012), B. Filipic and J.Silc, Eds. Jozef Stefan Institute, Ljubljana, Slovenia, 2012 diff --git a/fireflyalgorithm/__init__.py b/fireflyalgorithm/__init__.py index 35ed0d4..1a8dc9b 100644 --- a/fireflyalgorithm/__init__.py +++ b/fireflyalgorithm/__init__.py @@ -2,4 +2,4 @@ __all__ = ["FireflyAlgorithm"] -__version__ = "0.4.1" +__version__ = "0.4.2" diff --git a/pyproject.toml b/pyproject.toml index 3fdb198..a35c836 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "fireflyalgorithm" -version = "0.4.1" +version = "0.4.2" description = "Implementation of Firefly Algorithm in Python" authors = ["Iztok Fister Jr. ", "Luka Pečnik ", "Ε½iga Stupan "] license = "MIT" @@ -9,7 +9,8 @@ homepage = "https://github.com/firefly-cpp/FireflyAlgorithm" repository = "https://github.com/firefly-cpp/FireflyAlgorithm" include = [ - { path="LICENSE", format="sdist" } + { path="LICENSE", format="sdist" }, + { path="Problems.md", format="sdist" } ] [tool.poetry.dependencies]