Types
Functions
DataDrop.clean_file_name
— Methodclean_file_name(name)
Construct a clean file name.
Replace '.', ':', ' ' (dot, colon, space) with underscores.
Example:
s = clean_file_name("something or other.1=0.5_5:7")
s == "something_or_other_1=0_5_5_7"
DataDrop.empty_hdf5_file
— Methodempty_hdf5_file(fname)
Empty an HDF5 file. All contents will be erased.
DataDrop.file_extension
— Methodfile_extension(filename)
Extract extension from the string representing a file name.
Expected result:
p = "matrices.dir"
file_extension(p) == ".dir"
p = "matrices.h5"
file_extension(p) == ".h5"
p = "matri.ces.dir"
file_extension(p) == ".dir"
p = "matrices."
file_extension(p) == "."
p = "matrices"
file_extension(p) == ""
DataDrop.retrieve_json
— Methodretrieve_json(j)
Retrieve a dictionary from a JSON file named j
.
Example:
d = retrieve_json("myfile.json")
DataDrop.retrieve_matrix
— Methodretrieve_matrix(fname, mpath)
Retrieve a matrix from file fname
.
The matrix data is stored under the path mpath
.
Example: Storing a sparse matrix as "/data" with store_matrix("test/matrices/matrix_SInt64.h5f", "/data", d)
gives:
julia> f = h5open("test/matrices/matrix_SInt64.h5f", "r")
�
└─ � data
├─ � I
├─ � J
├─ � V
├─ � matrix_type
├─ � ncols
└─ � nrows
Example: Storing a dense matrix under the default path ("/") with store_matrix("matrix_d_Float32.h5", d)
gives:
julia> f = h5open("matrix_d_Float32.h5", "r")
�
├─ � matrix
└─ � matrix_type
DataDrop.retrieve_matrix
— Methodretrieve_matrix(fname)
Retrieve a matrix from file fname
.
DataDrop.retrieve_value
— Methodretrieve_value(fname, vpath)
Retrieve a number or a string known as vpath
from the file named fname
.
DataDrop.store_json
— Methodstore_json(j, d)
Store a dictionary d
into a JSON file named j
.
The dictionary is stored into a JSON file. If the file name fname
is supplied without an extension, it is appended the ".json" extension.
DataDrop.store_matrix
— Methodstore_matrix(fname, mpath, matrix)
Store a dense matrix under the path mpath
into the file fname
.
DataDrop.store_matrix
— Methodstore_matrix(fname, matrix)
Store a dense matrix into the file named fname
.
DataDrop.store_matrix
— Methodstore_matrix(fname, mpath, matrix::SparseArrays.SparseMatrixCSC{T, Int64}) where {T}
Store a sparse matrix under the path mpath
into the file named fname
.
The matrix is stored into an HDF5 file. If the file name fname
is supplied without an extension, it is appended the ".h5" extension.
DataDrop.store_matrix
— Methodstore_matrix(fname, matrix::SparseArrays.SparseMatrixCSC{T, Int64}) where {T}
Store a sparse matrix into the file named fname
.
The matrix is stored into an HDF5 file. If the file name fname
is supplied without an extension, it is appended the ".h5" extension.
DataDrop.store_value
— Methodstore_value(fname, vpath, num)
Store a number or a string into the file named fname
under the name vpath
.
DataDrop.with_extension
— Methodwith_extension(filename, ext)
Make sure the file name has the desired extension.
ext
can be either with or without the leading dot.
with_extension("fo_1=0_5_5_7", ".ext") == "fo_1=0_5_5_7.ext"
with_extension("fo_1=0_5_5_7", "ext") == "fo_1=0_5_5_7.ext"
with_extension("fo_1=0_5_5_7.dat", "ext") == "fo_1=0_5_5_7.ext"