[julia-users] Re: Importing Python data to Julia

2016-10-18 Thread Christoph Ortner
a collaborator of mine is using pyjulia in a similar way - implement reasonably fast interatomic potentials in Julia, but use all the tools available in Python for model setup etc. In case it helps, you can look at https://github.com/libAtoms/JuLIP.jl/blob/master/temp/julip.py as an

Re: [julia-users] Re: quadgk with 2 arguments

2016-10-18 Thread Steven G. Johnson
On Tuesday, October 18, 2016 at 7:05:17 PM UTC-4, Mosè Giordano wrote: > > In any case, I have to admit that quadgk is much more powerful than > what I expected, at least because purely implemented in Julia, so can > work with any Julia type. > quadgk also supports arbitrary-precision

Re: [julia-users] Embedding Julia in C++ - Determining returned array types

2016-10-18 Thread Yichao Yu
On Tue, Oct 18, 2016 at 8:57 PM, Isaiah Norton wrote: > The issue here is that `jl_array_eltype` is already returning a type. > > `jl_typeis(v, t)` becomes `jl_typeof(v) == t`, so your checks become: > > jl_typeof(array_type) == jl_int64_type > > But > >

Re: [julia-users] Embedding Julia in C++ - Determining returned array types

2016-10-18 Thread Isaiah Norton
The issue here is that `jl_array_eltype` is already returning a type. `jl_typeis(v, t)` becomes `jl_typeof(v) == t`, so your checks become: jl_typeof(array_type) == jl_int64_type But jl_typeof(array_type) -> DataType Instead, either do the equality check directly: array_type ==

Re: [julia-users] Re: quadgk with 2 arguments

2016-10-18 Thread Steven G. Johnson
On Tuesday, October 18, 2016 at 7:05:17 PM UTC-4, Mosè Giordano wrote: > > Hi Steven, > > 2016-10-19 0:36 GMT+02:00 Steven G. Johnson >: > > For example: > > > > quadgk(z -> 1/z, 1, 1im, -1, -1im) > > > > integrates 1/z over a closed counter-clockwise

[julia-users] Re: Importing Python data to Julia

2016-10-18 Thread Corbin Foucart
Yes, they were. Is there documentation for pyjulia? I have not found any other than their Readme file... On Tuesday, October 18, 2016 at 5:11:48 PM UTC-4, cdm wrote: > > were the examples you found related to use of PyJulia ... ? > >https://github.com/JuliaPy/pyjulia > > > > On Tuesday,

[julia-users] Re: Importing Python data to Julia

2016-10-18 Thread Corbin Foucart
Yes, I am modifying a finite element code written in python. I would like to perform the operator assembly in Julia rather than python. This will require parsing the finite element data in numpy format. I would like to implement an iterative linear solver on the the global linear system, and

[julia-users] Re: Nemo AcbField error

2016-10-18 Thread Jeffrey Sarnoff
I do not get that error. Are you using the current versions of Julia nd Nemo? You may see a warning message with the first use each session. Here is a transcript:. Let me see yours, and the output of versioninfo(). > using Nemo > c = AcbField(64) Complex Field with 64 bits of precision and

Re: [julia-users] Embedding Julia in C++ - Determining returned array types

2016-10-18 Thread Kyle Kotowick
I apologize for the formatting, that should be: jl_value_t *ret = jl_eval_string(code_string); void* array_type = jl_array_eltype(ret); jl_array_t *ret_array = (jl_array_t*)ret; if (jl_typeis(array_type, jl_int64_type)) { long *data = (long*) jl_array_data(ret_array); } else if

[julia-users] Re: Importing Python data to Julia

2016-10-18 Thread Steven G. Johnson
On Tuesday, October 18, 2016 at 4:42:51 PM UTC-4, Corbin Foucart wrote: > > 2) Call Julia code directly from python (I don't want to perform some > trivial computation as in the examples I've found, I want to operate on the > lists of numpy arrays) > pyjulia can do this.

Re: [julia-users] Re: quadgk with 2 arguments

2016-10-18 Thread Mosè Giordano
Hi Steven, 2016-10-19 0:36 GMT+02:00 Steven G. Johnson : > For example: > > quadgk(z -> 1/z, 1, 1im, -1, -1im) > > integrates 1/z over a closed counter-clockwise diamond-shaped contour around > the origin in the complex plane, returning 2πi by the residue theorem. Did

Re: [julia-users] Re: quadgk with 2 arguments

2016-10-18 Thread Steven G. Johnson
On Tuesday, October 18, 2016 at 4:34:38 PM UTC-4, Michele Zaffalon wrote: > > quadgk(t -> cis(gamma(t)), 0, 1) > No, this is wrong because you forgot the Jacobian factor.

[julia-users] Re: quadgk with 2 arguments

2016-10-18 Thread Steven G. Johnson
On Tuesday, October 18, 2016 at 4:27:22 PM UTC-4, digxx wrote: > > do u have an example for how to use a contour? > quadgk(cis,0,1+1*im)= > probably integrates over the straight line so how can I integrate over the > line gamma(t)=t+im*t^2 > By contour, I just meant straight-line segments.

Re: [julia-users] matrix multiplications

2016-10-18 Thread Steven G. Johnson
On Tuesday, October 18, 2016 at 4:10:57 PM UTC-4, Stefan Karpinski wrote: > > Since it uses the in-place assignment operator .= it could be made to work > as desired, but there's some designing to do. > The problem is that it doesn't know that * is a matrix multiplication until compile-time.

[julia-users] Re: Nemo AcbField error

2016-10-18 Thread digxx
Hey, Sorry but I also get this error when I write r=AcbField(64) r(1,1) Likewise r=ArbField(64) r(1) gives me the same error...

[julia-users] Re: ANN: Symata.jl

2016-10-18 Thread lapeyre . math122a
Thanks. Regarding reimplementing the sympy functions, I can't predict what will happen. There is a lot to be done that is not related to sympy... work on pattern matching, refactoring, etc. For the forseeable future, I think it makes sense to do this only in cases where the efficiency gained

[julia-users] Re: Importing Python data to Julia

2016-10-18 Thread cdm
were the examples you found related to use of PyJulia ... ? https://github.com/JuliaPy/pyjulia On Tuesday, October 18, 2016 at 1:42:51 PM UTC-7, Corbin Foucart wrote: > > Suppose that I have a large Python code; I would like to use Julia to > operate on the python workspace variables at

[julia-users] Re: ANN: Symata.jl

2016-10-18 Thread mmus
Very cool. Great work. Out of curiosity is the plan to implement all the sympy functions in the Julia in the future? On Tuesday, October 18, 2016 at 4:01:15 PM UTC-4, lapeyre@gmail.com wrote: > > Symata.jl is a symbolic math language. (The old name was SJulia.) > > You can add it with

[julia-users] Re: Importing Python data to Julia

2016-10-18 Thread Cedric St-Jean
Could you provide a more concrete example of what you're trying to do? On Tuesday, October 18, 2016 at 4:42:51 PM UTC-4, Corbin Foucart wrote: > > Suppose that I have a large Python code; I would like to use Julia to > operate on the python workspace variables at certain locations in the code.

[julia-users] Importing Python data to Julia

2016-10-18 Thread Corbin Foucart
Suppose that I have a large Python code; I would like to use Julia to operate on the python workspace variables at certain locations in the code. What occurs to me is to either: 1) write out all python workspace data to file, read data into julia, operate, save, read back into python (seems

Re: [julia-users] Re: quadgk with 2 arguments

2016-10-18 Thread Michele Zaffalon
quadgk(t -> cis(gamma(t)), 0, 1) On Tue, Oct 18, 2016 at 10:27 PM, digxx wrote: > do u have an example for how to use a contour? > quadgk(cis,0,1+1*im) > probably integrates over the straight line so how can I integrate over the > line gamma(t)=t+im*t^2 >

[julia-users] Re: quadgk with 2 arguments

2016-10-18 Thread digxx
do u have an example for how to use a contour? quadgk(cis,0,1+1*im) probably integrates over the straight line so how can I integrate over the line gamma(t)=t+im*t^2

[julia-users] Re: thread safe locks and Julia 0.4

2016-10-18 Thread Ryan Gardner
Thanks. Makes sense now. On Tuesday, October 18, 2016 at 3:53:00 PM UTC-4, Ryan Gardner wrote: > > The documentation for Julia 0.5.0 says that the lock returned by > ReentrantLock() "is NOT threadsafe" ( > http://docs.julialang.org/en/release-0.5/stdlib/parallel/ see > ReentrantLock()) .

Re: [julia-users] thread safe locks and Julia 0.4

2016-10-18 Thread Stefan Karpinski
The task stuff and threading stuff will converge but for now they're separate. Part of the "experimental" label. On Tue, Oct 18, 2016 at 3:57 PM, Yichao Yu wrote: > > > On Tue, Oct 18, 2016 at 3:53 PM, Ryan Gardner wrote: > >> The documentation for Julia

Re: [julia-users] matrix multiplications

2016-10-18 Thread Stefan Karpinski
Since it uses the in-place assignment operator .= it could be made to work as desired, but there's some designing to do. On Tue, Oct 18, 2016 at 2:55 PM, Cameron McBride wrote: > You mean like the following? > > julia> A=[1.0 2.0; 3.0 4.0]; B=[1.0 1.0; 1.0 1.0]; Y =

[julia-users] ANN: Symata.jl

2016-10-18 Thread lapeyre . math122a
Symata.jl is a symbolic math language. (The old name was SJulia.) You can add it with Pkg.add("Symata.jl"). The site is https://github.com/jlapeyre/Symata.jl Notebook examples are here https://github.com/jlapeyre/Symata.jl/tree/master/examples (the math looks better in live Jupyter sessions)

Re: [julia-users] thread safe locks and Julia 0.4

2016-10-18 Thread Yichao Yu
On Tue, Oct 18, 2016 at 3:53 PM, Ryan Gardner wrote: > The documentation for Julia 0.5.0 says that the lock returned by > ReentrantLock() "is NOT threadsafe" ( http://docs.julialang.org/en/ > release-0.5/stdlib/parallel/ see ReentrantLock()) . What does that > mean? I

[julia-users] thread safe locks and Julia 0.4

2016-10-18 Thread Ryan Gardner
The documentation for Julia 0.5.0 says that the lock returned by ReentrantLock() "is NOT threadsafe" ( http://docs.julialang.org/en/release-0.5/stdlib/parallel/ see ReentrantLock()) . What does that mean? I interpret it to mean that I cannot safely call lock or unlock simultaneously with

Re: [julia-users] matrix multiplications

2016-10-18 Thread Cameron McBride
You mean like the following? julia> A=[1.0 2.0; 3.0 4.0]; B=[1.0 1.0; 1.0 1.0]; Y = similar(B); Y.= A * B This doesn’t work as you might hope. I believe it just creates a temporary result of A*B and then stuffs it into the preexisting Y. On Tue, Oct 18, 2016 at 2:41 PM, Jérémy Béjanin

Re: [julia-users] matrix multiplications

2016-10-18 Thread Jérémy Béjanin
I know, I was asking about that being the default behaviour of * On Tuesday, October 18, 2016 at 2:10:14 PM UTC-4, Stefan Karpinski wrote: > > That's what A_mul_B! does. > > On Tue, Oct 18, 2016 at 1:45 PM, Jérémy Béjanin > wrote: > >> I think this is something I might

Re: [julia-users] Recasting arrays

2016-10-18 Thread Jérémy Béjanin
Thanks, not sure how I missed that... On Tuesday, October 18, 2016 at 1:55:58 PM UTC-4, Yichao Yu wrote: > > > > On Tue, Oct 18, 2016 at 1:38 PM, Jérémy Béjanin > wrote: > >> I have seen the rem(a,b) function being used to recast numbers, but I was >> wondering if there

Re: [julia-users] matrix multiplications

2016-10-18 Thread Stefan Karpinski
That's what A_mul_B! does. On Tue, Oct 18, 2016 at 1:45 PM, Jérémy Béjanin wrote: > I think this is something I might have read about in the past, but are > there plans to make y = a*b use an already allocated y? > > On Tuesday, October 18, 2016 at 12:38:00 PM UTC-4,

[julia-users] Existential quantifier

2016-10-18 Thread Kevin Liu
What's the right way to do this? julia> parse("∃x(sister(x,Spot) & cat(x))") LoadError: ParseError("invalid character \"∃\"") while loading In[15], in expression starting on line 7 in parse at parse.jl:180 in parse at parse.jl:190 Thanks, Kevin

Re: [julia-users] Recasting arrays

2016-10-18 Thread Yichao Yu
On Tue, Oct 18, 2016 at 1:38 PM, Jérémy Béjanin wrote: > I have seen the rem(a,b) function being used to recast numbers, but I was > wondering if there was a way to recast arrays as in C. > Do note that this is undefined in standard C. > > Say, for example, that I

Re: [julia-users] matrix multiplications

2016-10-18 Thread Jérémy Béjanin
I think this is something I might have read about in the past, but are there plans to make y = a*b use an already allocated y? On Tuesday, October 18, 2016 at 12:38:00 PM UTC-4, Stefan Karpinski wrote: > > A_mul_B!(Y, A, B) -> Y > > Calculates the matrix-matrix or matrix-vector product A⋅B

[julia-users] Recasting arrays

2016-10-18 Thread Jérémy Béjanin
I have seen the rem(a,b) function being used to recast numbers, but I was wondering if there was a way to recast arrays as in C. Say, for example, that I have an array of bytes, is it possible to recast that array as UInt16, by taking pairs of bytes, or as Int32 by taking each consecutive 4

Re: [julia-users] matrix multiplications

2016-10-18 Thread Stefan Karpinski
A_mul_B!(Y, A, B) -> Y Calculates the matrix-matrix or matrix-vector product A⋅B and stores the result in Y, overwriting the existing value of Y. Note that Y must not be aliased with either A or B. julia> A=[1.0 2.0; 3.0 4.0]; B=[1.0 1.0; 1.0 1.0]; Y = similar(B); A_mul_B!(Y, A, B);

[julia-users] matrix multiplications

2016-10-18 Thread zamani . majid1989
hi guys is there a way to reduce allocated memory in matrix multiplications? for example this code blew in my machine gives : function test4(n) a = rand(n,n) for i = 1:100 a*a end end -- answer -- test4(1) # force compiling @time

[julia-users] Re: run command inserting spurious newlines into return values

2016-10-18 Thread jason . bates
Piping the powershell output to Write-Host was sufficient to get it to work for .xml files, but it broke on .gz files. However, following the suggestion here: (https://github.com/JuliaPackaging/WinRPM.jl/pull/81), I changed the download function to a call to BinDeps.download_cmd, and that

[julia-users] lowest-latency way to use @manipulate + Plotly to update data?

2016-10-18 Thread Spencer Russell
Is there any lower-latency way to live-update data in a jupyter notebook than this? ``` p = plot(scatter()) @manipulate for phase=0.0:0.01:2pi e = sin(linspace(0.0, 2pi, 50)+phase) restyle!(p, y=[e]) end p ``` It’s not too bad, but I’m greedy. -s

[julia-users] Re: How to print an array with the correct shape in 0.5

2016-10-18 Thread spaceLem
Thanks, that's what I was looking for! Regards, Jamie On Saturday, 8 October 2016 22:20:45 UTC+1, Steven G. Johnson wrote: > > > > On Friday, October 7, 2016 at 9:30:00 AM UTC-4, spaceLem wrote: >> >> In Julia 0.4.6 I could print or @show a 2d array, and it would give me a >> nicely formatted

[julia-users] Re: Parallel file access

2016-10-18 Thread 'John Hearns' via julia-users
I think Steven Sagaert makes some good points. I just did a search forRomio Julia and dammit, got a lot of responses about a medieval play by some bloke called William Shakespeare. (ps ROMIO http://www.mcs.anl.gov/project/romio-high-performance-portable-mpi-io-implementation )

[julia-users] Re: Local Atom-Juno with remote Julia ?

2016-10-18 Thread 'Philippe Roy' via julia-users
Found the answer : http://discuss.junolab.org/t/is-it-possible-to-run-julia-and-juno-on-different-machines/299 Le lundi 17 octobre 2016 14:20:53 UTC-4, Philippe Roy a écrit : > > Hello, > > I'd like to know if it's possible to use a local installation of Juno/Atom > with a Julia session on

[julia-users] Re: Nemo AcbField error

2016-10-18 Thread 'Bill Hart' via julia-users
This is probably something we could fix easily enough. By the way, feel free to send support queries for Nemo to the Google list nemo-devel if you prefer. I believe Jeffrey is also signed up there, but we don't all notice the posts here. Bill. On Monday, 17 October 2016 22:43:07 UTC+2,

[julia-users] Wrap Julia docstrings in Atom

2016-10-18 Thread Josef Heinen
Is there a way to wrap Julia docstrings in Atom? The editor currently displays two lines, one containing the method signature (first line) and one containing the following lines of the docstring. How can I configure Atom to wrap the second line?

[julia-users] Re: Parallel file access

2016-10-18 Thread Steven Sagaert
Well if you want multiple processes to write into the db you should use one that can handle concurrency, i.e. a "real" DB not a simple desktop/embedded DB like SQLlite. So for example Postgres or if you do not want to deal with SQL then use a NOSQL db e.g. mongodb (there are many more). For a