From e19f8896f009803f71b169e2b94f6b1c9d812914 Mon Sep 17 00:00:00 2001 From: Yann Sionneau Date: Mon, 20 Apr 2015 12:49:13 +0200 Subject: [PATCH] artiq_rpctool: document numpy availability in RPC call cmd line arguments --- artiq/frontend/artiq_rpctool.py | 2 +- doc/manual/utilities.rst | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/artiq/frontend/artiq_rpctool.py b/artiq/frontend/artiq_rpctool.py index b9b302fd4..bdecadb89 100755 --- a/artiq/frontend/artiq_rpctool.py +++ b/artiq/frontend/artiq_rpctool.py @@ -3,7 +3,7 @@ import argparse import textwrap import sys -import numpy as np +import numpy as np # Needed to use numpy in RPC call arguments on cmd line from artiq.protocols.pc_rpc import Client diff --git a/doc/manual/utilities.rst b/doc/manual/utilities.rst index 97742192b..212180a23 100644 --- a/doc/manual/utilities.rst +++ b/doc/manual/utilities.rst @@ -61,10 +61,11 @@ in order to call remote functions of an ARTIQ controller. $ artiq_rpctool.py hostname port call -t target f x1 x2 ... xN You can use Python syntax to compute arguments as they will be passed - to the ``eval()`` primitive. But beware to use quotes to separate - arguments which use spaces:: + to the ``eval()`` primitive. The numpy package is available in the namespace + as ``np``. Beware to use quotes to separate arguments which use spaces:: $ artiq_rpctool.py hostname port call -t target f '3 * 4 + 2' True '[1, 2]' + $ artiq_rpctool.py ::1 3256 call load_sample_values 'np.array([1.0, 2.0], dtype=float)' If the called function has a return value, it will get printed to the standard output if the value is not None like in the standard