Skip to content

Quality control plotting pipeline#7

Open
Munchic wants to merge 24 commits intodevfrom
feature/qc-plots
Open

Quality control plotting pipeline#7
Munchic wants to merge 24 commits intodevfrom
feature/qc-plots

Conversation

@Munchic
Copy link
Collaborator

@Munchic Munchic commented Aug 19, 2020

Updates

  • All the behind the scenes of how plot_map is parsed into PLOT_KWARGS, PLOT_METHODS, and PLOT_MAP
  • See README.MD from CellForest for more details on architecture

Testing

[x] Tested locally
[x] Tested notebook
[ ] Cleared notebook outputs
[x] Docstrings and type-hinting

Fixes

Future works

  • Move plotting wrappers into dataforest

Reviewer's tasks

  • Are there areas where the it's unclear what/how the function is working?

@Munchic Munchic self-assigned this Aug 19, 2020
@Munchic Munchic changed the title Quality Control Plotting Pipeline Quality control plotting pipeline Aug 19, 2020
@Munchic Munchic changed the title Quality control plotting pipeline Quality control plotting pipeline (WIP) Aug 19, 2020
@Munchic Munchic requested a review from TheAustinator August 21, 2020 20:36
@TheAustinator TheAustinator changed the base branch from dev to feature/datatree September 14, 2020 19:02
@TheAustinator TheAustinator changed the base branch from feature/datatree to dev September 14, 2020 19:02
@TheAustinator TheAustinator changed the base branch from dev to feature/datatree September 14, 2020 20:59
@TheAustinator TheAustinator changed the base branch from feature/datatree to dev September 14, 2020 20:59
@TheAustinator TheAustinator changed the base branch from dev to feature/datatree September 15, 2020 00:13
@TheAustinator TheAustinator changed the base branch from feature/datatree to dev September 15, 2020 00:13
Copy link
Owner

@TheAustinator TheAustinator left a comment

Choose a reason for hiding this comment

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

Really nice job making a straightforward developer interface for adding new plot methods and following the paradigms of the rest of the package

def PLOT_METHODS(cls):
return cls.CONFIG["plot_methods"]
try:
plot_methods = cls.CONFIG["plot_methods"]
Copy link
Owner

Choose a reason for hiding this comment

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

Another way to write this would be plot_methods = cls.CONFIG.get("plot_methods", parse_plot_methods(config=cls.CONFIG))

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Couldn't find parse_plot_methods, is this outdated?

try:
process_run = branch[branch.current_process]
plot_dir = process_run.plot_map[method_name].parent
plot_name = get_plot_name_from_plot_method(
Copy link
Owner

Choose a reason for hiding this comment

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

Could probably be abstracted away to a _get_plot_dir method to avoid crowding the wrapper and having a lot of raw lines in the try block. Abstracting it away would also clarify what these lines are doing by virtue of the method 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.

Seems like you resolved this!

@property
def process_plot_map(self) -> Dict[str, Path]:
return {file_alias: self.plots_path / self._plot_lookup[file_alias] for file_alias in self._plot_lookup}
plot_map_dict = {}
Copy link
Owner

Choose a reason for hiding this comment

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

Docstring would be helpful

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Also looks like you broke it into several understandable steps

from copy import deepcopy
import json
from collections import OrderedDict

Copy link
Owner

@TheAustinator TheAustinator Sep 15, 2020

Choose a reason for hiding this comment

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

Return value type hinting + brief description of what the keys/values represent (when the function returns a dict) would hugely clarify this file. A bit more of a detailed description in docstrings would be helpful as well

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, added some docstrings :)

TheAustinator and others added 6 commits September 23, 2020 02:15
Merge branch 'dev' into feature/qc-plots

# Conflicts:
#	dataforest/core/DataBranch.py
#	dataforest/hooks/hooks/core/hooks.py
plotting debugging and notebook compatibility;
…ig; migrated groupby from cellforest; refactored subset and filter to allow `_MULTI_`; PlotMethods.{display, keys, methods}; PlotPreparator for stratify and faceting; improved config collectors; tether bug
@Munchic Munchic changed the title Quality control plotting pipeline (WIP) Quality control plotting pipeline Oct 21, 2020
@Munchic Munchic requested a review from TheAustinator October 21, 2020 05:20
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.

2 participants