Skip to content

Commit 9388dd2

Browse files
authored
Merge pull request #20 from lahovniktadej/master
Contribution guide
2 parents 8df7344 + 6044bfe commit 9388dd2

File tree

6 files changed

+158
-11
lines changed

6 files changed

+158
-11
lines changed

.github/templates/FEATURE_REQUEST.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
### Feature Request
2+
3+
**About**:
4+
**Title**:
5+
6+
**Is your feature request related to a problem? Please describe.**
7+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
8+
9+
**Describe the solution you'd like**
10+
A clear and concise description of what you want to happen.
11+
12+
**Describe alternatives you've considered**
13+
A clear and concise description of any alternative solutions or features you've considered.
14+
15+
**Additional context**
16+
Add any other context or screenshots about the feature request here.

.github/templates/ISSUE_TEMPLATE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
### Bug Report
2+
3+
**About**:
4+
**Title**:
5+
6+
**Steps to reproduce**
7+
Tell us how to reproduce the bug.
8+
9+
**Expected behavior**
10+
Tell us what should happen.
11+
12+
**Actual behavior**
13+
Tell us what happens instead.
14+
15+
**System configuration**
16+
17+
- OS:
18+
- Python version:

.github/templates/PULL_REQUEST.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
### Summary
2+
3+
Provide a general description of the code changes in your pull
4+
request... were there any bugs you had fixed? If so, mention them. If
5+
these bugs have open GitHub issues, be sure to tag them here as well,
6+
to keep the conversation linked together.
7+
8+
### Other Information
9+
10+
If there's anything else that's important and relevant to your pull
11+
request, mention that information here. This could include
12+
benchmarks, or other information.
13+
14+
Thanks for contributing to Firefly Algorithm!

CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
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.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
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.
28+
29+
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.
30+
31+
## Scope
32+
33+
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.
34+
35+
## Enforcement
36+
37+
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.
38+
39+
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.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

CONTRIBUTING.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Contributing to Firefly Algorithm
2+
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
3+
4+
## Code of Conduct
5+
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 [[email protected]](mailto:[email protected]).
6+
7+
## How Can I Contribute?
8+
9+
### Reporting Bugs
10+
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).
11+
12+
### Suggesting Enhancements
13+
14+
Open new issue using the [feature request template](.github/templates/FEATURE_REQUEST.md).
15+
16+
### Pull requests
17+
18+
Fill in the [pull request template](.github/templates/PULL_REQUEST.md) and make sure your code is documented.
19+
20+
## Setup development environment
21+
22+
### Requirements
23+
24+
* Poetry: [https://python-poetry.org/docs](https://python-poetry.org/docs)
25+
26+
After installing Poetry and cloning the project from GitHub, you should run the following command from the root of the cloned project:
27+
28+
```sh
29+
poetry install
30+
```
31+
32+
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.**
33+
34+
### Dependencies
35+
36+
| Package | Version | Platform |
37+
|----------|:-------:|:--------:|
38+
| numpy | ^1.26.1 | All |
39+
40+
#### Development dependencies
41+
42+
| Package | Version | Platform |
43+
|---------|:--------:|:--------:|
44+
| pytest | ^7.4.3 | Any |
45+
46+
## Development Tasks
47+
48+
### Testing
49+
50+
Manually run the tests:
51+
52+
```sh
53+
poetry run pytest
54+
```

README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
[![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")
2020
![GitHub contributors](https://img.shields.io/github/contributors/firefly-cpp/FireflyAlgorithm.svg)
2121

22-
## About
22+
## About 📋
2323

24-
This package implements a nature-inspired algorithm for optimization called Firefly Algorithm (FA) in Python programming language.
24+
This package implements a nature-inspired algorithm for optimization called Firefly Algorithm (FA) in Python programming language. 🌿🔍💻
2525

26-
## Installation:
26+
## Installation 📦
2727

2828
Install FireflyAlgorithm with pip:
2929
```sh
@@ -42,7 +42,7 @@ To install FireflyAlgorithm on Alpine Linux:
4242
$ apk add py3-fireflyalgorithm
4343
```
4444

45-
## Usage:
45+
## Usage 🚀
4646

4747
```python
4848
from fireflyalgorithm import FireflyAlgorithm
@@ -54,7 +54,7 @@ best = FA.run(function=sphere, dim=10, lb=-5, ub=5, max_evals=10000)
5454
print(best)
5555
```
5656

57-
### Test functions
57+
### Test functions 📈
5858

5959
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:
6060

@@ -65,12 +65,11 @@ from fireflyalgorithm.problems import get_problem
6565
rosenbrock = get_problem('rosenbrock')
6666
```
6767

68-
For more information about the implemented test functions, [click here](Problems.md)
68+
For more information about the implemented test functions, [click here](Problems.md).
6969

70-
### Command line interface
70+
### Command line interface 🖥️
7171

72-
The package also comes with a simple command line interface which allows you to evaluate the algorithm on several
73-
popular test functions
72+
The package also comes with a simple command line interface which allows you to evaluate the algorithm on several popular test functions. 🔬
7473

7574
```shell
7675
firefly-algorithm -h
@@ -100,10 +99,10 @@ options:
10099
--seed SEED Seed for the random number generator
101100
```
102101

103-
**Note:** The CLI script can also run as a python module (python -m niaarm ...)
102+
**Note:** The CLI script can also run as a python module (python -m niaarm ...).
104103

105104

106-
## Reference Papers:
105+
## Reference Papers 📚
107106

108107
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.
109108
Jozef Stefan Institute, Ljubljana, Slovenia, 2012

0 commit comments

Comments
 (0)