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

Record the tile shape in our data structures if it's not provided. #73

Merged
merged 1 commit into from
Oct 10, 2018

Conversation

ttung
Copy link
Collaborator

@ttung ttung commented Oct 10, 2018

If the tile_shape is not provided by the json file, we should infer it from the actual data. This is a suboptimal data path since it requires a decoding step just to get the shape of the tile, so we warn about it.

Previously, this field was set by _load(), but that was removed in #72.

Test plan: Generate a tileset document, and then strip the shape data from the tiles. Then read it back. The correct tile shapes should be provided, but getting them should trigger a warning.

@ttung ttung requested a review from shanaxel42 October 10, 2018 23:20
If the tile_shape is not provided by the json file, we should infer it from the actual data.  This is a suboptimal data path since it requires a decoding step just to get the shape of the tile, so we warn about it.

Previously, this field was set by `_load()`, but that was removed in #72.

Test plan: Generate a tileset document, and then strip the shape data from the tiles.  Then read it back.  The correct tile shapes should be provided, but getting them should trigger a warning.
@codecov-io
Copy link

codecov-io commented Oct 10, 2018

Codecov Report

Merging #73 into master will increase coverage by 0.23%.
The diff coverage is 92.3%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #73      +/-   ##
==========================================
+ Coverage   82.49%   82.72%   +0.23%     
==========================================
  Files          18       18              
  Lines         514      521       +7     
==========================================
+ Hits          424      431       +7     
  Misses         90       90
Impacted Files Coverage Δ
slicedimage/_tile.py 97.22% <92.3%> (+0.67%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1fd7546...2eed4f5. Read the comment docs.

Copy link
Member

@ambrosejcarr ambrosejcarr left a comment

Choose a reason for hiding this comment

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

See comment.

def tile_shape(self):
if self._tile_shape is None:
warnings.warn(
"Decoding tile just to obtain shape. It is recommended to include the tile shape "
Copy link
Member

Choose a reason for hiding this comment

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

I think this is a FieldOfView.json, right? Does it make more sense to call it by name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

FieldOfView is a specific subset of TileSet in my mind.

@ttung ttung merged commit a75d1b5 into master Oct 10, 2018
@ttung ttung deleted the tonytung-tile-shape branch October 10, 2018 23:30
ttung pushed a commit to spacetx/starfish that referenced this pull request Oct 10, 2018
Both notebooks had datasets where the tile shapes were not consistently provided.  spacetx/slicedimage#72 broke the recording of the tile shape, and spacetx/slicedimage#73 fixes it.

Test plan: `make -j run__notebooks/py/ISS_Pipeline_-_Breast_-_1_FOV.py run__notebooks/py/assay_comparison.py`
ttung added a commit to spacetx/starfish that referenced this pull request Oct 11, 2018
Both notebooks had datasets where the tile shapes were not consistently provided.  spacetx/slicedimage#72 broke the recording of the tile shape, and spacetx/slicedimage#73 fixes it.

Test plan: `make -j run__notebooks/py/ISS_Pipeline_-_Breast_-_1_FOV.py run__notebooks/py/assay_comparison.py`
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.

None yet

3 participants