Skip to content

Contribution guide #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/templates/FEATURE_REQUEST.md
Original file line number Diff line number Diff line change
@@ -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.
18 changes: 18 additions & 0 deletions .github/templates/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -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:
14 changes: 14 additions & 0 deletions .github/templates/PULL_REQUEST.md
Original file line number Diff line number Diff line change
@@ -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!
46 changes: 46 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -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/
54 changes: 54 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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
```
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -42,7 +42,7 @@ To install FireflyAlgorithm on Alpine Linux:
$ apk add py3-fireflyalgorithm
```

## Usage:
## Usage 🚀

```python
from fireflyalgorithm import FireflyAlgorithm
Expand All @@ -54,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:

Expand All @@ -65,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
Expand Down Expand Up @@ -100,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 niaarm ...).


## 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
Expand Down