ngedwin98 / ABCDBeamTrace.jl

ABCD formalism for linear optics in Julia: ray transfer matrices and Gaussian beam propagation
Other
9 stars 3 forks source link

Bug Report: `beamtrace` does not work in julia v1.1 #2

Closed pyramids closed 5 years ago

pyramids commented 5 years ago

Steps to reproduce, tested with julia v1.1:

beamtrace(expander_2x, Beam(512e-9, 1.0e-3))

# output

ERROR: MethodError: no method matching Array{Beam,1}(::Int64)
[...]

Expected output: A return value of type Array{Beam,1}.

Probable cause: I think Γs = Vector{Beam}(length(elems)+1) needs to be changed into Γs = Vector{Beam}(undef, length(elems)+1) due to a change in julia 1.0.

ngedwin98 commented 5 years ago

Thanks for opening the issue and for checking out this package. As stated in the README, the package right now is written for v0.6, and the change you mentioned is indeed one of the breaking changes as a result of using v1.0+.

Have you already tried to implement this change? If so and you wouldn't mind making a pull request, I can have a look. Otherwise, I can try to find some time in the next week to implement this change and test for any other issues on v1.1. Unfortunately, there's no real testing code right now, but I can at least run all the examples and other snippets I've used in the past.

Any other issues found with v1.0+ are also welcome to be brought up, as we might as well fix them all.

ghost commented 5 years ago

I submitted a pull request (#3) but seem to not have referenced this issue properly as it doesn't show up here.