PowerModelsDistribution.jl
PowerModelsDistribution.jl copied to clipboard
[BUG] Tabulation causing error on `parse_file`
Describe the bug
The character UTF-8 0x09 (Tabulation) is not recognized in the parse_file using .dss files.
Minimum Viable Example
DSS Code
// test.dss
Clear
new circuit.test bus1=SOURCEBUS pu=1.0
New Line.Line_1 bus1=SOURCEBUS bus2=BUS_1
New Load.Load_1 phases=3 conn=Wye bus1=BUS_1 kw=0.1 kvar=0.03 model=1
solve
Julia File
import PowerModelsDistribution
const PMD = PowerModelsDistribution
case_file = "test.dss"
model_dict = PMD.parse_file(case_file)
Screenshots

System Information (please complete the following information):
- OS: Manjaro Linux x86_64
- Version Kernel Linux 5.15.60-1-MANJARO
I think that the problem is this function: https://github.com/lanl-ansi/PowerModelsDistribution.jl/blob/7a6b03eb0f96d0bcd3269b7d62ffda4d7ccaf4b0/src/io/dss/dss_parse.jl#L538
Because many of the validation statements use space. E.g.:
https://github.com/lanl-ansi/PowerModelsDistribution.jl/blob/7a6b03eb0f96d0bcd3269b7d62ffda4d7ccaf4b0/src/io/dss/dss_parse.jl#L554-L560
Maybe changing the space validation to the built-in Julia's function isspace can solve this issue.
@pseudocubic, I can create a PR if you are ok with this solution.
@felipemarkson isspace looks like a promising solution, I would welcome the PR