Skip to content

Commit

Permalink
Replace OMAS with IMASDD
Browse files Browse the repository at this point in the history
  • Loading branch information
eldond committed Mar 12, 2024
1 parent 3e3004d commit f843e6a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ version = "0.2.0"
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
GGDUtils = "b7b5e640-9b39-4803-84eb-376048795def"
IMASDD = "06b86afa-9f21-11ec-2ef8-e51b8960cfc5"
NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
OMAS = "91cfaa06-6526-4804-8666-b540b3feef2f"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
6 changes: 3 additions & 3 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ env_with_cloned_repo r:
@echo "Cloning the repositories and generating Manifest.toml"
-dn=$(shell dirname $(shell pwd)); \
if [[ "$${dn:(-10)}" == ".julia/dev" ]]; then ext="" ; else ext=".jl";fi; \
git clone "git@github.com:ProjectTorreyPines/OMAS.jl.git" ../OMAS$${ext}; \
git clone "git@github.com:ProjectTorreyPines/IMASDD.jl.git" ../IMASDD$${ext}; \
git clone "git@github.com:ProjectTorreyPines/GGDUtils.jl.git" ../GGDUtils$${ext}; \
julia --project=. -e 'using Pkg; Pkg.rm(["OMAS", "GGDUtils"]); Pkg.develop(path="../OMAS'$${ext}'"); Pkg.develop(path="../GGDUtils'$${ext}'"); Pkg.instantiate()'
julia --project=. -e 'using Pkg; Pkg.rm(["IMASDD", "GGDUtils"]); Pkg.develop(path="../IMASDD'$${ext}'"); Pkg.develop(path="../GGDUtils'$${ext}'"); Pkg.instantiate()'

env_with_git_url u:
@echo "Pulling sample files using dvc"
-dvc pull
@echo "Creating Julia environment with the git urls without creating local clones"
@echo "Generating Project.toml and Manifest.toml"
julia --project=. -e 'using Pkg; Pkg.rm(["OMAS", "GGDUtils"]); Pkg.add(url="git@github.com:ProjectTorreyPines/OMAS.jl.git", rev="master"); Pkg.add(url="git@github.com:ProjectTorreyPines/GGDUtils.jl.git", rev="master"); Pkg.instantiate()'
julia --project=. -e 'using Pkg; Pkg.rm(["IMASDD", "GGDUtils"]); Pkg.add(url="git@github.com:ProjectTorreyPines/IMASDD.jl.git", rev="master"); Pkg.add(url="git@github.com:ProjectTorreyPines/GGDUtils.jl.git", rev="master"); Pkg.instantiate()'

clean:
@echo "Deleting Manifest.toml"
Expand Down
8 changes: 4 additions & 4 deletions src/SOLPS2IMAS.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module SOLPS2IMAS

using Revise
using OMAS: OMAS
using IMASDD: IMASDD
using NCDatasets: Dataset, dimnames
using YAML: load_file as YAML_load_file
using DelimitedFiles: readdlm
Expand Down Expand Up @@ -86,7 +86,7 @@ end
Main function of the module. Takes in a geometry file and a
output file (either b2time or b2fstate) and a grid_ggd
description in the form of a Dict or filename to equivalent
YAML file. Returns data in OMAS.dd datastructure.
YAML file. Returns data in IMASDD.dd datastructure.
"""
function solps2imas(
b2gmtry,
Expand All @@ -95,8 +95,8 @@ function solps2imas(
b2mn=nothing,
load_bb=false,
)
# Initialize an empty OMAS data structre
ids = OMAS.dd()
# Initialize an empty IMAS data structre
ids = IMASDD.dd()

# Setup the grid first
gmtry = read_b2_output(b2gmtry)
Expand Down
2 changes: 1 addition & 1 deletion src/solps_var_to_imas.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# List of conversion from solps variable name to ggd object structure
# Format:
# <solps_var_name>: [path_to_value_object, grid_subset_index]
# path_to_value_object is a string written in same format as OMAS schema table
# path_to_value_object is a string written in same format as IMAS schema table
# For choosing an instance of an object in array, use [] for giving index
# For appending to the object array, use [:]
# Example:
Expand Down
4 changes: 2 additions & 2 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 OMAS: OMAS
using IMASDD: IMASDD

allowed_rtol = 1e-4

Expand Down Expand Up @@ -91,7 +91,7 @@ if args["parser"]
for ark always_required_keys
@test ark in keys(b2mn_data)
end
b2mn_json = OMAS.JSON.parsefile(b2mn_sample * ".json")
b2mn_json = IMASDD.JSON.parsefile(b2mn_sample * ".json")
@test b2mn_json == b2mn_data
end
end
Expand Down

0 comments on commit f843e6a

Please sign in to comment.