Skip to content

pedantic/verify does not control all the warnings in VO table parsing #8775

Open

Description

@pllim

As pointed out by @astrofrog in #8756 , pedantic (renamed to verify in #8715) does not universally control all the warnings emitted when parsing VO table. This is an API design question.

Case Study 1

if field.arraysize is None:
vo_warn(W47, (), config, pos)
field.arraysize = '1'

In this example, it explicitly calls vo_warn, which would give warning (or not), but it will never promote the warning to error even if config['verify'] is set to 'exception'. But should it ever be an error, given that some default is assigned anyway in L303?

Case Study 2

def __init__(self, field, config=None, pos=None):
pass

def __init__(self, field, config=None, pos=None):
Converter.__init__(self, field, config, pos)

In this example, config is passed into the constructor as if it means something, but it is not stored by the class. As a result, the following emits a warning:

from astropy.io.votable import tree, converters
config = {'verify': 'ignore'}
field = tree.Field(None, name='c', datatype='float', config=config)
c = converters.get_converter(field, config=config)
c.parse('null')  # W30 warning here

but this does not:

c.parse('null', config=config)  # No warning

Activity

  1. changed the title [-]pedantic/verify does not control all the warnings in votable parsing[/-] [+]pedantic/verify does not control all the warnings in VO table parsing[/+] on May 29, 2019
  2. pllim commented on Apr 30, 2021

    @pllim
    MemberAuthor

    Somewhat related... #11677 (review)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions