Skip to content

Commit

Permalink
more typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed May 14, 2024
1 parent 1f9cb06 commit 2fa288d
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 3 deletions.
44 changes: 44 additions & 0 deletions manual_scripts/get_triad.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
from spinn_utilities.config_holder import set_config
from spinnman.spalloc import SpallocClient
from spinnman.config_setup import unittest_setup


SPALLOC_URL = "https://spinnaker.cs.man.ac.uk/spalloc"
SPALLOC_USERNAME = "Christian-test"
SPALLOC_PASSWORD = "Ski1lift"

SPALLOC_MACHINE = "SpiNNaker1M"

x = 0
y = 3
b = 0 # Must be 0 if requesting a rect
RECT = True
WIDTH = 1 # In triads!
HEIGHT = 1 # In triads!

unittest_setup()
set_config("Machine", "version",5)
client = SpallocClient(SPALLOC_URL, SPALLOC_USERNAME, SPALLOC_PASSWORD)
if RECT:
job = client.create_job_rect_at_board(
WIDTH, HEIGHT, triad=(x, y, b), machine_name=SPALLOC_MACHINE,
max_dead_boards=1)
else:
job = client.create_job_board(
triad=(x, y, b), machine_name=SPALLOC_MACHINE)
print(job)
print("Waiting until ready...")
with job:
job.wait_until_ready()
print(job.get_connections())

txrx = job.create_transceiver()
# This call is for testing and can be changed without notice!
dims = txrx._get_machine_dimensions()
print(f"{dims.height=}, {dims.width=}")

machine = txrx.get_machine_details()
print(machine)

input("Press Enter to release...")
client.close()#print(2)#print(2^(1/(2^1)))
7 changes: 4 additions & 3 deletions spinnman/spalloc/spalloc_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def create_job(
def create_job_rect(
self, width: int, height: int,
machine_name: Optional[str] = None,
keepalive = KEEP_ALIVE_PERIOND) -> SpallocJob:
keepalive: int = KEEP_ALIVE_PERIOND) -> SpallocJob:
return self._create({
"dimensions": {
"width": int(width),
Expand All @@ -224,7 +224,7 @@ def create_job_board(
physical: Optional[Tuple[int, int, int]] = None,
ip_address: Optional[str] = None,
machine_name: Optional[str] = None,
keepalive = KEEP_ALIVE_PERIOND) -> SpallocJob:
keepalive: int = KEEP_ALIVE_PERIOND) -> SpallocJob:
board: JsonObject
if triad:
x, y, z = triad
Expand All @@ -248,7 +248,8 @@ def create_job_rect_at_board(
triad: Optional[Tuple[int, int, int]] = None,
physical: Optional[Tuple[int, int, int]] = None,
ip_address: Optional[str] = None,
machine_name: Optional[str] = None, keepalive = KEEP_ALIVE_PERIOND,
machine_name: Optional[str] = None,
keepalive: int = KEEP_ALIVE_PERIOND,
max_dead_boards: int = 0) -> SpallocJob:
board: JsonObject
if triad:
Expand Down

0 comments on commit 2fa288d

Please sign in to comment.