def _make_summary(self, **kwargs): res = "" repeat = self.repeat if repeat > 1: printable_repeat = f"repeat the following scan {repeat} times" else: printable_repeat = "perform the following scan" res += format_header(printable_repeat, line="=") + "\n\n" vals = self.values adjs = [repr(a) for a in self.adjustables] res += printable_table(vals, adjs, **kwargs) res += "\n\n" n_pulses_per_step = self.n_pulses_per_step printable_pulses = f"{n_pulses_per_step} pulse" if n_pulses_per_step != 1: printable_pulses += "s" head = f"record {printable_pulses} per step to \"{self.filename}\" via" acqs = itemize(self.acquisitions, header=head) res += acqs return res
def check(self, print_online=False, print_offline=True): try: online, offline = self.status except Exception as e: print(COLOR_BAD, end="") print("Channel status check failed due to:") print(e) print(COLOR_RESET) return if print_online and online: print(COLOR_GOOD, end="") print(itemize(online, header="Online Channels")) print(COLOR_RESET) if print_offline and offline: print(COLOR_BAD, end="") print(itemize(offline, header="Offline Channels")) print(COLOR_RESET)
def cleanup(self, silent=False): online, offline = self.status if offline: self.clear() self.update(online) if silent: return print(itemize(offline, header="Removed offline channels")) print( "(Note: The channels have not been deleted from the respective config file.)" )
def __repr__(self): res = super().__repr__() if self.filenames: items = itemize(self.filenames, header="Output files") res = f"{res}\n\n{items}" return res
def __repr__(self): return itemize(sorted(self))
def avail(search=None): available = sorted(bs_avail(search=search)) print(itemize(available, header="Available Channels"))