You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-34Lines changed: 31 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,8 @@ Install hyperopt from PyPI
20
20
21
21
```bash
22
22
pip install hyperopt
23
+
# or with uv
24
+
uv add hyperopt
23
25
```
24
26
25
27
to run your first example
@@ -57,6 +59,12 @@ If you're a developer and wish to contribute, please follow these steps.
57
59
58
60
### Setup (based on [this](https://scikit-learn.org/stable/developers/contributing.html#contributing-code))
59
61
62
+
This project uses [uv](https://docs.astral.sh/uv/) for dependency management. Install it first if you haven’t:
63
+
64
+
```bash
65
+
curl -LsSf https://astral.sh/uv/install.sh | sh
66
+
```
67
+
60
68
1. Create an account on GitHub if you do not already have one.
61
69
62
70
2. Fork the project repository: click on the ‘Fork’ button near the top of the page. This creates a copy of the code under your account on the GitHub user account. For more details on how to fork a repository see [this guide](https://help.github.com/articles/fork-a-repo/).
@@ -68,79 +76,68 @@ If you're a developer and wish to contribute, please follow these steps.
7. Add the upstream remote. This saves a reference to the main hyperopt repository, which you can use to keep your repository synchronized with the latest changes:
85
+
5. Add the upstream remote. This saves a reference to the main hyperopt repository, which you can use to keep your repository synchronized with the latest changes:
You should now have a working installation of hyperopt, and your git repository properly configured. The next steps now describe the process of modifying code and submitting a PR:
99
92
100
-
8. Synchronize your master branch with the upstream master branch:
93
+
6. Synchronize your master branch with the upstream master branch:
101
94
102
95
```bash
103
96
git checkout master
104
97
git pull upstream master
105
98
```
106
99
107
-
9. Create a feature branch to hold your development changes:
100
+
7. Create a feature branch to hold your development changes:
108
101
109
-
`$ git checkout -b my_feature`
102
+
```bash
103
+
git checkout -b my_feature
104
+
```
110
105
111
106
and start making changes. Always use a feature branch. It’s good practice to never work on the master branch!
112
107
113
-
10. We recommend to use [Black](https://github.com/psf/black) to format your code before submitting a PR which is installed automatically in step 6.
108
+
8. We recommend to use [Black](https://github.com/psf/black) to format your code before submitting a PR, which is installed automatically in step 4.
114
109
115
-
11. Then, once you commit ensure that git hooks are activated (Pycharm forexample has the option to omit them). This can be done using [pre-commit](https://pre-commit.com/), which is installed automaticallyin step 6, as follows:
110
+
9. Then, once you commit ensure that git hooks are activated (Pycharm forexample has the option to omit them). This can be done using [pre-commit](https://pre-commit.com/), which is installed automaticallyin step 4, as follows:
116
111
117
112
```bash
118
-
pre-commit install
113
+
uv run pre-commit install
119
114
```
120
115
121
116
This will run black automatically when you commit on all files you modified, failing if there are any files requiring to be blacked. In case black does not run execute the following:
122
117
123
118
```bash
124
-
black {source_file_or_directory}
119
+
uv run black {source_file_or_directory}
125
120
```
126
121
127
-
12. Develop the feature on your feature branch on your computer, using Git to do the version control. When you’re done editing, add changed files using git add and then git commit:
122
+
10. Develop the feature on your feature branch on your computer, using Git to do the version control. When you’re done editing, add changed files using git add and then git commit:
128
123
129
124
```bash
130
125
git add modified_files
131
126
git commit -m "my first hyperopt commit"
132
127
```
133
128
134
-
13. The tests for this project use [PyTest](https://docs.pytest.org/en/latest/) and can be run by calling `pytest`.
129
+
11. The tests for this project use [PyTest](https://docs.pytest.org/en/latest/) and can be run with:
135
130
136
-
14. Record your changes in Git, then push the changes to your GitHub account with:
131
+
```bash
132
+
uv run pytest
133
+
```
134
+
135
+
12. Record your changes in Git, then push the changes to your GitHub account with:
137
136
138
137
```bash
139
138
git push -u origin my_feature
140
139
```
141
140
142
-
Note that dev dependencies require python 3.6+.
143
-
144
141
## Algorithms
145
142
146
143
Currently three algorithms are implemented in hyperopt:
0 commit comments