Implement ability to hide warnings in VO table parsing#8715
Implement ability to hide warnings in VO table parsing#8715pllim merged 25 commits intoastropy:masterfrom
Conversation
b5d26a7 to
3a3eb49
Compare
bsipocz
left a comment
There was a problem hiding this comment.
Overall I think is the right approach. My comments below are minor ones.
Also I would think that adding a 'fix' option for the same kwarg would be very nice, that would also nicely mirror the behaviour/options of the fits .verify()
Naw, it is also |
3a48b46 to
98decd9
Compare
Codecov Report
@@ Coverage Diff @@
## master #8715 +/- ##
==========================================
+ Coverage 86.95% 86.97% +0.01%
==========================================
Files 399 399
Lines 59355 59373 +18
Branches 1100 1100
==========================================
+ Hits 51613 51637 +24
+ Misses 7101 7095 -6
Partials 641 641
Continue to review full report at Codecov.
|
This would require a lot more work since at the moment there is no control over whether things are fixed or not. They are always fixed, and it could be that the VO table can't be interpreted if not fixed (a little different to FITS headers which can be sub-optimal but still work). I'd be tempted to keep just these three options for now, and then consider adding more in future if people really want? |
| 'When True, treat fixable violations of the VOTable spec as exceptions.', | ||
| aliases=['astropy.io.votable.table.pedantic']) | ||
| verify = _config.ConfigItem( | ||
| 'ignore', |
There was a problem hiding this comment.
Now that I look at this, I am actually not sure if alias would work if the config type has changed. When cfgtype is not provided, as in the case here, it is inferred from the default value. So with this change, its type is now string, where it used to be boolean. That is going to choke the validator when someone has an older astropy.cfg with, say, pedantic = True set. A possible solution is to explicitly state the cfgtype as 'option' and provide all the 5 possible options (3 new ones and 2 boolean values).
References:
There was a problem hiding this comment.
For some reason it still doesn't work right if I specify option with mixed types, and it always gets converted to a string. But that's ok, we can still be backward compatible by just checking for False and True as strings when using conf.verify. I've added handling of this as well as an extensive test of setting the configuration items (both verify and pedantic).
out of band discussion showed me why this is not a good idea, so please ignore it, it shouldn't actually fix anything. |
c197aa5 to
997307c
Compare
pllim
left a comment
There was a problem hiding this comment.
Thanks for the extensive tests! This is getting close.
|
@pllim - I had to change some of the code in |
pllim
left a comment
There was a problem hiding this comment.
Sorry, I keep finding stuff to comment on... 😬
pllim
left a comment
There was a problem hiding this comment.
I think 🐴 is 💀 . Thanks for your patience with my reviews!
|
p.s. I am excited to see how many warnings disappear in #7928 once this is merged and I rebase that one on top of this one! |
Co-Authored-By: P. L. Lim <2090236+pllim@users.noreply.github.com>
…and pedantic options
Co-Authored-By: P. L. Lim <2090236+pllim@users.noreply.github.com>
Co-Authored-By: P. L. Lim <2090236+pllim@users.noreply.github.com>
Co-Authored-By: P. L. Lim <2090236+pllim@users.noreply.github.com>
125d8d0 to
94826f0
Compare
|
(rebased to get rid of the docs build error) |
|
|
This PR makes it possible to hide warnings when parsing VO tables, by replacing the boolean
pedanticflag with averifyflag that can beignore,warn, orexception(or should it beerror?)In addition, as discussed in #8028, this makes
ignorethe default. I think in general we should move to a model where we don't give 25 warnings when reading in a table where these are fixed anyway and beyond the user's control (basically the Robustness Principle of being liberal in what you accept)I've tagged various people I think might be interested. If we go ahead with this I think in another PR we should also change the default for FITS to not show fixable warnings on input.
EDIT: Fix #8028