Skip to content

Bug: read_solutions fails to parse files containing only a single solution #707

Description

@madeleinegoertz

When using write_solutions and read_solutions to handle data files, the parser works for multiple solutions. However, if the solution array contains only a single vector element, read_solutions fails silently and returns empty vectors.

Minimal Reproducible Example

using HomotopyContinuation

write_solutions("single_sol.txt", [[1, 1]])
read_solutions("single_sol.txt")

Output Behavior

Actual Output
2-element Vector{Vector{Any}}: [] []

Expected Output

1-element Vector{Vector{Complex{Int64}}}: [1 + 0im, 1 + 0im]

My environment

  • julia: v1.12.6
  • HomotopyContinuation.jl: v2.20.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions