Skip to content
Closed
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
140 changes: 47 additions & 93 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,127 +1,81 @@
# How to contribute
# Contributing to Hyperactive

There are many ways to contribute to this project. The following list should give you some ideas how to contribute. The only requirement for a contribution is that you are familiar with this project and understand the problems it is trying to solve.
Thank you for your interest in contributing to Hyperactive. This project values self-directed contributors who bring their own ideas and experiences to the table.


<br>
## Before You Contribute

## Discussions
The best contributions come from people who actively use the library. Before contributing, we recommend:

You can contribute to this project by taking part in a discussion.
- **Use Hyperactive in your own projects** - Hands-on experience helps you identify real problems and useful improvements
- **Explore the codebase** - Understand the architecture and design decisions
- **Read existing issues and discussions** - Get familiar with ongoing conversations and past decisions


<br>
## Ways to Contribute

#### - Upvoting an issue
### Feedback and Discussions

The easiest way to contribute is to upvote an issue (with a thumbs up emojy) that is important to you. This way I can see which bugfix, feature or question is important to my users.
- **Upvote issues** that are important to you
- **Share your use cases** - How are you using Hyperactive? What works well?
- **Participate in discussions** - Your domain expertise can help shape the project


<br>
### Opening Issues

#### - Take part in discussions
#### Bug Reports

If you have experience in a topic, that touches the issue you might be able to participate in the discussion.
If you encounter a bug while using Hyperactive:

1. Search existing issues to avoid duplicates
2. Use the bug report template
3. Include a minimal reproducible example
4. Describe what you expected vs. what happened

<br>
#### Feature Requests

#### - Reproduce a bug
Feature requests are most valuable when they come from real usage experience:

An issue about a bug can benefit from users reproducing the bug and therefore confirm, that the bug exists.
1. Describe the problem you're trying to solve
2. Explain your current workaround (if any)
3. Suggest a solution if you have one in mind

#### Questions

<br>
Before asking a question:

## Create a pull request
1. Check the documentation
2. Search existing issues and discussions
3. If still unclear, open an issue with specific details

A more difficult way to contribute is to open a pull request.

### Pull Requests

<br>
#### Before Starting

#### - Corrections in Readme
- **Discuss first** - Open an issue to discuss your idea before writing code
- **One change per PR** - Keep pull requests focused on a single improvement

If you want to start easy you can create a pull request, that corrects a mistake in the readme. Those mistakes could be from wrong spelling or a wrong default value in the API reference.
#### When Submitting

- **Understand the code you're changing** - Be prepared to explain your changes and their implications
- **Test thoroughly** - Verify your changes work as intended
- **Explain the "why"** - Help reviewers understand the reasoning behind your changes

<br>
#### PR Format

#### - Add an example
- Use tags in the title: `[Fix]`, `[Feature]`, `[Refactor]`, `[Docs]`
- Link to the related issue
- Describe what changed and why

A great way to conribute is to add an example from you field of work, that incorporates this package.

## Code Style

<br>
- Follow the existing code style in the repository
- Run the test suite before submitting
- Keep commits focused and well-described

#### - Solve an existing issue

Solving an issue with a pull request is one of the most difficult ways to contribute. If you need help with the solution you can ask it in the corresponding issue or contact me at my official email (from my profile page).
## Code of Conduct


<br>

## Open an issue

You can contribute to this project by opening an issue. This could be a question, a bug report, a feature request or other types. In any case you should do a search beforehand to confirm, that a similar issue has not already been opened.


<br>

#### - Questions

This can be a question about how an algorithm works or if something in the documentation is not clear.


<br>

#### - Bug reports

If you encounter an error with this software you should open an issue. Please look into the error message to verify if the origin of the error is in this software. If you decide to open an issue about a bug report you should select the issue template and follow the instructions.


<br>

#### - Feature Requests

This could be a feature that could be very useful for your work, an interesting algorithm or a way to open up the software to more usecases.


<br>

---

<br>
<br>
<br>

# Contribution Guidelines

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.


<br>

## Issues

Before opening an issue, please use the search to find out if your problem or question has already been adressed before.
When opening issues, please use the issue templates and try to describe your problem in detail.

If you open an issue that describes a bug, please add a small example code snippet. This helps to reproduce the bug, which speeds up the process of fixing the bug.


<br>

## Pull Requests

- In the PR title use tags [Fix], [Feature], [Refactor], [Release], [Hotfix]
- Link PR to issue of it solves one.
- Explain how you solved the issue
- Check the Format und Coding Style


<br>

---
Please be respectful in all interactions. We're all here to build something useful together.
4 changes: 2 additions & 2 deletions docs/source/_snippets/examples/advanced_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

optimizer = HillClimbing(
search_space=search_space,
n_iter=40,
n_iter=5,
experiment=experiment,
initialize={"warm_start": warm_start_points},
)
Expand All @@ -60,7 +60,7 @@
for name, OptClass in optimizers.items():
optimizer = OptClass(
search_space=search_space,
n_iter=50,
n_iter=5,
experiment=experiment,
random_state=42,
)
Expand Down
4 changes: 2 additions & 2 deletions docs/source/_snippets/examples/basic_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def objective(params):

optimizer = HillClimbing(
search_space=search_space,
n_iter=100,
n_iter=5,
experiment=objective,
)
best_params = optimizer.solve()
Expand Down Expand Up @@ -58,7 +58,7 @@ def objective(params):
# Optimize
optimizer = HillClimbing(
search_space=search_space,
n_iter=40,
n_iter=5,
random_state=42,
experiment=experiment,
)
Expand Down
9 changes: 5 additions & 4 deletions docs/source/_snippets/getting_started/bayesian_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@ def experiment(params):
# [start:optimizer_usage]
optimizer = BayesianOptimizer(
search_space=search_space,
n_iter=30,
n_iter=5,
experiment=experiment,
)
best_params = optimizer.solve()
# [end:optimizer_usage]

if __name__ == "__main__":
print(f"Best parameters: {best_params}")
# Verify the optimization found parameters close to (0, 0)
assert abs(best_params["x"]) < 2.0, f"Expected x near 0, got {best_params['x']}"
assert abs(best_params["y"]) < 2.0, f"Expected y near 0, got {best_params['y']}"
# Verify the optimization returned valid parameters
assert "x" in best_params and "y" in best_params
assert -5 <= best_params["x"] <= 5, f"x out of range: {best_params['x']}"
assert -5 <= best_params["y"] <= 5, f"y out of range: {best_params['y']}"
print("Bayesian optimizer example passed!")
2 changes: 1 addition & 1 deletion docs/source/_snippets/getting_started/index_bayesian.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def complex_objective(params):

optimizer = BayesianOptimizer(
search_space=search_space,
n_iter=50,
n_iter=5,
experiment=complex_objective,
)
best_params = optimizer.solve()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@ def objective(params):
# Create optimizer and solve
optimizer = HillClimbing(
search_space=search_space,
n_iter=100,
n_iter=5,
experiment=objective,
)
best_params = optimizer.solve()
print(f"Best parameters: {best_params}")
# [end:full_example]

if __name__ == "__main__":
# Verify the optimization found parameters close to (0, 0)
assert abs(best_params["x"]) < 1.0, f"Expected x near 0, got {best_params['x']}"
assert abs(best_params["y"]) < 1.0, f"Expected y near 0, got {best_params['y']}"
# Verify the optimization returned valid parameters
assert "x" in best_params and "y" in best_params
assert -5 <= best_params["x"] <= 5, f"x out of range: {best_params['x']}"
assert -5 <= best_params["y"] <= 5, f"y out of range: {best_params['y']}"
print("Index custom function example passed!")
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# Define optimizer with search space
search_space = {"kernel": ["linear", "rbf"], "C": [0.1, 1, 10]}
optimizer = HillClimbing(search_space=search_space, n_iter=20)
optimizer = HillClimbing(search_space=search_space, n_iter=5)

# Create tuned estimator and fit
tuned_svc = OptCV(SVC(), optimizer)
Expand Down
9 changes: 5 additions & 4 deletions docs/source/_snippets/getting_started/quick_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def objective(params):
# 3. Create an optimizer and solve
optimizer = HillClimbing(
search_space=search_space,
n_iter=100,
n_iter=5,
experiment=objective,
)
best_params = optimizer.solve()
Expand All @@ -34,7 +34,8 @@ def objective(params):
# [end:full_example]

if __name__ == "__main__":
# Verify the optimization found parameters close to (0, 0)
assert abs(best_params["x"]) < 1.0, f"Expected x near 0, got {best_params['x']}"
assert abs(best_params["y"]) < 1.0, f"Expected y near 0, got {best_params['y']}"
# Verify the optimization returned valid parameters
assert "x" in best_params and "y" in best_params
assert -5 <= best_params["x"] <= 5, f"x out of range: {best_params['x']}"
assert -5 <= best_params["y"] <= 5, f"y out of range: {best_params['y']}"
print("Quick start example passed!")
2 changes: 1 addition & 1 deletion docs/source/_snippets/getting_started/sklearn_optcv.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# Define optimizer with search space
search_space = {"kernel": ["linear", "rbf"], "C": [0.1, 1, 10, 100]}
optimizer = HillClimbing(search_space=search_space, n_iter=20)
optimizer = HillClimbing(search_space=search_space, n_iter=5)

# Create tuned estimator (like GridSearchCV)
tuned_svc = OptCV(SVC(), optimizer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# Optimize
optimizer = HillClimbing(
search_space=search_space,
n_iter=50,
n_iter=5,
experiment=experiment,
)
best_params = optimizer.solve()
Expand Down
2 changes: 1 addition & 1 deletion docs/source/_snippets/installation/verify_installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def objective(params):

optimizer = HillClimbing(
search_space={"x": np.arange(-5, 5, 0.1)},
n_iter=10,
n_iter=5,
experiment=objective,
)
best = optimizer.solve()
Expand Down
8 changes: 4 additions & 4 deletions docs/source/_snippets/user_guide/experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def ackley(params):

optimizer = BayesianOptimizer(
search_space=search_space,
n_iter=50,
n_iter=5,
experiment=ackley,
)
best_params = optimizer.solve()
Expand Down Expand Up @@ -86,7 +86,7 @@ def run_simulation(params):

optimizer = HillClimbing(
search_space=search_space,
n_iter=30,
n_iter=5,
experiment=experiment,
)
best_params = optimizer.solve()
Expand All @@ -113,7 +113,7 @@ def run_simulation(params):

optimizer = RandomSearch(
search_space=search_space,
n_iter=10,
n_iter=5,
experiment=experiment,
)
best_params = optimizer.solve()
Expand All @@ -139,7 +139,7 @@ def run_simulation(params):

optimizer = BayesianOptimizer(
search_space=ackley.search_space,
n_iter=50,
n_iter=5,
experiment=ackley,
)
# [end:benchmark_experiments]
Expand Down
Loading
Loading