Skip to content

Commit

Permalink
Fix parsing of CHEASE gEQDSK files (#9)
Browse files Browse the repository at this point in the history
* fix parsing of CHEASE gEQDSK files

* bump version number to 1.0.0
  • Loading branch information
orso82 authored Jul 18, 2024
1 parent 20efb29 commit d63c58c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "EFIT"
uuid = "cda752c5-6b03-55a3-9e33-132a441b0c17"
author = ["Luke Stagner <stagnerl@fusion.gat.com>"]
version = "0.2.0"
version = "1.0.0"

[deps]
IMASDD = "06b86afa-9f21-11ec-2ef8-e51b8960cfc5"
Expand Down
22 changes: 19 additions & 3 deletions src/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,31 @@ end
function read_array(t,n)
data = zeros(n)
for i=1:n
data[i] = take!(t)
try
data[i] = take!(t)
catch e
if isa(e, InvalidStateException)
# InvalidStateException when Channel is closed
else
rethrow(e)
end
end
end
return data
end

function read_array2d(t,n,m)
data = zeros(n,m)
for i=1:n, j=1:m
data[i,j] = take!(t)
try
data[i,j] = take!(t)
catch e
if isa(e, InvalidStateException)
# InvalidStateException when Channel is closed
else
rethrow(e)
end
end
end
return data'
end
Expand Down Expand Up @@ -114,7 +130,7 @@ function readg(gfile; set_time=nothing)
f = open(gfile)

desc = readline(f)
idum, time, nw, nh = parse_gfile_header(desc, set_time=set_time)
idum, time, nw, nh = parse_gfile_header(desc; set_time)

token = file_numbers(f)

Expand Down

3 comments on commit d63c58c

@lstagner
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while trying to register: Error in (Julia)Project.toml: Package 'IMASDD' with UUID: 06b86afa-9f21-11ec-2ef8-e51b8960cfc5 not found in registry or stdlib

@anchal-physics
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMASDD is available in FuseRegistry.jl, you can register EFIT.jl there as well.

Please sign in to comment.