@@ -14,7 +14,12 @@ include("plot.jl")
1414# if no logic circuit file format is given on read, infer file format from extension
1515
1616function file2pcformat (file)
17- if endswith (file," .jpc" )
17+ if endswith (file," .gz" )
18+ # duplicate code from `LogicCircuits.file2logicformat` -- not sure how to make this nicer
19+ file_inner, _ = splitext (file)
20+ format_inner = file2pcformat (file_inner)
21+ GzipFormat (format_inner)
22+ elseif endswith (file," .jpc" )
1823 JpcFormat ()
1924 elseif endswith (file," .psdd" )
2025 PsddFormat ()
@@ -64,6 +69,10 @@ Base.parse(::Type{ProbCircuit}, args...) =
6469Base. read (io:: IO , :: Type{ProbCircuit} , args... ) =
6570 read (io, PlainProbCircuit, args... )
6671
72+ Base. read (io:: IO , :: Type{ProbCircuit} , f:: GzipFormat ) =
73+ # avoid method ambiguity
74+ read (io, PlainProbCircuit, f)
75+
6776# copy read/write API for tuples of files
6877
6978function Base. read (files:: Tuple{AbstractString, AbstractString} , :: Type{C} , args... ) where C <: StructProbCircuit
@@ -81,4 +90,4 @@ function Base.write(files::Tuple{AbstractString,AbstractString},
8190 write ((io1, io2), circuit, args... )
8291 end
8392 end
84- end
93+ end
0 commit comments