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

1.) Provenance logging refactor and support for SpotFindingResults #1517

Merged
merged 1 commit into from
Oct 3, 2019

Conversation

shanaxel42
Copy link
Collaborator

@shanaxel42 shanaxel42 commented Aug 29, 2019

This PR does a bit of a provenance log refactor fixing some issues and also setting things up to work with the new FindSpots and DecodeSpots modules.

Depends on #1515 #1489 #1516

@codecov-io
Copy link

codecov-io commented Aug 29, 2019

Codecov Report

Merging #1517 into master will decrease coverage by 0.07%.
The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1517      +/-   ##
==========================================
- Coverage   87.54%   87.47%   -0.08%     
==========================================
  Files         145      145              
  Lines        5036     5053      +17     
==========================================
+ Hits         4409     4420      +11     
- Misses        627      633       +6
Impacted Files Coverage Δ
starfish/test/full_pipelines/api/test_dartfish.py 100% <100%> (ø) ⬆️
starfish/core/imagestack/imagestack.py 94.39% <100%> (-0.05%) ⬇️
starfish/core/util/logging.py 97.5% <100%> (+0.83%) ⬆️
starfish/test/full_pipelines/api/test_iss_api.py 100% <100%> (ø) ⬆️
starfish/core/types/_spot_finding_results.py 54.83% <66.66%> (+0.99%) ⬆️
starfish/core/pipeline/algorithmbase.py 87.87% <77.77%> (-12.13%) ⬇️

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 af8af16...8338ae1. Read the comment docs.

@shanaxel42 shanaxel42 force-pushed the saxelrod-add_coordinates-to-spot-results branch from 87cd345 to a9f9535 Compare August 29, 2019 16:28
@shanaxel42 shanaxel42 force-pushed the saxelrod-add-logging-support-spot-results branch 2 times, most recently from 69e0b02 to 5eae3cc Compare August 29, 2019 16:46
@shanaxel42 shanaxel42 force-pushed the saxelrod-add_coordinates-to-spot-results branch from 18c85b6 to 29d66f5 Compare August 30, 2019 17:51
@shanaxel42 shanaxel42 force-pushed the saxelrod-add-logging-support-spot-results branch from ad12586 to a484e73 Compare August 30, 2019 18:31
@ambrosejcarr ambrosejcarr changed the title Provancene logging refactor and support for SpotFindingResults Provenance logging refactor and support for SpotFindingResults Sep 13, 2019
class Log:
def __init__(self):
"""
Small class for capturing methods applied to throughout a pipeline.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Small class for capturing methods applied to throughout a pipeline.
Class for capturing methods and their parameters applied by an analysis pipeline.

from starfish.core.types import CORE_DEPENDENCIES, LOG


class Log:
Copy link
Member

Choose a reason for hiding this comment

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

Love the idea. Is this only used by spot finding? My intuition is that this should trigger a bigger refactor.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nah this is used by everything. This PR was basically the "bigger" logging refactor needed to keep everything working throughout the refactor

spot_results = kwargs['spots']
spot_results.log.update_log(args[0])
result.attrs[STARFISH_EXTRAS_KEY] = spot_results.log.encode()
# OLD CODE FOR DETECT WILL GET REMOVED
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# OLD CODE FOR DETECT WILL GET REMOVED
# TODO shanaxel42 OLD CODE FOR DETECT WILL GET REMOVED

@shanaxel42 shanaxel42 force-pushed the saxelrod-add_coordinates-to-spot-results branch from 29d66f5 to 9bf4e8e Compare September 17, 2019 21:51
@shanaxel42 shanaxel42 force-pushed the saxelrod-add-logging-support-spot-results branch from a484e73 to 4b53ae7 Compare September 17, 2019 21:51
@shanaxel42 shanaxel42 force-pushed the saxelrod-add_coordinates-to-spot-results branch from 9bf4e8e to b5a67db Compare September 17, 2019 23:42
@shanaxel42 shanaxel42 force-pushed the saxelrod-add-logging-support-spot-results branch 2 times, most recently from ed717ad to 8cb311e Compare September 18, 2019 18:51
@shanaxel42 shanaxel42 force-pushed the saxelrod-add_coordinates-to-spot-results branch from b5a67db to 699ec22 Compare September 18, 2019 18:51
@shanaxel42 shanaxel42 force-pushed the saxelrod-add-logging-support-spot-results branch from 8cb311e to d7c7372 Compare September 18, 2019 19:30
@shanaxel42 shanaxel42 force-pushed the saxelrod-add_coordinates-to-spot-results branch from 189483f to 94befac Compare September 18, 2019 20:27
@shanaxel42 shanaxel42 force-pushed the saxelrod-add-logging-support-spot-results branch from d7c7372 to 4c3fc56 Compare September 18, 2019 20:27
@shanaxel42 shanaxel42 force-pushed the saxelrod-add_coordinates-to-spot-results branch from 94befac to af7cd8a Compare September 18, 2019 20:44
@shanaxel42 shanaxel42 force-pushed the saxelrod-add-logging-support-spot-results branch from 4c3fc56 to 82b52da Compare September 18, 2019 20:44
@shanaxel42 shanaxel42 force-pushed the saxelrod-add_coordinates-to-spot-results branch from af7cd8a to c27f333 Compare September 18, 2019 21:04
@shanaxel42 shanaxel42 force-pushed the saxelrod-add-logging-support-spot-results branch 4 times, most recently from ed7b64d to 4e1c009 Compare September 19, 2019 18:04
@shanaxel42 shanaxel42 force-pushed the saxelrod-add_coordinates-to-spot-results branch from 71e65d9 to 5ae5c14 Compare September 19, 2019 21:09
@shanaxel42 shanaxel42 force-pushed the saxelrod-add-logging-support-spot-results branch from 4e1c009 to 08386dc Compare September 19, 2019 21:09
@shanaxel42 shanaxel42 force-pushed the saxelrod-add-logging-support-spot-results branch 2 times, most recently from 29bcddc to 99b64d8 Compare September 19, 2019 22:12
@shanaxel42 shanaxel42 force-pushed the saxelrod-add_coordinates-to-spot-results branch from 3664502 to e9a2178 Compare September 19, 2019 23:03
@shanaxel42 shanaxel42 force-pushed the saxelrod-add-logging-support-spot-results branch from 99b64d8 to 4db2a9b Compare September 19, 2019 23:03
@shanaxel42 shanaxel42 force-pushed the saxelrod-add_coordinates-to-spot-results branch from e9a2178 to 9147e3a Compare September 19, 2019 23:42
@shanaxel42 shanaxel42 force-pushed the saxelrod-add-logging-support-spot-results branch 3 times, most recently from aadd9a8 to b214df1 Compare September 20, 2019 15:27
@shanaxel42 shanaxel42 force-pushed the saxelrod-add_coordinates-to-spot-results branch from 1d04269 to 5589427 Compare September 20, 2019 20:59
@shanaxel42 shanaxel42 force-pushed the saxelrod-add-logging-support-spot-results branch 2 times, most recently from 4ce1efd to debb55b Compare September 23, 2019 18:06
@shanaxel42 shanaxel42 force-pushed the saxelrod-add_coordinates-to-spot-results branch 2 times, most recently from cbcdcb6 to dae77b7 Compare September 23, 2019 20:00
@shanaxel42 shanaxel42 force-pushed the saxelrod-add-logging-support-spot-results branch 2 times, most recently from 4b3fa52 to f090a90 Compare September 23, 2019 22:18
@shanaxel42 shanaxel42 force-pushed the saxelrod-add_coordinates-to-spot-results branch from dae77b7 to 403b0bd Compare September 23, 2019 22:18
@shanaxel42 shanaxel42 changed the base branch from saxelrod-add_coordinates-to-spot-results to master September 24, 2019 16:46
@shanaxel42 shanaxel42 force-pushed the saxelrod-add-logging-support-spot-results branch from f090a90 to bf35640 Compare September 24, 2019 16:49
@shanaxel42 shanaxel42 force-pushed the saxelrod-add-logging-support-spot-results branch from bf35640 to c220e44 Compare September 25, 2019 20:36
it.attrs[STARFISH_EXTRAS_KEY] = LogEncoder().encode({LOG: stack.log})
if result is not None:
method_class_str = str(args[0].__class__)
if 'ApplyTransform' in method_class_str or 'Filter' in method_class_str:
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's plausible that we have mechanisms that take multiple loggable objects.

It might be a good idea to have a base ProvenanceTracked class that all objects (ImageStack, IntensityTable, etc.) inherit, and then to walk through all the arguments to find objects that extend ProvenanceTracked. Then scrape the logs from those objects and build up a provenance graph.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this seems like a larger refactor, like maybe something post spot finding stuff

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sure, can you tack that onto the logging epic?

There are a lot of gaps in the logging -- for instance, ApplyTransform plausibly should log the origin of the warping data. Also can be covered afterwards.

starfish/core/util/logging.py Show resolved Hide resolved
@shanaxel42 shanaxel42 changed the title Provenance logging refactor and support for SpotFindingResults 1.) Provenance logging refactor and support for SpotFindingResults Oct 1, 2019
it.attrs[STARFISH_EXTRAS_KEY] = LogEncoder().encode({LOG: stack.log})
if result is not None:
method_class_str = str(args[0].__class__)
if 'ApplyTransform' in method_class_str or 'Filter' in method_class_str:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sure, can you tack that onto the logging epic?

There are a lot of gaps in the logging -- for instance, ApplyTransform plausibly should log the origin of the warping data. Also can be covered afterwards.

@shanaxel42 shanaxel42 merged commit 912d176 into master Oct 3, 2019
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.

4 participants