Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
mzuenni committed Mar 2, 2024
1 parent 39b27eb commit ba3192d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 8 additions & 3 deletions bin/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,9 @@ def __init__(self, problem, generator_config, key, name: str, yaml, parent):
if ext in self.hardcoded:
hashes[ext] = hash_string(self.hardcoded[ext])

if isinstance(yaml, ruamel.yaml.comments.CommentedMap):
print(yaml.__dict__)

# Warn/Error for unknown keys.
for key in yaml:
if key in RESERVED_TESTCASE_KEYS:
Expand Down Expand Up @@ -1626,9 +1629,11 @@ def get_or_add(yaml, key, t=ruamel.yaml.comments.CommentedMap):
entry.append(ruamel.yaml.comments.CommentedMap())
path_in_gen = in_file.relative_to('generators')
name = path_in_gen.as_posix().replace('/', '_')
entry[-1][f'{name}_{in_file.stem}'] = {
'copy': path_in_gen.with_suffix('').as_posix()
}
new = ruamel.yaml.comments.CommentedMap(
{'copy': path_in_gen.with_suffix('').as_posix()}
)
new.fa.set_flow_style()
entry[-1][f'{name}_{in_file.stem}'] = new
bar.log('added to generators.yaml.')
bar.done()

Expand Down
3 changes: 2 additions & 1 deletion doc/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This lists all subcommands and their most important options.
- Problem development:
- [`bt run [-v] [-t TIMELIMIT] [submissions [submissions ...]] [testcases [testcases ...]]`](#run)
- [`bt test [-v] [-t TIMEOUT] submission [--interactive | --samples | [testcases [testcases ...]]]`](#test)
- [`bt generate [-v] [-t TIMEOUT] [--clean] [--check-deterministic] [--jobs JOBS] [--no-validators] [--no-visualizer] [testcases [testcases ...]]`](#generate)
- [`bt generate [-v] [-t TIMEOUT] [--add] [--clean] [--check-deterministic] [--jobs JOBS] [--no-validators] [--no-visualizer] [testcases [testcases ...]]`](#generate)
- [`bt pdf [-v] [--all] [--web] [--cp] [--no-timelimit] [--language LANG]`](#pdf)
- [`bt solutions [-v] [--web] [--cp] [--order ORDER]`](#solutions)
- [`bt stats`](#stats)
Expand Down Expand Up @@ -156,6 +156,7 @@ Pass a list of testcases or directories to only generate a subset of data. See [
**Flags**

- `--check-deterministic`: Check that the .in files are generated deterministically for all test cases, skipping the up-to-date check.
- `--add [<testcases>, <directories>]`: Add the testcases (inside the directories) as `copy` entries in the `generator.yaml`
- `--clean`: Delete all cached files.
- `--jobs <number>`/`-j <number>`: The number of parallel jobs to use when generating testcases. Defaults to half the number of cores. Set to `0` to disable parallelization.
- `--timeout <seconds>`/`-t <seconds>`: Override the default timeout for generators and visualizers (`30s`) and submissions (`1.5*timelimit+1`).
Expand Down

0 comments on commit ba3192d

Please sign in to comment.