<jupyter_start><jupyter_text>Julia methods as actors  Installing necessary requirements1) Install Julia itself. Start from here: 2) Install `PyCall` which is a Python binding library for Julia (i.e. calling Python from Julia).```juliajulia> Pkg.update()julia> Pkg.add("PyCall")```3) Install `pyjulia` Python package:3a) Download it from github.com: ```bashgit clone <EMAIL>:JuliaLang/pyjulia.git```3b) Install the package:```bashcd pyjuliapip install .               Copy to site-packages pip install -e .          Makes link to current directory in site-packages```4) Try in Python:```pythonimport juliajl = julia.Julia()         Takes a few secondsjl.eval("2 + 2")           Should immediately return "4"```<jupyter_code>%load_ext autoreload
%autoreload(2)
from wowp.actors.julia import JuliaMethod
from wowp.schedulers import LinearizedScheduler
import numpy as np<jupyter_output><empty_output><jupyter_text>Simple calling<jupyter_code>sqrt = JuliaMethod("sqrt", inports="a")
sqrt(4)<jupyter_output><empty_output><jupyter_text>Calling on numpy arrays<jupyter_code>sqrt = JuliaMethod("sqrt", inports="a")

array = np.random.rand(5, 5)
scheduler = LinearizedScheduler()
scheduler.put_value(sqrt.inports.a, array)
scheduler.execute()
sqrt.outports.result.pop()<jupyter_output><empty_output><jupyter_text>Chain sqrt method to pass numpy arrays<jupyter_code>sqrt = JuliaMethod("sqrt", inports="a")
sqrt2 = JuliaMethod("sqrt", inports="a")

sqrt.outports.result.connect(sqrt2.inports.a)

array = np.random.rand(5, 5)
scheduler = LinearizedScheduler()
scheduler.put_value(sqrt.inports.a, array)
scheduler.execute()
sqrt2.outports.result.pop()<jupyter_output><empty_output><jupyter_text>Using method from a package<jupyter_code>%%file ABCD.jl

module ABCD

VERSION < v"0.4-" && using Docile

export quad

@doc doc"""Fourth power of the argument.""" ->
function quad(a)
    a ^ 4
end

end
quad = JuliaMethod(package_name="ABCD", method_name="quad", inports="a")
quad(4.0)
quad.name<jupyter_output><empty_output><jupyter_text>Non-existent module or package<jupyter_code>xxx = JuliaMethod(package_name="ABBD", method_name="x")
xxx()
xxx = JuliaMethod(package_name="ABCD", method_name="xx")
xxx()<jupyter_output><empty_output><jupyter_text>Unicode identifiers The page of julia states that unicode identifiers are not valid. This is true for automatically imported methods. But not for `JuliaMethod`. Names like `πtimes!` are fine :-)<jupyter_code>%%file UnicodePi.jl

module UnicodePi

VERSION < v"0.4-" && using Docile

export πtimes!

@doc doc"""Return pi times argument""" ->
function πtimes!(a)
    π * a
end

end
pi_times = JuliaMethod(package_name="UnicodePi", method_name="πtimes!", inports="x")
print(pi_times.name)
pi_times(4)
from wowp.tools.plotting import ipy_show
ipy_show(pi_times)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12744053958111465, 'fraction_numerical': 0.009229676961306355, 'mean_word_length': 6.49468085106383, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '285714', 'license': 'MIT', 'n_tokens_mistral': 996, 'n_tokens_neox': 952, 'n_words': 228, 'path': 'notebooks/Tutorial/julia.ipynb', 'repo_name': 'coobas/wowp', 'size': '2824'}