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:
parent
5e77a1d061
commit
187dda2803
1 changed files with 6 additions and 0 deletions
6
utils.py
6
utils.py
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue