Repository navigation
Deprecate the pedantic option for VOTables - #12129
Conversation
The ``pedantic`` keyword argument for parsing VOTables is now deprecated together with the corresponding configuration option.
|
I think @bsipocz we should avoid new deprecation in LTS? So, I milestoned to 5.1, so this cannot be merged before 5.0 branching. |
|
The addendum to APE-2 should be the guideline here, and I believe we said that deprecations are fine/preferred in LTS, and removal in a later version. The APE extension should preferably be wrapped up and merged though, so we have a document to consult. |
|
However this is a weird case here, as |
| for more information. When not provided, uses the configuration setting | ||
| ``astropy.io.votable.verify``, which defaults to 'ignore'. | ||
|
|
||
| .. versionchanged:: 4.0 |
There was a problem hiding this comment.
Keep this note, at least until pedantic fully disappears. I would even argue that the versionadded info, without the extra explanation is a very useful thing.
| @@ -261,26 +260,40 @@ input. | |||
|
|
|||
| .. _pedantic-mode: | |||
There was a problem hiding this comment.
maybe change the ref label, too
|
|
||
| .. _pedantic-mode: | ||
|
|
||
| Pedantic mode |
There was a problem hiding this comment.
Very nice find and cleanup, this got missed out in the review cycle of the original PR
|
Yes, sorry, I misremembered the policy. I moved milestone to 5.0. Do we need to ping |
|
A very quick look at pyvo says it will be fine, but yes, indeed astroquery will be hit. However it's not significant and in the worst case we can deal with it once this landed in astropy |
| with pytest.raises(AstropyDeprecationWarning): | ||
| with pytest.raises(VOWarning): | ||
| parse(get_pkg_data_filename('data/gemini.xml')) |
There was a problem hiding this comment.
I think this works too.
| with pytest.raises(AstropyDeprecationWarning): | |
| with pytest.raises(VOWarning): | |
| parse(get_pkg_data_filename('data/gemini.xml')) | |
| with pytest.raises(AstropyDeprecationWarning), pytest.raises(VOWarning): | |
| parse(get_pkg_data_filename('data/gemini.xml')) |
There was a problem hiding this comment.
This would work, but it would also exceed the 80 character line length limit.
There was a problem hiding this comment.
I pushed the second commit before seeing your answer, and I don't think the nested with statements here are bad enough to justify making another commit just to replace them, but I can change them if anyone requests more changes or if I'm asked to squash the commits.
| `~astropy.io.votable.parse_single_table` functions:: | ||
| Many VOTable files in the wild do not conform to the VOTable specification. You | ||
| can set what should happen when a violation is encountered with the ``verify`` | ||
| argument, which can take three values: |
There was a problem hiding this comment.
| argument, which can take three values: | |
| keyword, which can take three values: |
| same type to a maximum value using the | ||
| `astropy.io.votable.exceptions.conf.max_warnings | ||
| <astropy.io.votable.exceptions.Conf.max_warnings>` item in the | ||
| :ref:`astropy_config` |
There was a problem hiding this comment.
To be consistent.
| :ref:`astropy_config` | |
| :ref:`astropy_config`. |
| :ref:`astropy_config` | ||
| * ``'exception'`` - Do not parse the VOTable and raise an exception. | ||
|
|
||
| The ``verify`` argument can be used with the :func:`~astropy.io.votable.parse` or |
There was a problem hiding this comment.
| The ``verify`` argument can be used with the :func:`~astropy.io.votable.parse` or | |
| The ``verify`` keyword can be used with the :func:`~astropy.io.votable.parse` or |
|
|
||
| Even with ``pedantic`` turned off, many warnings may still be omitted. | ||
| These warnings are all of the type | ||
| `~astropy.io.votable.exceptions.VOTableSpecWarning` and can be turned |
There was a problem hiding this comment.
I see that this sentence is deleted altogether. Does this no longer apply?
There was a problem hiding this comment.
This was explaining that pedantic=False can emit (not omit, that's a typo) warnings, which might have been unexpected. What the verify options do is already explained above.
|
Should I add a second commit with the implemented feedback to this PR or would it be better to force-push and replace the starting commit? |
I think second commit is fine. Thanks! |
The `pedantic` argument for VOTable parsing was deprecated in astropy#12129, but no deprecation notice was added to the docstring. This commit fixes that oversight.
The `pedantic` option for `parse()` and `parse_single_table()` functions in `astropy.io.votable` has been deprecated since astropy/astropy#12129 in favour of the `verify` option. This commit replaces the uses of the deprecated option in `astroquery` tests.
The `pedantic` option for `parse()` and `parse_single_table()` functions in `astropy.io.votable` has been deprecated since astropy/astropy#12129 in favour of the `verify` option. This commit replaces the uses of the deprecated option in `astroquery`.
The `pedantic` option for `parse()` and `parse_single_table()` functions in `astropy.io.votable` has been deprecated since astropy/astropy#12129 in favour of the `verify` option. This commit replaces the uses of the deprecated option in `astroquery` tests.
The `pedantic` option for `parse()` and `parse_single_table()` functions in `astropy.io.votable` has been deprecated since astropy/astropy#12129 in favour of the `verify` option. This commit replaces the uses of the deprecated option in `astroquery`.
The `pedantic` option for `parse()` and `parse_single_table()` functions in `astropy.io.votable` has been deprecated since astropy/astropy#12129 in favour of the `verify` option. This commit replaces the uses of the deprecated option in `astroquery` tests.
The `pedantic` option for `parse()` and `parse_single_table()` functions in `astropy.io.votable` has been deprecated since astropy/astropy#12129 in favour of the `verify` option. This commit replaces the uses of the deprecated option in `astroquery`.
The `pedantic` option for `parse()` and `parse_single_table()` functions in `astropy.io.votable` has been deprecated since astropy/astropy#12129 in favour of the `verify` option. This commit replaces the uses of the deprecated option in `astroquery` tests.
The `pedantic` option for `parse()` and `parse_single_table()` functions in `astropy.io.votable` has been deprecated since astropy/astropy#12129 in favour of the `verify` option. This commit replaces the uses of the deprecated option in `astroquery`.
Closes #8887
Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
Extra CIlabel.no-changelog-entry-neededlabel. If this is a manual backport, use theskip-changelog-checkslabel unless special changelog handling is necessary.astropy-botcheck might be missing; do not let the green checkmark fool you.backport-X.Y.xlabel(s) before merge.