Skip to content

Deprecate the pedantic option for VOTables - #12129

Merged
pllim merged 2 commits into
astropy:mainfrom
eerovaher:deprecate-pedantic
Sep 1, 2021
Merged

pllim merged 2 commits into
astropy:mainfrom
eerovaher:deprecate-pedantic

Conversation

@eerovaher

Copy link
Copy Markdown
Member

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.

  • Do the proposed changes actually accomplish desired goals?
  • Do the proposed changes follow the Astropy coding guidelines?
  • Are tests added/updated as required? If so, do they follow the Astropy testing guidelines?
  • Are docs added/updated as required? If so, do they follow the Astropy documentation guidelines?
  • Is rebase and/or squash necessary? If so, please provide the author with appropriate instructions. Also see "When to rebase and squash commits".
  • Did the CI pass? If no, are the failures related? If you need to run daily and weekly cron jobs as part of the PR, please apply the Extra CI label.
  • Is a change log needed? If yes, did the change log check pass? If no, add the no-changelog-entry-needed label. If this is a manual backport, use the skip-changelog-checks label unless special changelog handling is necessary.
  • Is a milestone set? Milestone must be set but astropy-bot check might be missing; do not let the green checkmark fool you.
  • At the time of adding the milestone, if the milestone set requires a backport to release branch(es), apply the appropriate backport-X.Y.x label(s) before merge.

The ``pedantic`` keyword argument for parsing VOTables is now deprecated
together with the corresponding configuration option.
@pllim pllim added this to the v5.1 milestone Aug 30, 2021
@pllim

pllim commented Aug 30, 2021

Copy link
Copy Markdown
Member

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.

@bsipocz

bsipocz commented Aug 30, 2021

Copy link
Copy Markdown
Member

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.

@bsipocz

bsipocz commented Aug 30, 2021

Copy link
Copy Markdown
Member

However this is a weird case here, as verify is available for a while, so practically it doesn't really matter at this point when it will get its due DeprecationWarning.

for more information. When not provided, uses the configuration setting
``astropy.io.votable.verify``, which defaults to 'ignore'.

.. versionchanged:: 4.0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as @bsipocz .

Comment thread docs/io/votable/index.rst Outdated
@@ -261,26 +260,40 @@ input.

.. _pedantic-mode:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe change the ref label, too

Comment thread docs/io/votable/index.rst

.. _pedantic-mode:

Pedantic mode

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice find and cleanup, this got missed out in the review cycle of the original PR

@pllim pllim modified the milestones: v5.1, v5.0 Aug 30, 2021
@pllim
pllim requested a review from tomdonaldson August 30, 2021 20:03
@pllim

pllim commented Aug 30, 2021

Copy link
Copy Markdown
Member

Yes, sorry, I misremembered the policy. I moved milestone to 5.0.

Do we need to ping pyvo people to review this? If anyone will get hit by this warning, it would be pyvo, no? And maybe astroquery too.

@bsipocz

bsipocz commented Aug 30, 2021 •

Copy link
Copy Markdown
Member

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 main (aka, the sooner the better to merge things like this before FF)

Comment on lines +290 to +292
with pytest.raises(AstropyDeprecationWarning):
with pytest.raises(VOWarning):
parse(get_pkg_data_filename('data/gemini.xml'))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this works too.

Suggested change
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'))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would work, but it would also exceed the 80 character line length limit.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our limit is 100 😸

max-line-length = 100

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/io/votable/index.rst Outdated
`~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:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
argument, which can take three values:
keyword, which can take three values:

Comment thread docs/io/votable/index.rst Outdated
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`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent.

Suggested change
:ref:`astropy_config`
:ref:`astropy_config`.

Comment thread docs/io/votable/index.rst Outdated
: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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Comment thread docs/io/votable/index.rst

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that this sentence is deleted altogether. Does this no longer apply?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@eerovaher

Copy link
Copy Markdown
Member Author

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?

@pllim

pllim commented Aug 31, 2021

Copy link
Copy Markdown
Member

Should I add a second commit

I think second commit is fine. Thanks!

@pllim pllim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

As @bsipocz , let's get this in sooner than later, so downstream packages have time to adjust before feature freeze.

@pllim
pllim merged commit 5df77af into astropy:main Sep 1, 2021
eerovaher added a commit to eerovaher/astropy that referenced this pull request Sep 20, 2021
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.
eerovaher added a commit to eerovaher/astroquery that referenced this pull request Oct 4, 2021
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.
eerovaher added a commit to eerovaher/astroquery that referenced this pull request Oct 4, 2021
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`.
eerovaher added a commit to eerovaher/astroquery that referenced this pull request Oct 6, 2021
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.
eerovaher added a commit to eerovaher/astroquery that referenced this pull request Oct 6, 2021
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`.
@eerovaher
eerovaher deleted the deprecate-pedantic branch November 8, 2021 12:27
syed-gilani pushed a commit to syed-gilani/astroquery that referenced this pull request Mar 11, 2022
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.
syed-gilani pushed a commit to syed-gilani/astroquery that referenced this pull request Mar 11, 2022
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`.
burnout87 pushed a commit to oda-hub/astroquery that referenced this pull request May 10, 2022
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.
burnout87 pushed a commit to oda-hub/astroquery that referenced this pull request May 10, 2022
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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Truly deprecate pedantic option in VO table

3 participants