Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy up of the io doc strings and API page. Deprecate toplevel io namespace. #7537

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

nabobalis
Copy link
Contributor

@nabobalis nabobalis commented Mar 27, 2024

Changelog check will fail as I had to change other changelogs but I did add one.

@nabobalis nabobalis added Documentation Affects the documentation No Backport A PR that isn't to be backported to any release branch. (To be used as a flag to other maintainers) labels Mar 27, 2024
@nabobalis nabobalis added this to the 6.0.0 milestone Mar 27, 2024
@nabobalis nabobalis changed the title Tidy up of the io docs and Api page Tidy up of the io doc strings and API page. Depreciate toplevel io namespace. Mar 27, 2024
@nabobalis nabobalis changed the title Tidy up of the io doc strings and API page. Depreciate toplevel io namespace. Tidy up of the io doc strings and API page. Deprecate toplevel io namespace. Mar 27, 2024
@nabobalis nabobalis added the Needs Review Needs reviews before merge label Mar 28, 2024
@nabobalis nabobalis marked this pull request as ready for review March 28, 2024 23:29
@nabobalis nabobalis requested a review from a team as a code owner March 28, 2024 23:29
docs/reference/io.rst Outdated Show resolved Hide resolved
docs/reference/io.rst Outdated Show resolved Hide resolved
docs/reference/io.rst Show resolved Hide resolved
pytest.ini Outdated Show resolved Hide resolved
docs/reference/io.rst Outdated Show resolved Hide resolved
Copy link
Member

@wtbarnes wtbarnes left a comment

Choose a reason for hiding this comment

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

I don't understand how some of these tests aren't throwing an ImportError but sure.

assert mock.call_args[0][0] == url
assert isinstance(hdulist, list)
assert len(hdulist) == 1
assert len(hdulist[0]) == 2
assert isinstance(hdulist[0][0], np.ndarray)
assert isinstance(hdulist[0][1], sunpy.io.header.FileHeader)
assert isinstance(hdulist[0][1], sunpy.io._header.FileHeader)
Copy link
Member

Choose a reason for hiding this comment

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

Won't this fail since you've removed import sunpy.io?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I still import it no?!

Copy link
Contributor Author

@nabobalis nabobalis May 19, 2024

Choose a reason for hiding this comment

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

Why does that still work?!

It surely won't get it from import sunpy so?!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I imported it for my sanity.

@wtbarnes wtbarnes self-requested a review May 18, 2024 19:59
wtbarnes

This comment was marked as outdated.

Copy link
Member

@wtbarnes wtbarnes left a comment

Choose a reason for hiding this comment

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

I'm an idiot. Nevermind. Looks good.

@nabobalis nabobalis removed the Needs Review Needs reviews before merge label May 19, 2024
Comment on lines 9 to 10
warn_deprecated('The toplevel space of the io subpackage was never intended for public use and will be removed in the future.')
from sunpy.io._file_tools import read_file, write_file
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is wrong.

I get the message if I do:

In [3]: import sunpy.io._header
WARNING: SunpyDeprecationWarning: The toplevel space of the io subpackage was never intended for public use and will be removed in the future. [sunpy.io]

I should not be raising this warning if someone does import that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or even:

import sunpy.io.special.asdf

As it stands, we can't merge this till I fix this.

@nabobalis nabobalis marked this pull request as draft May 19, 2024 03:59
@nabobalis
Copy link
Contributor Author

TODO: Fix CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Affects the documentation No Backport A PR that isn't to be backported to any release branch. (To be used as a flag to other maintainers)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants