Skip to content

Commit

Permalink
Merge branch 'main' into doc/review-tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
nabenabe0928 authored May 20, 2024
2 parents fa9fc2b + 70bca26 commit c08f06b
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## Contributor Agreements

Please read the CODE_OF_CONDUCT.md and if you agree, please click the checkbox below.
Please read the [contributor agreements](CONTRIBUTING.md#contributor-agreements) and if you agree, please click the checkbox below.

- [ ] I agree to the code of conduct.
- [ ] I agree to the contributor agreements.

## Motivation
<!-- Describe your motivation why you will submit this PR. This is useful for reviewers to understand the context of PR. -->
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/github-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
release:
types:
- published
workflow_dispatch:

jobs:
build:
Expand Down Expand Up @@ -42,7 +43,7 @@ jobs:
path: docs/build/html

deploy:
if: github.event_name == 'push'
if: github.event_name != 'pull_request'
needs: build
permissions:
pages: write
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/header-confirm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Header Confirmation

on:
push:
branches:
- main
pull_request: {}

jobs:
header-confirm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: pip install python-frontmatter
- name: Confirm headers
run: python optunahub-registry/header_confirm.py
Empty file added .nojekyll
Empty file.
26 changes: 23 additions & 3 deletions CODE_OF_CONDUCT.md → CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
1. By making a contribution to this project, I certify that:
# Contribution Guidelines

(a) The contribution was created in whole or in part by me and I have the right to submit it under the MIT license indicated in the file:
## Creating a Pull Request

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open-source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the MIT license, as indicated in the file; or
When you are ready to create a pull request, please try to keep the following in mind.

First, the **title** of your pull request should:

- briefly describe and reflect the changes
- wrap any code with backticks
- not end with a period

Second, the **description** of your pull request should:

- describe the motivation
- describe the changes
- if still work-in-progress, describe remaining tasks

Finally, read [`contributor agreements`](#contributor-agreements) and if you agree, please click the checkbox


## Contributor Agreements

1. By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I have the right to submit it under the MIT license indicated in the file:
(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open-source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the MIT license, as indicated in the file; or
(c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

2. By making a contribution to this project, I agree that the MIT license applies to the contribution and the contribution is used by Preferred Networks (“PFN”) or third party under the MIT license.
Expand Down
24 changes: 24 additions & 0 deletions optunahub-registry/header_confirm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import os

import frontmatter


def header_confirm(path: str) -> None:
post = frontmatter.load(path)
assert "author" in post.keys(), f"author is not found in {path}"
assert "title" in post.keys(), f"title is not found in {path}"
assert "description" in post.keys(), f"description is not found in {path}"
assert "tags" in post.keys(), f"tags is not found in {path}"
assert "optuna_versions" in post.keys(), f"optuna_versions is not found in {path}"
assert "license" in post.keys(), f"license is not found in {path}"


if __name__ == "__main__":
# Check all README files under the `package` directory.
for root, dirs, files in os.walk("package"):
for file in files:
if file == "README.md":
header_confirm(os.path.join(root, file))

# Check the template file.
header_confirm("template/README.md")
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ docs = [
]

[project.urls]
homepage = "TBD"
homepage = "https://hub.optuna.org/"
repository = "https://github.com/optuna/optunahub-registry"
documentation = "TBD"
documentation = "https://optuna.github.io/optunahub-registry/"
bugtracker = "https://github.com/optuna/optunahub-registry/issues"

[tool.setuptools.packages.find]
Expand Down
4 changes: 2 additions & 2 deletions recipes/001_first.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ def objective(trial: optuna.trial.Trial) -> float:
# In the `samplers` directory, you should create a directory named after your algorithm.
# The created directory should include the following files:
#
# - `README.md`: A description of your algorithm. This file is used to create an `web page of OptunaHub <TBD>`_. Let me explain the format of the `README.md` file later.
# - `README.md`: A description of your algorithm. This file is used to create an `web page of OptunaHub <https://hub.optuna.org/>`_. Let me explain the format of the `README.md` file later.
# - `__init__.py`: An initialization file. This file must import your implemented sampler from `YOUR_ALGORITHM_NAME.py`.
# - `LICENSE`: A license file. This file must contain the license of your algorithm. It should be the MIT license in the alpha version.
# - `images`: This is optional. A directory that contains images. The images in this directory will be used the `web page of OptunaHub <TBD>`_. `thumbnail.png` will be used as a thumbnail in the web page. Note that `README.md` can also refer to image files, e.g. `images/screenshot.png`, in this directory.
# - `images`: This is optional. A directory that contains images. The images in this directory will be used the `web page of OptunaHub <https://hub.optuna.org/>`_. `thumbnail.png` will be used as a thumbnail in the web page. Note that `README.md` can also refer to image files, e.g. `images/screenshot.png`, in this directory.
# - `requirements.txt`: This is optional. A file that contains the additional dependencies of your algorithm. If there are no additional dependencies, you do not need to create this file.
# - `YOUR_ALGORITHM_NAME.py`: Your implemented sampler.
#
Expand Down
6 changes: 3 additions & 3 deletions template/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
Please read the [tutorial guide](TBD) to register your feature in OptunaHub.
You can find more detailed explanation of the following contents in the tutorial.

---
author: Please fill in the author name here.
title: Please fill in the title of the feature here.
Expand All @@ -10,6 +7,9 @@ optuna_versions: Please fill in the versions of Optuna in which you have confirm
license: Please fill in the license name here.
---

Please read the [tutorial guide](https://optuna.github.io/optunahub-registry/recipes/001_first.html) to register your feature in OptunaHub.
You can find more detailed explanation of the following contents in the tutorial.

## Class or Function Names
Please fill in the class/function name which you implement here.

Expand Down

0 comments on commit c08f06b

Please sign in to comment.