Skip to content

bug in io.ascii  #3319

@aphearin

Description

@aphearin

I am finding that in certain cases, io.ascii struggles to correctly ignore comment lines, and also the start of the data rows. Here is some particularly simple data that illustrates the problem:

# some header info
#F header info beginning with 'F'
1 2 3
4 5 6
7 8 9

If I run ascii.read(fname), I get
AttributeError: 'NoneType' object has no attribute 'group'

The workaround seems to be to set guess=False. Based on an email chain with @eteq the problem seems to be that the DAOPHOT reader specifically looks for the "#F..." pattern, and for some reason even though this is not a DAOPHOT output file, the reader fails when it tries to actually interpret that line. Erik told me to call the attention of @taldcroft to this issue.

My workaround for the time being is s imply to set guess=False:
ascii.read(fname, guess=False).
This does not bail when reaching the #F line, but now the first row of data is being ignored. My workaround for that latter problem is to manually set data_start=0, but this should probably be the default behavior.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions