Skip to content

Commit

Permalink
Merge pull request #12 from ISISComputingGroup/fixes_pyright_system_t…
Browse files Browse the repository at this point in the history
…ests

Get instrument full name
  • Loading branch information
FreddieAkeroyd authored Jan 3, 2025
2 parents 00312af + 4ce1235 commit a7dd06c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/genie_python/genie_advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,19 @@ def get_instrument() -> str | None:
return __api.get_instrument()


@usercommand
@helparglist("")
@log_command_and_handle_exception
def get_instrument_full_name() -> str | None:
"""
Gets the full name of the local instrument
Returns:
the full name of the machine
"""
return __api.get_instrument_full_name()


@usercommand
@helparglist("verbose")
@log_command_and_handle_exception
Expand Down
4 changes: 4 additions & 0 deletions src/genie_python/genie_simulate_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import inspect
import os
import socket
import xml.etree.ElementTree as ET
from builtins import object, str
from collections import OrderedDict
Expand Down Expand Up @@ -1263,3 +1264,6 @@ def get_alarm_from_block(self, block: str) -> str:

def get_block_units(self, block: str) -> str:
return "mm"

def get_instrument_full_name(self) -> str:
return socket.gethostname()

0 comments on commit a7dd06c

Please sign in to comment.