Generate: sort input files, preventing arbitrary order from OS layer.
This commit is contained in:
parent
e47527087e
commit
1cbd384569
15
Generate.py
15
Generate.py
|
@ -114,12 +114,15 @@ def main(args=None, callback=ERmain):
|
||||||
weights_cache[fname] = read_weights_yamls(path)
|
weights_cache[fname] = read_weights_yamls(path)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise ValueError(f"File {fname} is destroyed. Please fix your yaml.") from e
|
raise ValueError(f"File {fname} is destroyed. Please fix your yaml.") from e
|
||||||
else:
|
|
||||||
for yaml in weights_cache[fname]:
|
# sort dict for consistent results across platforms:
|
||||||
print(f"P{player_id} Weights: {fname} >> "
|
weights_cache = {key: value for key, value in sorted(weights_cache.items())}
|
||||||
f"{get_choice('description', yaml, 'No description specified')}")
|
for filename, yaml_data in weights_cache.items():
|
||||||
player_files[player_id] = fname
|
for yaml in yaml_data:
|
||||||
player_id += 1
|
print(f"P{player_id} Weights: {filename} >> "
|
||||||
|
f"{get_choice('description', yaml, 'No description specified')}")
|
||||||
|
player_files[player_id] = filename
|
||||||
|
player_id += 1
|
||||||
|
|
||||||
args.multi = max(player_id-1, args.multi)
|
args.multi = max(player_id-1, args.multi)
|
||||||
print(f"Generating for {args.multi} player{'s' if args.multi > 1 else ''}, {seed_name} Seed {seed} with plando: "
|
print(f"Generating for {args.multi} player{'s' if args.multi > 1 else ''}, {seed_name} Seed {seed} with plando: "
|
||||||
|
|
Loading…
Reference in New Issue