File: simple_macro.py

package info (click to toggle)
datalab 1.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 36,260 kB
  • sloc: python: 29,592; makefile: 3
file content (18 lines) | stat: -rw-r--r-- 530 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Simple DataLab macro example

import numpy as np

# When using this code outside of DataLab (which is possible!), you may use the
# client provided by the `Sigima` package (see https://pypi.org/project/sigima/),
# installed with `pip install sigima`, for example, instead of the full DataLab package:
#
# from sigima.client import SimpleRemoteProxy as RemoteProxy
from datalab.control.proxy import RemoteProxy

proxy = RemoteProxy()

z = np.random.rand(20, 20)
proxy.add_image("toto", z)
proxy.compute_fft()

print("All done!")