[julia-users] Self-referential type array

2014-06-18 Thread Luke Stagner
Hello all, I know it is possible to have a self-referential type like the following type SelfRef obj::SelfRef SelfRef() = (x=new(); x.obj=x) end what I want to do is have obj be an array of type SelfRef so I can make a tree-like structure. I tried the following type SelfRef

Re: [julia-users] Self-referential type array

2014-06-18 Thread Luke Stagner
, Jun 18, 2014 at 4:58 PM, Luke Stagner lstag...@gmail.com javascript: wrote: Thanks Stefan, although I feel like julia x = SelfRef() 1-element Array{SelfRef,1}: SelfRef([SelfRef(#= circular reference =#)]) Should not return an array of type SelfRef. It should return just an instance

Re: [julia-users] Re: Jupyter project

2014-07-16 Thread Luke Stagner
The is also the alchemical symbol for oil http://www.fileformat.info/info/unicode/char/1f746/index.htm ༜

[julia-users] [PyCall] Converting PyObject to Array

2014-11-12 Thread Luke Stagner
Forgive me if this is a basic question. I have a matrix stored in an IDL save file. I have been trying to read it in using PyCall and scipy.io.readsav julia using PyCall julia @pyimport scipy.io as io julia a=io.readsav(weight_and_dist.sav)

[julia-users] Re: [PyCall] Converting PyObject to Array

2014-11-12 Thread Luke Stagner
Yes, the examples work for me. Here is the IDL save file that I used. (700kB). http://www.filedropper.com/weightanddist On Wednesday, November 12, 2014 4:46:07 PM UTC-8, Steven G. Johnson wrote: On Wednesday, November 12, 2014 4:21:12 PM UTC-5, Luke Stagner wrote: Forgive me

[julia-users] Re: [PyCall] Converting PyObject to Array

2014-11-12 Thread Luke Stagner
Sure thing https://github.com/stevengj/PyCall.jl/issues/99 On Wednesday, November 12, 2014 6:58:59 PM UTC-8, Steven G. Johnson wrote: Can you file an issue at PyCall.jl?

Re: [julia-users] Re: Getting people to switch to Julia - tales of no(?) success

2015-03-05 Thread Luke Stagner
Robert, Although it is still under development it looks like https://github.com/tknopp/Julietta.jl might be just what your looking for. At the very least you should keep an eye on it. On Wednesday, March 4, 2015 at 1:41:39 PM UTC-8, Robert wrote: Dear Mike, thanks a lot for your reply! I

[julia-users] Re: Why does my Julia code run so slow?

2015-02-21 Thread Luke Stagner
You may want to try using a profiler. I recently used the ProfileView.jl https://github.com/timholy/ProfileView.jl package to great success. On Friday, February 20, 2015 at 11:53:56 PM UTC-8, Zhixuan Yang wrote: After recompiled an native arch version of Julia and OpenBLAS, it's about 8x

[julia-users] Thin Plate Splines

2015-05-12 Thread Luke Stagner
Hello all, I have a set of irregularly gridded data (x,y,z) and I am trying to create an interpolating surface using Thin Plate Splines. I couldn't find any existing Julia routines so I thought I'd just do it my self. Here is my implementation

[julia-users] Re: 4D interpolation from scattered points

2015-05-13 Thread Luke Stagner
You can use Polyharmonic Splines http://nbviewer.ipython.org/gist/lstagner/04a05b120e0be7de9915 On Wednesday, May 13, 2015 at 5:33:08 AM UTC-7, Yakir Gagnon wrote: I have a bunch (~1000) of x,y,z and a corresponding value, V. One unique V for each x,y,z. I want to interpolate and

Re: [julia-users] Re: Thin Plate Splines

2015-05-13 Thread Luke Stagner
Here is the beginning of a package http://nbviewer.ipython.org/gist/lstagner/04a05b120e0be7de9915 -Luke On Wednesday, May 13, 2015 at 1:03:34 AM UTC-7, René Donner wrote: Thin plate splines are just a special case of Polyharmonic Splines. Would there be interest of expanding this script

Re: [julia-users] Re: Juliacon 2015 videos?

2015-08-12 Thread Luke Stagner
Perhaps they are planning to upload the videos when 0.4 gets released in order to maximize the media impact. On Wednesday, August 12, 2015 at 5:58:50 PM UTC-7, ron...@gmail.com wrote: Five weeks later – still processing the videos? On Thursday, July 2, 2015 at 2:11:52 AM UTC-7, Stefan

[julia-users] Re: Irregular Interpolation

2015-07-29 Thread Luke Stagner
I wrote some code that did Polyharmonic (Thin-plate) splines feel free to use them https://github.com/tlycken/Interpolations.jl/issues/6 On Wednesday, July 29, 2015 at 6:16:59 AM UTC-7, Jude wrote: Hi, I have been using the fantastic grid package by Tim Holy for the past while but I really

Re: [julia-users] Juliacon 2015 videos?

2015-07-20 Thread Luke Stagner
? On Saturday, July 11, 2015 at 9:11:15 AM UTC-7, Ismael VC wrote: I was also specially interested in translating David Sanders *Introduction to Julia* at SciPy 2014. I tried to get in contact with Enthought since January but I never got a reply:  Message: I’d like add translated

Re: [julia-users] Re: error: haskey of NULL PyObject ?

2015-11-04 Thread Luke Stagner
). I get ERROR: > ArgumentError: haskey of NULL PyObject > in plot at C:\Users\Lewis\.julia\v0.4\PyPlot\src\PyPlot.jl:457 > > Matplotlib works fine in IPython. > > I'm stuck. Which directory needs git clean? > > On Wednesday, November 4, 2015 at 2:03:32 PM UTC-8, Lu

Re: [julia-users] Re: error: haskey of NULL PyObject ?

2015-11-04 Thread Luke Stagner
I recently had a similar error. To fix it I had to do git clean -xdf in the julia repository if you installed from source I found the fix in this PyCall issue https://github.com/stevengj/PyCall.jl/issues/65 On Wednesday, November 4, 2015 at 11:58:53 AM UTC-8, Tom Breloff wrote: > > You

Re: [julia-users] Re: error: haskey of NULL PyObject ?

2015-11-04 Thread Luke Stagner
I noticed it happened after I updated anaconda. Perhaps something went wrong there On 11/04/2015 02:01 PM, le...@neilson-levin.org wrote: I have the same problem. I am going back to using a system Python and giving up on conda. Works fine on Mac (par for the course that things tend to work

Re: [julia-users] Nicer syntax collect(linspace(0,1,n))?

2015-10-20 Thread Luke Stagner
Sorry to dredge up this issue again but was there any reason for the return type of linspace to be LinSpace instead of FloatRange. They are seemingly indistinguishable. On Friday, October 9, 2015 at 3:31:31 AM UTC-7, Stefan Karpinski wrote: > > It's amazing how often the problem is the way

[julia-users] Re: ANN: ApproxFun v0.0.8 with (experimental) nonlinear ODE solver

2015-09-16 Thread Luke Stagner
Can this package be used to solve the Grad-Shafranov equation ? On Wednesday, September 16, 2015 at 3:33:22 PM UTC-7, Sheehan Olver wrote: > > > ApproxFun is a package for approximating and solving differential > equations.

Re: [julia-users] Re: ANN: ApproxFun v0.0.8 with (experimental) nonlinear ODE solver

2015-09-16 Thread Luke Stagner
> > > On 17 Sep 2015, at 11:40 am, Luke Stagner <lstag...@gmail.com > > wrote: > > Can this package be used to solve the Grad-Shafranov equation > <https://en.wikipedia.org/wiki/Grad%E2%80%93Shafranov_equation>? > > > On Wednesday, September 16, 2015 at 3

Re: [julia-users] Re: ANN: ApproxFun v0.0.8 with (experimental) nonlinear ODE solver

2015-09-17 Thread Luke Stagner
ithub and I'll jump in where I can :) > > // T > > On Thursday, September 17, 2015 at 8:17:45 AM UTC+2, Sheehan Olver wrote: >> >> On what kind of domain? >> >> >> On 17 Sep 2015, at 12:07 pm, Luke Stagner <lstag...@gmail.com> wrote: >> >>

Re: [julia-users] Re: ANN: ApproxFun v0.0.8 with (experimental) nonlinear ODE solver

2015-09-17 Thread Luke Stagner
r 16, 2015 at 11:17:45 PM UTC-7, Sheehan Olver wrote: > > On what kind of domain? > > > On 17 Sep 2015, at 12:07 pm, Luke Stagner <lstag...@gmail.com > > wrote: > > It's actually a 2D non-linear, elliptic PDE (psi is a function of R,Z). > I'm thinking about create

[julia-users] Re: Finding the index of a type member

2015-09-09 Thread Luke Stagner
Firstly, instead of using ```symbol("is_continuous")``` you can use the colon notation ```:is_continuous```. Secondly, you can do element wise comparison by using ```.==``` operator. This will return a BitArray. You can then find where the BitArray is true by using the ```find``` function

[julia-users] Re: Will Julia likely ever allow negative indexing of arrays

2015-09-29 Thread Luke Stagner
Nice to see more plasma physicists using Julia. a=0.0 > You could just do a[:] = 0.0 to set all the elements to zero or you could do a=zeros(n) In regards to the negative indexing I think that while negative indexing may not be a part of base you should be able to replicate the effect with

[julia-users] Re: Nicer syntax collect(linspace(0,1,n))?

2015-09-29 Thread Luke Stagner
I'm not sure what version of Julia you are using but in Julia 0.3.9 x = linspace(0,1,N) does return a linearly spaced N-element array of floats from 0-1 On Tuesday, September 29, 2015 at 3:44:43 PM UTC-7, feza wrote: > > In matlab x = linspace(0,1,n) creates a vector of floats of length n.

Re: [julia-users] Nicer syntax collect(linspace(0,1,n))?

2015-09-29 Thread Luke Stagner
ck@gmail.com > wrote: > >> No: >> >> julia> logspace(0,3,5) >> 5-element Array{Float64,1}: >> 1.0 >> 5.62341 >>31.6228 >> 177.828 >> 1000.0 >> >> On Tuesday, September 29, 2015 at 8:50:47 PM UTC-4, L

Re: [julia-users] Nicer syntax collect(linspace(0,1,n))?

2015-09-29 Thread Luke Stagner
call so getting feedback would be good. >> >> On Tuesday, September 29, 2015, Patrick Kofod Mogensen < >> patrick@gmail.com > wrote: >> >>> No: >>> >>> julia> logspace(0,3,5) >>> 5-element Array{Float64,1}: >>> 1.0

Re: [julia-users] Nicer syntax collect(linspace(0,1,n))?

2015-09-29 Thread Luke Stagner
call so getting feedback would be good. >> >> On Tuesday, September 29, 2015, Patrick Kofod Mogensen < >> patrick@gmail.com > wrote: >> >>> No: >>> >>> julia> logspace(0,3,5) >>> 5-element Array{Float64,1}: >>> 1.0

Re: [julia-users] Nicer syntax collect(linspace(0,1,n))?

2015-09-30 Thread Luke Stagner
My main objection is that changing the behaviour of linspace is superfluous considering linrange already existed. If the goal was to encourage users to use a range instead of an array that should of been done through documentation through something like a best practices section (e.g. Use

[julia-users] Re: Plasma Actuator Simulation

2015-09-28 Thread Luke Stagner
Ok...wow...I am not surprised it is slow. Well here is what you could try. 1. Wrap everything into a function. Julia has difficulty with globals. 2. You are defining pointless functions in a loop. You can easily change the code to exclude them 3. In your loops you are accessing arrays in row

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread Luke Stagner
Would it be possible to rewrite @printf as a generated function instead of a macro. That way the calling syntax would be more familiar. On Tuesday, September 22, 2015 at 1:07:23 PM UTC-7, Stefan Karpinski wrote: > > Possible, but I don't relish the thought of forever explaining to people > that

[julia-users] Tail indexing

2016-03-22 Thread Luke Stagner
Hello, I've recently come across a situation where I needed to index an array a[:,:,i,j] without having to know how many colons I needed. I accomplished this with the following code. function recursive_slicedim(A,dims,inds) d_len = length(dims) s = slicedim(A,dims[d_len],inds[d_len])

[julia-users] Re: Tail indexing

2016-03-22 Thread Luke Stagner
om/questions/30159815/is-there-a-julia-equivalent-to-numpys-ellipsis-slicing-syntax/30163887#30163887 > and > https://github.com/JuliaLang/julia/issues/5405 > > > Am Dienstag, 22. März 2016 13:10:56 UTC+1 schrieb Luke Stagner: >> >> Hello, >> >> I've recen

[julia-users] Help creating an IDL wrapper using Clang.jl

2016-08-04 Thread Luke Stagner
Its possible to call IDL from C code (Callable IDL) so I figured I could do the same from Julia. I have been trying to use Clang.jl to automatically create the wrapper but I am running into some issues. This project is a bit above my

Re: [julia-users] Help creating an IDL wrapper using Clang.jl

2016-08-05 Thread Luke Stagner
c interface like they did in the python library they > provide in recent versions. Maybe if julia picks up traction they will do > this. > > Bob > > On Thu, Aug 4, 2016 at 12:14 PM, Luke Stagner <lstag...@gmail.com > > wrote: > >> Its possible to call IDL from C

Re: [julia-users] Help creating an IDL wrapper using Clang.jl

2016-09-21 Thread Luke Stagner
DL > commands from strings; that is about it). It would be awesome if IDL would > expose more of the c interface like they did in the python library they > provide in recent versions. Maybe if julia picks up traction they will do > this. > > Bob > > On Thu, Aug 4, 2016

[julia-users] Re: Does Julia 0.5 leak memory?

2016-09-21 Thread Luke Stagner
I just tried my code again using the 0.5 release and the memory is still not releasing. I thought maybe it was caused by using HDF5 but even if i commented out that bit of the code it still doesn't free up the memory. -Luke On Wednesday, September 21, 2016 at 6:53:07 AM UTC-7, Páll Haraldsson

Re: [julia-users] Does Julia 0.5 leak memory?

2016-09-21 Thread Luke Stagner
be the cause of the memory leak you are seeing. -Luke On Wednesday, September 21, 2016 at 5:52:23 PM UTC-7, Yichao Yu wrote: > > On Wed, Sep 21, 2016 at 8:50 PM, Yichao Yu <yyc...@gmail.com > > wrote: > > On Mon, Sep 19, 2016 at 9:14 PM, Luke Stagner <lstag...@gmail.com > &g

Re: [julia-users] Help creating an IDL wrapper using Clang.jl

2016-09-21 Thread Luke Stagner
es > there to get you started. No doubt they are too short and you may have to > look into the code to get things working. I do want to polish this up, so > please provide feedback here or preferably on a github issue. The code > should work on julia 0.4 or 0.5. I have only tested using IDL 8

Re: [julia-users] Does Julia 0.5 leak memory?

2016-09-19 Thread Luke Stagner
I actually ran into this issue too. I have a routine that calculates fast ion orbits that uses a lot of memory (90%). Here is the code (sorry its not very clean). I tried to run the function `make_distribution_file` in a loop