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

Add an open method to each source module. #550

Merged
merged 1 commit into from
Feb 22, 2021
Merged

Add an open method to each source module. #550

merged 1 commit into from
Feb 22, 2021

Conversation

manthey
Copy link
Member

@manthey manthey commented Feb 19, 2021

This also adds a canRead method to each source module and an open method to the primary module.

Before, to open a file with a specific file source, you needed to do something like large_image_source_tiff.TiffFileTileSource(path), where the name of the tile source's class had to be used. Now, you can do large_image_source_tiff.open(path), which maps to the same thing. The old way still works. Similarly, canRead required something like large_image_source_tiff.TiffFileTileSource.canRead(path) and now large_image_source_tiff.canRead(path) works as well.

open is now also a synonym for getTileSource, so generically, large_image.getTileSource(path) can be written as large_image.open(path).

There is no requirement that tile source modules expose the open and canRead methods directly; it is more a convenience for developers.

This also adds a canRead method to each source module and an open method
to the primary module.

Before, to open a file with a specific file source, you needed to do
something like ``large_image_source_tiff.TiffFileTileSource(path)``,
where the name of the tile source's class had to be used.  Now, you can
do ``large_image_source_tiff.open(path)``, which maps to the same thing.
The old way still works.  Similarly, ``canRead`` required something like
``large_image_source_tiff.TiffFileTileSource.canRead(path)`` and now
``large_image_source_tiff.canRead(path)`` works as well.

``open`` is now also a synonym for ``getTileSource``, so generically,
``large_image.getTileSource(path)`` can be written as
``large_image.open(path)``.

There is no requirement that tile source modules expose the ``open`` and
``canRead`` methods directly; it is more a convenience for developers.
@manthey manthey merged commit 0eb051a into master Feb 22, 2021
@manthey manthey deleted the module-open branch February 22, 2021 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant