Skip to content

Commit

Permalink
Name change SD4SOLPS -> SOLPS2ctrl
Browse files Browse the repository at this point in the history
Changed name SD4SOLPS to SOLPS2ctrl everywhere.

Using new names od dependencies that are registered with Julia Registry:

* IMASggd
* SOLPS2imas

Updating version to 2.0.0

Added test coverage

Minor bug fix in using IMAS.flux_surfaces function.
  • Loading branch information
anchal-physics committed Oct 22, 2024
1 parent 76b4e8c commit 7e7f16d
Show file tree
Hide file tree
Showing 11 changed files with 116 additions and 110 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
test:
uses: ProjectTorreyPines/GitHubActionsWorkflows/.github/workflows/test.yml@master
secrets: inherit
with:
use_coverage: true
# Optional inputs for artifact uploading
# For example, uncomment the following 4 lines to upload test result images that
# will be generated by test/runtests.jl in test directory
Expand Down
6 changes: 3 additions & 3 deletions NOTICE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
GGDUtils.jl
SOLPS2ctrl.jl
=========

The purpose of this NOTICE file is to provide legal notices and acknowledgments that must be displayed to users in any derivative works or distributions. This file does not alter the terms of the Apache 2.0 license that governs the use and distribution of the GGDUtils.jl package.
The purpose of this NOTICE file is to provide legal notices and acknowledgments that must be displayed to users in any derivative works or distributions. This file does not alter the terms of the Apache 2.0 license that governs the use and distribution of the SOLPS2ctrl.jl package.

GGDUtils.jl was originally developed under the ProjectTorreyPines by the Magnetic Fusion Energy group at General Atomics.
SOLPS2ctrl.jl was originally developed under the ProjectTorreyPines by the Magnetic Fusion Energy group at General Atomics.

If this software contributes to an academic publication, please cite it as follows:
A. Gupta, D. Eldon, H. Anand, A. Dautt-Silva, S. De Pascuale, J. Lore, O. Meneghini, and J.S. Park, "Plasma boundary control development using a time-dependent scrape-off layer model in closed-loop simulations", Nucl. Mater. Energy, manuscript in preparation for PSI conference (2024).
Expand Down
16 changes: 7 additions & 9 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
name = "SD4SOLPS"
uuid = "d8db6f1b-e564-4c04-bba3-ef399f78c070"
name = "SOLPS2ctrl"
uuid = "a531d12f-ac8a-43e8-b6d9-bd121431dd49"
authors = ["David Eldon <[email protected]>"]
version = "1.0.3"
version = "2.0.0"

[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
Contour = "d38c429a-6771-53c6-b99e-75d170b6e991"
EFIT = "cda752c5-6b03-55a3-9e33-132a441b0c17"
Fortran90Namelists = "8fb689aa-71ff-4044-8071-0cffc910b57d"
GGDUtils = "b7b5e640-9b39-4803-84eb-376048795def"
IMAS = "13ead8c1-b7d1-41bb-a6d0-5b8b65ed587a"
IMASggd = "b7b5e640-9b39-4803-84eb-376048795def"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
PhysicalConstants = "5ad8b20f-a522-5ce9-bfc9-ddf1d5bda6ab"
PlotUtils = "995b91a9-d308-5afd-9ec6-746e21dbc043"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
PolygonOps = "647866c9-e3ac-4575-94e7-e3d426903924"
SOLPS2IMAS = "09becab6-0636-4c23-a92a-2b3723265c31"
SOLPS2imas = "09becab6-0636-4c23-a92a-2b3723265c31"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
Expand All @@ -26,16 +25,15 @@ YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
ArgParse = "1"
Contour = "0.6.3"
EFIT = "1.0.0"
Fortran90Namelists = "0.1.1"
GGDUtils = "1.0.2"
IMAS = "1.2.2"
IMASggd = "2"
Interpolations = "0.15.1"
JSON = "0.21.4"
PhysicalConstants = "0.2.3"
PlotUtils = "1.4.1"
Plots = "1.40.3"
PolygonOps = "0.1.2"
SOLPS2IMAS = "1.0.3"
SOLPS2imas = "2"
Statistics = "1.9.0"
Unitful = "1.20.0"
YAML = "0.4.11"
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# SD4SOLPS
# SOLPS2ctrl

![Format Check](https://github.com/ProjectTorreyPines/SD4SOLPS.jl/actions/workflows/format_check.yml/badge.svg)
![Docs](https://github.com/ProjectTorreyPines/SD4SOLPS.jl/actions/workflows/make_docs.yml/badge.svg)
![Tests](https://github.com/ProjectTorreyPines/SD4SOLPS.jl/actions/workflows/test.yml/badge.svg)
![Format Check](https://github.com/ProjectTorreyPines/SOLPS2ctrl.jl/actions/workflows/format_check.yml/badge.svg)
![Docs](https://github.com/ProjectTorreyPines/SOLPS2ctrl.jl/actions/workflows/make_docs.yml/badge.svg)
![Tests](https://github.com/ProjectTorreyPines/SOLPS2ctrl.jl/actions/workflows/test.yml/badge.svg)

Synthetic diagnostic workflow manager for use with SOLPS models

Expand All @@ -15,19 +15,19 @@ Steps:
3) Make assumptions to extend profiles into the core and far SOL, if needed
4) Run synthetic diagnostic models and record output

For installation and usage instructions, see the [online documentation](https://projecttorreypines.github.io/SD4SOLPS.jl/stable). For documentation on under development branch, see [dev online documentation](https://projecttorreypines.github.io/SD4SOLPS.jl/dev).
For installation and usage instructions, see the [online documentation](https://projecttorreypines.github.io/SOLPS2ctrl.jl/stable). For documentation on under development branch, see [dev online documentation](https://projecttorreypines.github.io/SOLPS2ctrl.jl/dev).

## Installation

SD4SOLPS is registered with public repository [FuseRegistry](https://github.com/ProjectTorreyPines/FuseRegistry.jl/). For installation:
SOLPS2ctrl is registered with public repository [FuseRegistry](https://github.com/ProjectTorreyPines/FuseRegistry.jl/). For installation:

```
using Pkg
Pkg.Registry.add(RegistrySpec(url="https://github.com/ProjectTorreyPines/FuseRegistry.jl.git"))
Pkg.Registry.add("General")
Pkg.add("SD4SOLPS")
Pkg.add("SOLPS2ctrl")
```

## Examples

Refer to the instructions on this [wiki page](https://github.com/ProjectTorreyPines/SD4SOLPS.jl/wiki/Demo) to see how to run `examples/demo.ipynb`.
Refer to the instructions on this [wiki page](https://github.com/ProjectTorreyPines/SOLPS2ctrl.jl/wiki/Demo) to see how to run `examples/demo.ipynb`.
8 changes: 4 additions & 4 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using Documenter
using SD4SOLPS
using SOLPS2ctrl

makedocs(;
modules=[SD4SOLPS],
modules=[SOLPS2ctrl],
format=Documenter.HTML(),
sitename="SD4SOLPS",
sitename="SOLPS2ctrl",
checkdocs=:none,
)

deploydocs(;
repo="github.com/ProjectTorreyPines/SD4SOLPS.jl.git",
repo="github.com/ProjectTorreyPines/SOLPS2ctrl.jl.git",
target="build",
branch="gh-pages",
devbranch="master",
Expand Down
10 changes: 5 additions & 5 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# SD4SOLPS.jl
# SOLPS2ctrl.jl

```@contents
Pages = ["index.md"]
Expand All @@ -10,21 +10,21 @@ This repository serves as the top most workflow manager with helpful utilities t

## Documentation of other repositories in this project

### [GGDUtils.jl](https://projecttorreypines.github.io/GGDUtils.jl/stable)
### [IMASggd.jl](https://projecttorreypines.github.io/IMASggd.jl/stable)

### [SOLPS2IMAS.jl](https://projecttorreypines.github.io/SOLPS2IMAS.jl/stable)
### [SOLPS2imas.jl](https://projecttorreypines.github.io/SOLPS2imas.jl/stable)

### [SynthDiag.jl](https://projecttorreypines.github.io/SynthDiag.jl/stable)

SD4SOLPS is registered with public repository [FuseRegistry](https://github.com/ProjectTorreyPines/FuseRegistry.jl/). For installation:
SOLPS2ctrl is registered with public repository [FuseRegistry](https://github.com/ProjectTorreyPines/FuseRegistry.jl/). For installation:

## Installation

```
using Pkg
Pkg.Registry.add(RegistrySpec(url="https://github.com/ProjectTorreyPines/FuseRegistry.jl.git"))
Pkg.Registry.add("General")
Pkg.add("SD4SOLPS")
Pkg.add("SOLPS2ctrl")
```

## Top file handling functions
Expand Down
50 changes: 25 additions & 25 deletions example/demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"Pkg.activate(\"./\")\n",
"Pkg.Registry.add(RegistrySpec(url=\"https://github.com/ProjectTorreyPines/FuseRegistry.jl.git\"))\n",
"Pkg.Registry.add(\"General\")\n",
"Pkg.add(\"SD4SOLPS\")\n",
"Pkg.add(\"SOLPS2ctrl\")\n",
"Pkg.instantiate()"
]
},
Expand All @@ -27,7 +27,7 @@
"metadata": {},
"outputs": [],
"source": [
"using SOLPS2IMAS: SOLPS2IMAS"
"using SOLPS2imas: SOLPS2imas"
]
},
{
Expand All @@ -52,7 +52,7 @@
"metadata": {},
"outputs": [],
"source": [
"ids = SOLPS2IMAS.solps2imas(b2gmtry, b2output; b2mn=b2mn, fort=fort);"
"ids = SOLPS2imas.solps2imas(b2gmtry, b2output; b2mn=b2mn, fort=fort);"
]
},
{
Expand All @@ -68,7 +68,7 @@
"metadata": {},
"outputs": [],
"source": [
"using GGDUtils: GGDUtils\n",
"using IMASggd: IMASggd\n",
"using Plots"
]
},
Expand Down Expand Up @@ -110,21 +110,21 @@
"\n",
"# You can overlay any subset by giving a second argument\n",
"# Labels\n",
"plot!(space, GGDUtils.get_grid_subset(grid_ggd, \"x_points\"), markercolor=:chocolate1, label=\"X-point\")\n",
"plot!(space, GGDUtils.get_grid_subset(grid_ggd, \"core_cut\"), linecolor=:red, linewidth=2, label=\"Core Cut\")\n",
"plot!(space, GGDUtils.get_grid_subset(grid_ggd, \"PFR_cut\"), linecolor=:darkred, linewidth=2, label=\"PFR Cut\")\n",
"plot!(space, GGDUtils.get_grid_subset(grid_ggd, \"outer_throat\"), linecolor=:limegreen, linewidth=2, label=\"Outer Throat\")\n",
"plot!(space, GGDUtils.get_grid_subset(grid_ggd, \"inner_throat\"), linecolor=:darkgreen, linewidth=2, label=\"Inner Throat\")\n",
"plot!(space, GGDUtils.get_grid_subset(grid_ggd, \"outer_midplane\"), linecolor=:cyan, linewidth=2, label=\"Outer midplane\")\n",
"# plot!(space, GGDUtils.get_grid_subset(grid_ggd, \"inner_midplane\"), linecolor=:teal, linewidth=2, label=\"Inner midplane\")\n",
"plot!(space, GGDUtils.get_grid_subset(grid_ggd, \"outer_target\"), linecolor=:royalblue1, linewidth=2, label=\"Outer target\")\n",
"plot!(space, GGDUtils.get_grid_subset(grid_ggd, \"inner_target\"), linecolor=:navyblue, linewidth=2, label=\"Inner target\")\n",
"plot!(space, GGDUtils.get_grid_subset(grid_ggd, \"core_boundary\"), linecolor=:fuchsia, linewidth=2, linestyle=:dash, label=\"Core boundary\")\n",
"plot!(space, GGDUtils.get_grid_subset(grid_ggd, \"separatrix\"), linecolor=:purple4, linewidth=2, linestyle=:dash, label=\"Separatrix\")\n",
"plot!(space, GGDUtils.get_grid_subset(grid_ggd, 101), markershape=:rect, markercolor=:royalblue1)\n",
"# plot!(space, GGDUtils.get_grid_subset(grid_ggd, 102), markershape=:rect, markercolor=:maroon)\n",
"plot!(space, GGDUtils.get_grid_subset(grid_ggd, 103), markershape=:diamond, markercolor=:fuchsia)\n",
"plot!(space, GGDUtils.get_grid_subset(grid_ggd, 104), markershape=:diamond, markercolor=:purple4)\n",
"plot!(space, IMASggd.get_grid_subset(grid_ggd, \"x_points\"), markercolor=:chocolate1, label=\"X-point\")\n",
"plot!(space, IMASggd.get_grid_subset(grid_ggd, \"core_cut\"), linecolor=:red, linewidth=2, label=\"Core Cut\")\n",
"plot!(space, IMASggd.get_grid_subset(grid_ggd, \"PFR_cut\"), linecolor=:darkred, linewidth=2, label=\"PFR Cut\")\n",
"plot!(space, IMASggd.get_grid_subset(grid_ggd, \"outer_throat\"), linecolor=:limegreen, linewidth=2, label=\"Outer Throat\")\n",
"plot!(space, IMASggd.get_grid_subset(grid_ggd, \"inner_throat\"), linecolor=:darkgreen, linewidth=2, label=\"Inner Throat\")\n",
"plot!(space, IMASggd.get_grid_subset(grid_ggd, \"outer_midplane\"), linecolor=:cyan, linewidth=2, label=\"Outer midplane\")\n",
"# plot!(space, IMASggd.get_grid_subset(grid_ggd, \"inner_midplane\"), linecolor=:teal, linewidth=2, label=\"Inner midplane\")\n",
"plot!(space, IMASggd.get_grid_subset(grid_ggd, \"outer_target\"), linecolor=:royalblue1, linewidth=2, label=\"Outer target\")\n",
"plot!(space, IMASggd.get_grid_subset(grid_ggd, \"inner_target\"), linecolor=:navyblue, linewidth=2, label=\"Inner target\")\n",
"plot!(space, IMASggd.get_grid_subset(grid_ggd, \"core_boundary\"), linecolor=:fuchsia, linewidth=2, linestyle=:dash, label=\"Core boundary\")\n",
"plot!(space, IMASggd.get_grid_subset(grid_ggd, \"separatrix\"), linecolor=:purple4, linewidth=2, linestyle=:dash, label=\"Separatrix\")\n",
"plot!(space, IMASggd.get_grid_subset(grid_ggd, 101), markershape=:rect, markercolor=:royalblue1)\n",
"# plot!(space, IMASggd.get_grid_subset(grid_ggd, 102), markershape=:rect, markercolor=:maroon)\n",
"plot!(space, IMASggd.get_grid_subset(grid_ggd, 103), markershape=:diamond, markercolor=:fuchsia)\n",
"plot!(space, IMASggd.get_grid_subset(grid_ggd, 104), markershape=:diamond, markercolor=:purple4)\n",
"\n",
"# Legend is supressed unless asked for specifically\n",
"plot!(legend=true, left_margin=10Plots.pt)\n",
Expand All @@ -148,7 +148,7 @@
"gr() # Fast and can save pdf\n",
"# plotlyjs() # Use for interactive plot, can only save png\n",
"\n",
"n_e = GGDUtils.get_prop_with_grid_subset_index(ids.edge_profiles.ggd[1].electrons.density, -5)\n",
"n_e = IMASggd.get_prop_with_grid_subset_index(ids.edge_profiles.ggd[1].electrons.density, -5)\n",
"plot(ids.edge_profiles.grid_ggd, n_e, colorbar_title=\"Electrons density / m^(-3)\",\n",
" left_margin=10Plots.pt)"
]
Expand All @@ -172,7 +172,7 @@
"# plotlyjs() # Use for interactive plot, can only save png\n",
"\n",
"plot(ids.edge_profiles.grid_ggd, n_e) # Note default label in colorbar\n",
"plot!(space, GGDUtils.get_grid_subset(grid_ggd, 16), linecolor=:black, linewidth=2,\n",
"plot!(space, IMASggd.get_grid_subset(grid_ggd, 16), linecolor=:black, linewidth=2,\n",
" linestyle=:solid, label=\"Separatix\", legend=true, left_margin=10Plots.pt)"
]
},
Expand All @@ -189,7 +189,7 @@
"metadata": {},
"outputs": [],
"source": [
"import SD4SOLPS: SD4SOLPS"
"import SOLPS2ctrl: SOLPS2ctrl"
]
},
{
Expand All @@ -199,7 +199,7 @@
"outputs": [],
"source": [
"eqdsk = \"../sample/ITER_Lore_2296_00000/EQDSK/g002296.00200\"\n",
"SD4SOLPS.geqdsk_to_imas!(eqdsk, ids; set_time=0.2)"
"SOLPS2ctrl.geqdsk_to_imas!(eqdsk, ids; set_time=0.2)"
]
},
{
Expand All @@ -215,8 +215,8 @@
"metadata": {},
"outputs": [],
"source": [
"SD4SOLPS.fill_in_extrapolated_core_profile!(ids, \"electrons.density\"; method=\"simple\", cell_subset_idx=-5)\n",
"SD4SOLPS.fill_in_extrapolated_core_profile!(ids, \"electrons.temperature\"; method=\"simple\", cell_subset_idx=-5)\n",
"SOLPS2ctrl.fill_in_extrapolated_core_profile!(ids, \"electrons.density\"; method=\"simple\", cell_subset_idx=-5)\n",
"SOLPS2ctrl.fill_in_extrapolated_core_profile!(ids, \"electrons.temperature\"; method=\"simple\", cell_subset_idx=-5)\n",
"# ... more profiles here as they become available in b2time"
]
},
Expand Down
16 changes: 8 additions & 8 deletions example/simple_demo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
# > using Revise
# ] activate .
# > include("example/simple_demo.jl")
using SOLPS2IMAS: SOLPS2IMAS
using GGDUtils: GGDUtils
using SOLPS2imas: SOLPS2imas
using IMASggd: IMASggd
using Plots
using SD4SOLPS
using SOLPS2ctrl

sample_path = "$(@__DIR__)/../sample/ITER_Lore_2296_00000/"
solps2imas_samples = splitdir(pathof(SOLPS2IMAS))[1] * "/../samples"
SOLPS2imas_samples = splitdir(pathof(SOLPS2imas))[1] * "/../samples"

dd = SD4SOLPS.preparation(
dd = SOLPS2ctrl.preparation(
"Baseline2008-li0.70.x4.mod2.eqdsk",
[sample_path, solps2imas_samples]...;
[sample_path, SOLPS2imas_samples]...;
eqdsk_set_time=0.0,
)

Expand All @@ -23,14 +23,14 @@ space = grid_ggd.space[1] # First space in this grid_ggd
# Choose backend
gr() # Fast and can save pdf
# plotlyjs() # Use for interactive plot, can only save png
n_e = GGDUtils.get_prop_with_grid_subset_index(
n_e = IMASggd.get_prop_with_grid_subset_index(
dd.edge_profiles.ggd[1].electrons.density,
5,
)
plot(dd.edge_profiles.grid_ggd, n_e; colorbar_title="Electrons density / m^(-3)")
plot!(
space,
GGDUtils.get_grid_subset(grid_ggd, 16);
IMASggd.get_grid_subset(grid_ggd, 16);
linecolor=:black,
linewidth=2,
linestyle=:solid,
Expand Down
14 changes: 7 additions & 7 deletions src/SD4SOLPS.jl → src/SOLPS2ctrl.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module SD4SOLPS
module SOLPS2ctrl

using IMAS: IMAS
using SOLPS2IMAS: SOLPS2IMAS
using SOLPS2imas: SOLPS2imas
using EFIT: EFIT
using Interpolations: Interpolations

Expand All @@ -24,7 +24,7 @@ about the SOLPS case. Returns a list of filenames with complete paths.
Example:
```julia
SD4SOLPS.find_files_in_allowed_folders(
SOLPS2ctrl.find_files_in_allowed_folders(
"<your samples folder>/D3D_Ma_184833_03600";
eqdsk_file="g184833.03600",
)
Expand Down Expand Up @@ -97,7 +97,7 @@ function geqdsk_to_imas!(
eqt = eq.time_slice[time_index]
eqt.time = g.time

source_for_summary = "gEQDSK file $gfilename loaded during SD4SOLPS workflow."
source_for_summary = "gEQDSK file $gfilename loaded during SOLPS2ctrl workflow."

# 0D
gq = eqt.global_quantities
Expand Down Expand Up @@ -284,10 +284,10 @@ function preparation(
add_rho_to_equilibrium!(dd) # Doesn't do anything if rho is valid
dd.global_time = dd.equilibrium.time_slice[1].time
for eqt dd.equilibrium.time_slice
IMAS.flux_surfaces(eqt)
IMAS.flux_surfaces(eqt, dd.wall)
end
# Add SOLPS data
dd = SOLPS2IMAS.solps2imas(b2fgmtry, b2time; b2mn=b2mn, ids=dd)
dd = SOLPS2imas.solps2imas(b2fgmtry, b2time; b2mn=b2mn, ids=dd)
println("Loaded input data into IMAS DD")

# Core profiles
Expand Down Expand Up @@ -345,4 +345,4 @@ function preparation(
return dd
end

end # module SD4SOLPS
end # module SOLPS2ctrl
5 changes: 2 additions & 3 deletions src/supersize_profile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
Utilities for extrapolating profiles
"""

using IMAS: IMAS
using Interpolations: Interpolations
using GGDUtils:
GGDUtils, get_grid_subset, add_subset_element!, get_subset_boundary,
using IMASggd:
IMASggd, get_grid_subset, add_subset_element!, get_subset_boundary,
project_prop_on_subset!, get_subset_centers, get_TPS_mats
using PolygonOps: PolygonOps
using JSON: JSON
Expand Down
Loading

0 comments on commit 7e7f16d

Please sign in to comment.