Skip to content

Commit d3d941e

Browse files
Pan-Maciekmkozieja
and
mkozieja
authored
Added support for .npy and .npz files. (#358)
Co-authored-by: mkozieja <mkozieja@qualtrics.com>
1 parent 21f435d commit d3d941e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

docs/registry.md

+2
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,5 @@ format binary_little_endian 1.0 |
4545
| HDF5 | .h5, .hdf5 | loads and saves on **all** platforms with [HDF5](http:///github.com/JuliaLang/HDF5.jl.git) | has detection function |
4646
| STL_ASCII | .stl, .STL | loads and saves on **all** platforms with [MeshIO](http:///github.com/JuliaIO/MeshIO.jl.git) | has detection function |
4747
| STL_BINARY | .stl, .STL | loads and saves on **all** platforms with [MeshIO](http:///github.com/JuliaIO/MeshIO.jl.git) | has detection function |
48+
| NPY | .npy | loads and saves on **all** platforms with [NPZ](https://github.com/fhs/NPZ.jl) | "\x93NUMPY" |
49+
| NPZ | .npz | loads and saves on **all** platforms with [NPZ](https://github.com/fhs/NPZ.jl) | "PK\x03\x04" |

src/registry.jl

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const idVegaLite = :VegaLite => UUID("112f6efa-9a02-5b7d-90c0-432ed331239a")
1515
const idVideoIO = :VideoIO => UUID("d6d074c3-1acf-5d4c-9a43-ef38773959a2")
1616
const idLibSndFile = :LibSndFile => UUID("b13ce0c6-77b0-50c6-a2db-140568b8d1a5")
1717
const idJpegTurbo = :JpegTurbo => UUID("b835a17e-a41a-41e7-81f0-2f016b05efe0")
18+
const idNPZ = :NPZ => UUID("15e1cf62-19b3-5cfa-8e77-841668bca605")
1819

1920
### Simple cases
2021

@@ -26,6 +27,8 @@ add_format(format"JLD2", (unsafe_wrap(Vector{UInt8},"Julia data file (HDF5), ver
2627
add_format(format"GZIP", [0x1f, 0x8b], ".gz", [:Libz => UUID("2ec943e9-cfe8-584d-b93d-64dcb6d567b7")])
2728
add_format(format"BSON",(),".bson", [:BSON => UUID("fbb218c0-5317-5bc6-957e-2ee96dd4b1f0")])
2829
add_format(format"JLSO", (), ".jlso", [:JLSO => UUID("9da8a3cd-07a3-59c0-a743-3fdc52c30d11")])
30+
add_format(format"NPY", "\x93NUMPY", ".npy", [idNPZ])
31+
add_format(format"NPZ", "PK\x03\x04", ".npz", [idNPZ])
2932

3033
function detect_compressor(io, len=getlength(io); formats=["GZIP", "BZIP2", "XZ", "LZ4"])
3134
seekstart(io)

0 commit comments

Comments
 (0)