-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch write path to transact in URLs
Previously, the read path for slicedimage operated with URLs. This allowed us to have manifests on local disk that referred to network resources for tiles. This PR will use URLs as the destination for manifest files and tile data. This PR also changes the way users can control the behavior of writing. Previously, we allowed for two callbacks: one allowed callers to designate where a sub-manifest is located on disk, and the other allowed callers to open a file for writing tile data. This turns out not to capture all the use cases for how we might want to control writing, so this PR creates WriterContract. It has three callbacks: one to designate where a sub-manifest is located in URL-space, another to designate where a tile is located in URL space, and one to write tile data to a URL. Furthermore, we provide a CompatibilityWriterContract that _mostly_ mimics the behavior of the old callbacks. The one notable exception is that the tricks utilized to perform in-place tile writing no longer work. CompatibilityWriterContract finds the destination in `tile_url_generator` by opening the tile data file, find out where it is on disk, and then closing the file. The new callback (write_tile_data) just opens the path and writes to it. There is not a way to maintain the file handle between `tile_url_generator` and `write_tile_data`. Because this is a slight change in behavior, we bump the version of the library to 4.0.0. Test plan: verified existing tests pass. verify existing starfish imagestack and experiment tests pass with this library (except for in-place tile construction). verify that the new in-place code for starfish passes with this library.
- Loading branch information
Tony Tung
committed
Jul 12, 2019
1 parent
2d849bd
commit dfbd13f
Showing
13 changed files
with
315 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
|
||
setuptools.setup( | ||
name="slicedimage", | ||
version="3.2.0", | ||
version="4.0.0", | ||
description="Library to access sliced imaging data", | ||
author="Tony Tung", | ||
author_email="[email protected]", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from ._base import Reader, VERSIONS, Writer | ||
from slicedimage.url.resolve import resolve_url, resolve_path_or_url | ||
|
||
from ._base import Reader, VERSIONS, Writer, WriterContract | ||
from ._v0_0_0 import v0_0_0 | ||
from ._v0_1_0 import v0_1_0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.