Skip to content

Commit

Permalink
Change IMASDD to IMASdd
Browse files Browse the repository at this point in the history
  • Loading branch information
eldond committed Aug 1, 2024
1 parent 01d933c commit 91da7c3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
20 changes: 10 additions & 10 deletions src/SOLPS2IMAS.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module SOLPS2IMAS

using Revise
using IMASDD: IMASDD
using IMASdd: IMASdd
using NCDatasets: Dataset, dimnames
using YAML: load_file as YAML_load_file
using DelimitedFiles: readdlm
Expand Down Expand Up @@ -43,7 +42,7 @@ dict2prop!(obj, dict) =
solps_var_to_imas = YAML_load_file("$(@__DIR__)/solps_var_to_imas.yml")
"""
val_obj(
ggd::IMASDD.edge_profiles__ggd,
ggd::IMASdd.edge_profiles__ggd,
var::String,
grid_ggd_index::Int;
gsi_ch::Dict{Int, Int}=Dict{Int, Int}(),
Expand All @@ -55,7 +54,7 @@ Optionally, a mapping of possibly changes in grid_subset_index can be provided a
a dictionary gsi_ch.
"""
function val_obj(
ggd::IMASDD.edge_profiles__ggd,
ggd::IMASdd.edge_profiles__ggd,
var::String,
grid_ggd_index::Int;
gsi_ch::Dict{Int, Int}=Dict{Int, Int}(),
Expand Down Expand Up @@ -112,15 +111,15 @@ chosen_tri_edge_order = [(1, (1, 2)),

"""
load_summary_data!(
ids::IMASDD.dd,
ids::IMASdd.dd,
b2_parameters::Tuple{String, String, String, String}=("", "", "", "");
)
Loads high level shot summary data into the summary IDS after reading and interpreting
SOLPS input files, such as b2.*.parameters.
"""
function load_summary_data!(
ids::IMASDD.dd,
ids::IMASdd.dd,
b2_parameters::Tuple{String, String, String, String}=("", "", "", "");
)
bdry_info = nothing
Expand Down Expand Up @@ -178,7 +177,7 @@ end
fort_tol::Float64=1e-6,
b2_parameters::Tuple{String, String, String, String,}=("", "", "", ""),
load_bb::Bool=false,
)::IMASDD.dd
)::IMASdd.dd
Main function of the module. Takes in a geometry file and an (optional) output file
(either b2time or b2fstate) and a grid\\_ggd description in the form of a Dict or
Expand All @@ -196,8 +195,8 @@ function solps2imas(
fort_tol::Float64=1e-6,
b2_parameters::Tuple{String, String, String, String}=("", "", "", ""),
load_bb::Bool=true,
ids::IMASDD.dd = IMASDD.dd()
)::IMASDD.dd
ids::IMASdd.dd = IMASDD.dd()
)::IMASdd.dd
# Setup the grid first
gmtry = read_b2_output(b2gmtry)

Expand Down Expand Up @@ -552,12 +551,13 @@ function solps2imas(
end # End of setting up space
end


# If an equilibrium flux map exists for one and only one time slice, override
# the default time that would be assigned to the grid and use the equilibrium
# time instead.
eq_times = []
if hasproperty(ids, :equilibrium)
if hasproperty(ids.equilibrium, :time)
if hasproperty(ids.equilibrium, :time) && !ismissing(ids.equilibrium, :time)
eq_times = ids.equilibrium.time
end
end
Expand Down
12 changes: 6 additions & 6 deletions src/solps_mesh_tools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ function data_xytoc(data::Matrix{Float64}; nx::Int)::Vector{Float64}
return flat_data
end

edges_nodes_type = IMASDD.IDSvector{
IMASDD.edge_profiles__grid_ggd___space___objects_per_dimension___object{T},
edges_nodes_type = IMASdd.IDSvector{
IMASdd.edge_profiles__grid_ggd___space___objects_per_dimension___object{T},
} where {T}

"""
search_point(
nodes::IMASDD.IDSvector{IMASDD.edge_profiles__grid_ggd___space___objects_per_dimension___object{T}},
nodes::IMASdd.IDSvector{IMASdd.edge_profiles__grid_ggd___space___objects_per_dimension___object{T}},
r::Real,
z::Real;
tol::Float64=0.0,
Expand Down Expand Up @@ -71,7 +71,7 @@ end

"""
search_edges(
edges::IMASDD.IDSvector{IMASDD.edge_profiles__grid_ggd___space___objects_per_dimension___object{T}},
edges::IMASdd.IDSvector{IMASdd.edge_profiles__grid_ggd___space___objects_per_dimension___object{T}},
edge_nodes::Array{Int, 1}
)::Int where {T}
Expand Down Expand Up @@ -210,8 +210,8 @@ end

"""
attach_neightbours!(
cells::IMASDD.IDSvector{IMASDD.edge_profiles__grid_ggd___space___objects_per_dimension___object{T}},
edges::IMASDD.IDSvector{IMASDD.edge_profiles__grid_ggd___space___objects_per_dimension___object{T}},
cells::IMASdd.IDSvector{IMASdd.edge_profiles__grid_ggd___space___objects_per_dimension___object{T}},
edges::IMASdd.IDSvector{IMASdd.edge_profiles__grid_ggd___space___objects_per_dimension___object{T}},
gmtry::Dict{String, Dict{String, Any}},
it::Int,
) where {T}
Expand Down
6 changes: 3 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using SOLPS2IMAS: SOLPS2IMAS
using Test
using YAML: load_file as YAML_load_file
using ArgParse: ArgParse
using IMASDD: IMASDD
using IMASdd: IMASdd
import SOLPS2IMAS: get_grid_subset, read_b2_boundary_parameters

allowed_rtol = 1e-4
Expand Down Expand Up @@ -103,7 +103,7 @@ if args["parser"]
for ark always_required_keys
@test ark in keys(b2mn_data)
end
b2mn_json = IMASDD.JSON.parsefile(b2mn_sample * ".json")
b2mn_json = IMASdd.JSON.parsefile(b2mn_sample * ".json")
@test b2mn_json == b2mn_data
end
end
Expand Down Expand Up @@ -295,7 +295,7 @@ if args["namelist"]
boundary_params["number_of_core_source_boundaries"]

# Using parameters namelist to populate summary data
ids = IMASDD.dd()
ids = IMASdd.dd()
SOLPS2IMAS.load_summary_data!(ids, (testfile, "", "", ""))
@test !(ismissing(ids.summary.heating_current_drive.power_ec, :value))
end
Expand Down

0 comments on commit 91da7c3

Please sign in to comment.