1
0
Fork 0
mirror of https://github.com/Findus23/rebound-collisions.git synced 2024-09-19 15:53:48 +02:00

add git_hash

This commit is contained in:
Lukas Winkler 2021-02-11 14:41:23 +01:00
parent 5e77a1d061
commit 187dda2803
Signed by: lukas
GPG key ID: 54DE4D798D244853

View file

@ -1,5 +1,6 @@
import os
import socket
import subprocess
from ctypes import c_uint32
from pathlib import Path
from random import randint
@ -147,6 +148,11 @@ def reorder_particles(sim: Simulation, ed: ExtraData) -> None:
assert sim.N == original_N
def git_hash() -> str:
output = subprocess.run(["git", "rev-parse", "--verify", "HEAD"], capture_output=True)
return output.stdout.decode()
def process_friendlyness(fn: Path) -> None:
if socket.gethostname() == "standpc":
# only handle other computers specially