Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6de650a70173
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5b8f34bae2ac
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Dec 3, 2014

  1. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    jluttine Jaakko Luttinen
    Copy the full SHA
    85b4d70 View commit details
  2. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    jluttine Jaakko Luttinen
    Copy the full SHA
    5b8f34b View commit details
Showing with 19 additions and 2 deletions.
  1. +3 −2 artiq/language/core.py
  2. +16 −0 artiq/management/pyon.py
5 changes: 3 additions & 2 deletions artiq/language/core.py
Original file line number Diff line number Diff line change
@@ -113,15 +113,16 @@ def kernel(arg):
def real_decorator(k_function):
@_wraps(k_function)
def run_on_core(exp, *k_args, **k_kwargs):
getattr(exp, arg).run(k_function, ((exp,) + k_args), k_kwargs)
return getattr(exp, arg).run(k_function,
((exp,) + k_args), k_kwargs)
run_on_core.k_function_info = _KernelFunctionInfo(
core_name=arg, k_function=k_function)
return run_on_core
return real_decorator
else:
@_wraps(arg)
def run_on_core(exp, *k_args, **k_kwargs):
exp.core.run(arg, ((exp,) + k_args), k_kwargs)
return exp.core.run(arg, ((exp,) + k_args), k_kwargs)
run_on_core.k_function_info = _KernelFunctionInfo(
core_name="core", k_function=arg)
return run_on_core
16 changes: 16 additions & 0 deletions artiq/management/pyon.py
Original file line number Diff line number Diff line change
@@ -119,3 +119,19 @@ def decode(s):
"""
return eval(s, _eval_dict, {})


def store_file(filename, x):
"""Encodes a Python object and writes it to the specified file.
"""
with open(filename, "w") as f:
f.write(encode(x))


def load_file(filename):
"""Parses the specified file and returns the decoded Python object.
"""
with open(filename, "r") as f:
return decode(f.read())