Skip to content

Commit

Permalink
Update black
Browse files Browse the repository at this point in the history
  • Loading branch information
simonlindholm committed Jul 4, 2022
1 parent c0e755e commit c88c350
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
repos:
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 22.3.0
hooks:
- id: black
language_version: python3.6
4 changes: 2 additions & 2 deletions src/net/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def multiprocess_worker(
setattr(result, "compressed_source", compressed_source)
result.source = None

time_us = int((time.time() - time_before) * 10 ** 6)
time_us = int((time.time() - time_before) * 10**6)
task_queue.put(
WorkDone(perm_id=work.perm_id, id=work.id, time_us=time_us, result=result)
)
Expand Down Expand Up @@ -389,7 +389,7 @@ def try_remove(perm_id: str) -> None:
else:
traceback.print_exc()

msg["time_us"] = int((time.time() - time_before) * 10 ** 6)
msg["time_us"] = int((time.time() - time_before) * 10**6)
port.send_json(msg)

elif isinstance(item, RemovePermuter):
Expand Down
4 changes: 2 additions & 2 deletions src/net/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def _write_one(self, item: Output) -> None:
self._port.send_json({"type": "need_work"})

elif isinstance(item, OutputWork):
overhead_us = int((time.time() - item.time_start) * 10 ** 6) - item.time_us
overhead_us = int((time.time() - item.time_start) * 10**6) - item.time_us
self._port.send_json(
{
"type": "update",
Expand Down Expand Up @@ -860,7 +860,7 @@ def _start_evaluator(docker_image: str, options: ServerOptions) -> DockerPort:
volumes={src_path: {"bind": "/src", "mode": "ro"}},
tmpfs={"/tmp": "size=1G,exec"},
nano_cpus=int(options.num_cores * 1e9),
mem_limit=int(options.max_memory_gb * 2 ** 30),
mem_limit=int(options.max_memory_gb * 2**30),
read_only=True,
network_disabled=True,
)
Expand Down
2 changes: 1 addition & 1 deletion src/permuter.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def _eval_candidate(self, seed: int) -> CandidateResult:
if not self._cur_cand or not keep:
eval_state = EvalState()
cand_c = self._permutations.evaluate(seed, eval_state)
rng_seed = self._force_rng_seed or random.randrange(1, 10 ** 20)
rng_seed = self._force_rng_seed or random.randrange(1, 10**20)
self._cur_seed = (seed, rng_seed)
self._cur_cand = Candidate.from_source(
cand_c,
Expand Down
2 changes: 1 addition & 1 deletion src/randomizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@

# Number larger than any node index. (If you're trying to compile a 1 GB large
# C file to matching asm, you have bigger problems than this limit.)
MAX_INDEX = 10 ** 9
MAX_INDEX = 10**9

T = TypeVar("T")

Expand Down
2 changes: 1 addition & 1 deletion src/scorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


class Scorer:
PENALTY_INF = 10 ** 9
PENALTY_INF = 10**9

PENALTY_STACKDIFF = 1
PENALTY_REGALLOC = 5
Expand Down

0 comments on commit c88c350

Please sign in to comment.