Skip to content

Commit bd1d735

Browse files
committed
Add docstring to explain saving function
1 parent b078534 commit bd1d735

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/datautils.jl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,29 @@ function _svector2array(c_vec::Vector{SVector{N_rep, T}}) where {N_rep,T<:Number
2626
return c_matrix
2727
end
2828

29+
"""
30+
save_h5fdata(rdata, filename )
31+
32+
Saves a friction tensor dataset with the HDF5 file structure expected by `load_h5fdata`, for use in training scripts.
33+
34+
# Arguments
35+
36+
## `rdata`:
37+
A `Vector{NamedTuple}` containing the training data in the following format.
38+
39+
```
40+
(
41+
at = ::JuLIP.Atoms,
42+
friction_tensor = sparse(::Matrix),
43+
friction_indices = ::Vector{Int}
44+
)
45+
```
46+
47+
## `filename`
48+
49+
Name of the file to save to (including h5 extension).
50+
51+
"""
2952
function save_h5fdata(rdata, filename )
3053
fid = h5open(filename, "w")
3154
try

0 commit comments

Comments
 (0)