Skip to content

Commit dad526c

Browse files
committed
FIX clean_template instruction
1 parent 3f24102 commit dad526c

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

README.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ This repo should be used with the following steps:
66

77
1. Hit the `Use this template` button on the top of `this page <https://github.com/benchopt/template_benchmark>`_,
88
2. Use the form to create a new github repository with your benchmark name,
9-
3. Clone the newly created repository on your computer,
10-
4. Run ``python clean_template.py`` script that will remove instruction relative to
11-
the template in ``README.rst`` and update it with your repo and org name.
9+
3. Wait a minute for the `clean_template` action to run, so it removes
10+
unnecessary files, and replaces the template strings with your
11+
benchmark name and organization,
12+
4. Clone the newly created repository on your computer,
1213
5. Edit the problem description in the ``README.rst``.
13-
6. Update ``objective.py`` and the files in ``datasets`` and ``solvers`` to create the benchmark.
14+
6. Update ``objective.py`` and the files in ``datasets`` and ``solvers``
15+
to create the benchmark.
1416

1517
My Benchopt Benchmark
1618
=====================

clean_template.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
repo_url = check_output(['git', 'remote', 'get-url', 'origin']).decode()
1010
name = re.split('github.com[:/]', repo_url)[1].strip()
1111
ORG, BENCHMARK_NAME = name.replace('.git', '').split('/')
12+
if BENCHMARK_NAME == 'template_benchmark':
13+
# For testing purposes
14+
BENCHMARK_NAME = 'your_benchmark_name'
1215

1316
# update readme to have the right badge
1417
README = Path('README.rst')
@@ -17,7 +20,7 @@
1720
text = text.replace('#ORG', ORG)
1821
text = text.replace('#BENCHMARK_NAME', BENCHMARK_NAME)
1922

20-
text = '\n'.join([line for line in text.splitlines()[13:]
23+
text = '\n'.join([line for line in text.splitlines()[16:]
2124
if 'template_benchmark' not in line] + [''])
2225
README.write_text(text)
2326

0 commit comments

Comments
 (0)