From 67e81ca682f9c7c12028e51742ad2113dec472f2 Mon Sep 17 00:00:00 2001 From: Jeff Fessler Date: Wed, 12 May 2021 22:39:14 -0400 Subject: [PATCH 1/3] AVS .fld data files --- Project.toml | 2 +- src/registry.jl | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 27e44b0b..99423adc 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "FileIO" uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" -version = "1.8.2" +version = "1.8.3" [deps] Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" diff --git a/src/registry.jl b/src/registry.jl index eccf95f4..0ba34b65 100644 --- a/src/registry.jl +++ b/src/registry.jl @@ -1,6 +1,7 @@ ### "Package registry" # Useful for packages that get used more than once below # Please alphabetize +const idAVSfldIO = :AVSfldIO => UUID("b6189060-daf9-4c28-845a-cc0984b81781") const idCSVFiles = :CSVFiles => UUID("5d742f6a-9f54-50ce-8119-2520741973ca") const idImageIO = :ImageIO => UUID("82e4d734-157c-48bb-816b-45c225c6df19") const idImageMagick = :ImageMagick => UUID("6218d12a-5da1-5696-b52f-db25d2ecc6d1") @@ -81,6 +82,7 @@ end add_format(format"RDataSingle", detect_rdata_single, [".rds"], [idRData, LOAD]) +add_format(format"FLD", (), [".fld"], [idAVSfldIO]) add_format(format"CSV", (), [".csv"], [idCSVFiles]) add_format(format"TSV", (), [".tsv"], [idCSVFiles]) add_format(format"Feather", "FEA1", [".feather"], [:FeatherFiles => UUID("b675d258-116a-5741-b937-b79f054b0542")]) From 2dd50ec4b8d116f97fd4e45f484210389e3bab1f Mon Sep 17 00:00:00 2001 From: Jeff Fessler Date: Thu, 13 May 2021 14:35:21 -0400 Subject: [PATCH 2/3] AVS magic bytes --- Project.toml | 2 +- src/registry.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 99423adc..27e44b0b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "FileIO" uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" -version = "1.8.3" +version = "1.8.2" [deps] Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" diff --git a/src/registry.jl b/src/registry.jl index 0ba34b65..e2d9ca72 100644 --- a/src/registry.jl +++ b/src/registry.jl @@ -82,7 +82,7 @@ end add_format(format"RDataSingle", detect_rdata_single, [".rds"], [idRData, LOAD]) -add_format(format"FLD", (), [".fld"], [idAVSfldIO]) +add_format(format"FLD", "# AVS", [".fld"], [idAVSfldIO]) add_format(format"CSV", (), [".csv"], [idCSVFiles]) add_format(format"TSV", (), [".tsv"], [idCSVFiles]) add_format(format"Feather", "FEA1", [".feather"], [:FeatherFiles => UUID("b675d258-116a-5741-b937-b79f054b0542")]) From 1317dd7995495a855fe9b2024cdc60b3bc76a871 Mon Sep 17 00:00:00 2001 From: Jeff Fessler Date: Thu, 13 May 2021 22:53:29 -0400 Subject: [PATCH 3/3] query test --- src/registry.jl | 2 +- test/files/avs-ascii.dat | 2 ++ test/files/avs-ascii.fld | 9 +++++++++ test/query.jl | 6 ++++++ 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 test/files/avs-ascii.dat create mode 100644 test/files/avs-ascii.fld diff --git a/src/registry.jl b/src/registry.jl index e2d9ca72..e9a1ff16 100644 --- a/src/registry.jl +++ b/src/registry.jl @@ -82,7 +82,7 @@ end add_format(format"RDataSingle", detect_rdata_single, [".rds"], [idRData, LOAD]) -add_format(format"FLD", "# AVS", [".fld"], [idAVSfldIO]) +add_format(format"AVSfld", "# AVS", [".fld"], [idAVSfldIO]) add_format(format"CSV", (), [".csv"], [idCSVFiles]) add_format(format"TSV", (), [".tsv"], [idCSVFiles]) add_format(format"Feather", "FEA1", [".feather"], [:FeatherFiles => UUID("b675d258-116a-5741-b937-b79f054b0542")]) diff --git a/test/files/avs-ascii.dat b/test/files/avs-ascii.dat new file mode 100644 index 00000000..2dffd80e --- /dev/null +++ b/test/files/avs-ascii.dat @@ -0,0 +1,2 @@ +1 2 3 4 5 6 +7 8 9 8 7 6 diff --git a/test/files/avs-ascii.fld b/test/files/avs-ascii.fld new file mode 100644 index 00000000..38b3fb00 --- /dev/null +++ b/test/files/avs-ascii.fld @@ -0,0 +1,9 @@ +# AVS field file (ascii variant) +ndim=2 +dim1=3 +dim2=4 +nspace=2 +veclen=1 +data=int +field=uniform +variable 1 file=avs-ascii.dat filetype=ascii diff --git a/test/query.jl b/test/query.jl index 07c138f4..8a7d85ad 100644 --- a/test/query.jl +++ b/test/query.jl @@ -457,6 +457,12 @@ let file_dir = joinpath(@__DIR__, "files"), file_path = Path(file_dir) @test position(io) == 4 end end + + @testset "AVSfld detection" begin + q = query(joinpath(file_dir, "avs-ascii.fld")) + @test typeof(q) <: File{format"AVSfld"} + end + end @testset "Query from IOBuffer" begin