Skip to content

Commit

Permalink
Merge pull request #15 from ProjectTorreyPines/dev
Browse files Browse the repository at this point in the history
Releasing v0.1.0
  • Loading branch information
anchal-physics authored Oct 5, 2023
2 parents 06d584e + f56e79e commit 0e019b8
Show file tree
Hide file tree
Showing 21 changed files with 3,849 additions and 257 deletions.
27 changes: 27 additions & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
align_assignment = true
align_conditional = true
align_matrix = true
align_pair_arrow = true
align_struct_field = true
always_for_in = true
always_use_return = true
annotate_untyped_fields_with_any = false
conditional_to_if = true
for_in_replacement = ""
format_docstrings = true
import_to_using = true
indent = 4
indent_submodule = true
join_lines_based_on_source = true
long_to_short_function_def = true
margin = 88
normalize_line_endings = "unix"
pipe_to_function_call = true
remove_extra_newlines = true
separate_kwargs_with_semicolon = true
surround_whereop_typeparameters = true
trailing_comma = true
whitespace_in_kwargs = false
whitespace_ops_in_indices = false
whitespace_typedefs = true
yas_style_nesting = true
3 changes: 3 additions & 0 deletions .dvc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/config.local
/tmp
/cache
Empty file added .dvc/config
Empty file.
3 changes: 3 additions & 0 deletions .dvcignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Add patterns of files dvc should ignore, which could improve
# the performance. Learn more at
# https://dvc.org/doc/user-guide/dvcignore
36 changes: 36 additions & 0 deletions .github/workflows/format_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Format Check

on:
push:
branches: ["master", "dev", "format"]
pull_request:
branches: ["master", "dev"]
jobs:
check:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1.9.3]
julia-arch: [x86]
os: [ubuntu-latest]
steps:
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}

- uses: actions/checkout@v1
- name: Install JuliaFormatter and format
run: |
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
julia -e 'using JuliaFormatter; format(".", verbose=true)'
- name: Format check
run: |
julia -e '
out = Cmd(`git diff --name-only`) |> read |> String
if out == ""
exit(0)
else
@error "Some files have not been formatted !!!"
write(stdout, out)
exit(1)
end'
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ version = "0.1.0"

[deps]
NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
NetCDF = "30363a11-5582-574a-97bb-aa9a979735b9"
OMAS = "91cfaa06-6526-4804-8666-b540b3feef2f"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
39 changes: 10 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,21 @@
# SOLPS2IMAS.jl

Utility for loading data from existing SOLPS runs, including custom data in b2time.nc, from native SOLPS output format into IMAS
![Format Check](https://github.com/ProjectTorreyPines/SOLPS2IMAS.jl/actions/workflows/format_check.yml/badge.svg)

## OMAS structure notes

(using xx for indices that do not matter)

1. edge_profiles.ggd store data of quantities; edge_profiles.grid_ggd store data about the grid geometry
2. For both ggd and grid_ggd, different slices are different slices in time. That is, what we were calling grid_number is actually time iteration number/index (say it). ggd[it].time and grid_ggd[it].time will store the time array value.
3. grid_ggd[it]
1. grid_ggd[it].space[xx].identifier.index needs to be selected based on grid type (1 for linear, 2 for cylinder, 4 for single null etc.)
2. grid_ggd[it].grid_subset[xx] are various subsets like nodes, edges, cells etc. each with required index value at grid_ggd[it].grid_subset[xx].index
3. grid_ggd[it].grid_subset[xx] properties are automatically generated for nodes, edges or cells but are required to be given for other kinds of subsets (like boundaries)
4. ggd[it]
1. ggd[it].electrons.<quantity>[xx].grid_subset_index needs to be mentioned to indicate whether the quantity is at a node, edge, or cell.
2. ggd[it].electrons.<quantity>[xx].values store the actual value.
4. ggd[it].electrons.<quantity>[xx].coefficients store interpolation function coefficients
5. For multi-specie data, ggd[it].ions[xx].<quantity>[xx].values is used. For each species, ggd[it].ions[xx].element[:] is used to describe Z and charge state.

## To-do:

- [ ] Read atleast all electron properties.
- [ ] Final function should accept one state/time file and one geometry file to return a OMAS.dd object.
- [ ] Add support for boundary properties.
- [ ] Add support for multi-species data.
- [ ] Test using new [h5i2imas functionality](https://github.com/ProjectTorreyPines/OMAS.jl/commit/904562b4040c857260d832747d1ba46a2bf614f6) added to OMAS.
- [ ] Expand testing to some self-consistency test of read data.
Utility for loading data from existing SOLPS runs, including custom data in b2time.nc,
from native SOLPS output format into IMAS

## Running tests:

Following code ensures it uses the enviroment described in ./Project.toml:

```
(base) gupta@F-CJXNMY7L7 SOLPS2IMAS.jl % julia --project=./ ./test/runtests.jl
it's the omas function
another fun function!!!!!11!!!!!
(base) gupta@F-CJXNMY7L7 SOLPS2IMAS.jl % julia --proje
ct=./ test/runtests.jl
solps2imas() time: 3.309287 seconds (9.92 M allocations: 666.357 MiB, 5.68% gc time, 71.71% compilation time)
Test Summary: | Pass Total Time
omasstuff | 4 4 6.9s
hello there
Test Summary: | Pass Total Time
omasstuff | 3 3 2.5s
utilities | 3 3 0.0s
```
4 changes: 4 additions & 0 deletions samples/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/b2fgmtry
/b2fstate
/b2time.nc
/b2mn.dat
4 changes: 4 additions & 0 deletions samples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# samples

* The sample files with _red suffix have been reduced to save space. Some fields have been deleted and some arrays have been decimated. These files are suitable for limited testing only.
* The sample files shown here with .dvc extension are stored in nfs mount through iris or omega. Run `dvc pull` to get the data files downloaded. Note that this will only work from inside the fusion network. See [TestSamples](https://github.com/ProjectTorreyPines/TestSamples#readme) for more details.
12 changes: 12 additions & 0 deletions samples/b2fgmtry.dvc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
md5: bcf05d7d7b6d91ef1025c0dc018c4bbf
frozen: true
deps:
- path: ITER_Lore_2296_00000/baserun/b2fgmtry
repo:
url: git@github.com:ProjectTorreyPines/SOLPSTestSamples.git
rev_lock: df499f1275428ec06175c48dc4af6ecbd5ec6117
outs:
- md5: 6589953daeef49b21744d159af970cbb
size: 2908856
hash: md5
path: b2fgmtry
Loading

0 comments on commit 0e019b8

Please sign in to comment.