Skip to content

Commit

Permalink
Temporarily removing Fortran90Namelists dep
Browse files Browse the repository at this point in the history
Fortran90Namelists is not registered package with Julia and is being used
for only one function in this repo right now:

read_b2_boundary_parameters

This commit comments out any usage of Fortran90Namelists and removes it
from dependency list. Once this package is registered with Julia, this
feature will be brought back in.
  • Loading branch information
anchal-physics committed Oct 4, 2024
1 parent e04c889 commit 0d2ef6b
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 25 deletions.
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ version = "1.0.3"
[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
Fortran90Namelists = "8fb689aa-71ff-4044-8071-0cffc910b57d"
IMASdd = "c5a45a97-b3f9-491c-b9a7-aa88c3bc0067"
IMASggd = "b7b5e640-9b39-4803-84eb-376048795def"
NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
Expand All @@ -17,7 +16,6 @@ YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
[compat]
ArgParse = "1"
DelimitedFiles = "1.9.1"
Fortran90Namelists = "0.1"
IMASdd = "2"
IMASggd = "2"
NCDatasets = "0.14.4"
Expand Down
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
SOLPS2imas = "09becab6-0636-4c23-a92a-2b3723265c31"
1 change: 0 additions & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ This module uses some parsing functions which can be used standalone as well
read_b2_output
read_b2mn_output
read_b2time_output
read_b2_boundary_parameters
```

## SOLPS Mesh Tools
Expand Down
2 changes: 1 addition & 1 deletion src/SOLPS2imas.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ using YAML: load_file as YAML_load_file
using DelimitedFiles: readdlm
import IMASggd: add_subset_element!, get_grid_subset, get_subset_boundary,
get_subset_space, subset_do, deepcopy_subset
using Fortran90Namelists
# import Fortran90Namelists: readnml

export solps2imas, load_summary_data!

Expand Down
2 changes: 1 addition & 1 deletion src/parser.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export read_b2_output, read_b2mn_output, read_b2time_output, read_b2_boundary_parameters
export read_b2_output, read_b2mn_output, read_b2time_output # , read_b2_boundary_parameters

"""
read_b2time_output(filename::String)::Dict{String, Dict{String, Any}}
Expand Down
40 changes: 20 additions & 20 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using Test
using YAML: load_file as YAML_load_file
using ArgParse: ArgParse
using IMASdd: IMASdd
import SOLPS2imas: get_grid_subset, read_b2_boundary_parameters
import SOLPS2imas: get_grid_subset # , read_b2_boundary_parameters

allowed_rtol = 1e-4

Expand Down Expand Up @@ -31,9 +31,9 @@ function parse_commandline()
["--fort"],
Dict(:help => "Test triangular mesh generation from fort files",
:action => :store_true),
["--namelist"],
Dict(:help => "Test parsing of namelists",
:action => :store_true),
# ["--namelist"],
# Dict(:help => "Test parsing of namelists",
# :action => :store_true),
)
args = ArgParse.parse_args(localARGS, s)
if !any(values(args)) # If no flags are set, run all tests
Expand Down Expand Up @@ -283,20 +283,20 @@ if args["fort"]
end
end

if args["namelist"]
@testset "Test parsing of namelists" begin
# Basic parameters namelist parsing
testfile = "$(@__DIR__)/../samples/b2.boundary.parameters"
boundary_params = SOLPS2imas.read_b2_boundary_parameters(testfile)
println(boundary_params)
@test boundary_params["power_electrons"] > 0.0
@test boundary_params["power_ions"] > 0.0
@test boundary_params["number_of_boundaries"] >
boundary_params["number_of_core_source_boundaries"]
# if args["namelist"]
# @testset "Test parsing of namelists" begin
# # Basic parameters namelist parsing
# testfile = "$(@__DIR__)/../samples/b2.boundary.parameters"
# boundary_params = SOLPS2imas.read_b2_boundary_parameters(testfile)
# println(boundary_params)
# @test boundary_params["power_electrons"] > 0.0
# @test boundary_params["power_ions"] > 0.0
# @test boundary_params["number_of_boundaries"] >
# boundary_params["number_of_core_source_boundaries"]

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

0 comments on commit 0d2ef6b

Please sign in to comment.