Skip to content

Conversation

@jcass11
Copy link
Collaborator

@jcass11 jcass11 commented Dec 2, 2024

Purpose

I took a stab at addressing the recommendations @chantelleleveille and I made in @cfrick13 's transient growth rate branch PR. I am making a PR into his original branch with the hopes of having handled most of the edits needed to clear bandwidth for Chris. I completed this in a separate branch so that if I misinterpreted what Chris was trying to do or he doesn't like my edits is easy to change before affecting his branch.

Edits

  • Removed references to old methods
  • Removed commented code and print statements that are just numbers with no context
  • Used the example tracks dictionary
  • Fix mypy errors

Testing

  • figure_5_s9_workflow.py succeeds*** and figures look good except for the too-large font size on the average transient growth rate by cell cycle bin figures, as noted in my review of the original PR. I did not fix because I thought it may have been done intentionally for some reason?
  • FigS10_workflow.py
  • run_all_manuscript_workflows only the two workflows we anticipate failing do not succeed
    and post here with the results

*** Note that this does produce a bunch of runtime warnings about encountering all-NaN slices and values being set on copies of dataframes

/allen/aics/modeling/juliec/projects/public_nucmorph/nuc-morph-analysis/nuc_morph_analysis/analyses/volume/plot_help.py:524: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  dfcc['cell_cycle'] = ri
/allen/aics/modeling/juliec/projects/public_nucmorph/nuc-morph-analysis/.venv/lib/python3.9/site-packages/numpy/lib/nanfunctions.py:1559: RuntimeWarning: All-NaN slice encountered
  r, k = function_base._ureduce(a,

What didn't I address here that was part of the original density PR?

There were also a huge number of new features added in the transient_growth_f5 PR and I didn't feel prepared to decide how to pate that down. That PR also adds a huge number of these to TFE which @chantelleleveille asked @cfrick13 to prune - I am leaving that up to Chris and did not do that here. There was also a little documentation/motivation that @chantelleleveille requested that I thought was out of my scope for doing this helper PR

@jcass11
Copy link
Collaborator Author

jcass11 commented Dec 3, 2024

EDIT: RESOLVED ✅ thank you @pgarrison for your help

@pgarrison I have struggled to figure out how to fix the mypy errors here. Any idea what's going on? Any help you can give to get this moving along would be really appreciated!

nuc_morph_analysis/analyses/volume/FigS10_workflow.py:121: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "set_xticks"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:122: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "set_xlim"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:170: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "plot"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:171: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "set_xlabel"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:172: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "set_ylabel"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:[17](https://github.com/AllenCell/nuc-morph-analysis/pull/49/checks#step:5:18)8: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "text"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:178: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "transAxes"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:[18](https://github.com/AllenCell/nuc-morph-analysis/pull/49/checks#step:5:19)2: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "legend"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:188: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "get_ylim"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:[19](https://github.com/AllenCell/nuc-morph-analysis/pull/49/checks#step:5:20)0: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "set_yticks"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:191: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "set_ylim"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:193: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "set_yticks"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:194: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "set_ylim"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:195: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "set_xticks"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:196: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "set_xlim"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:197: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "set_xlabel"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:[20](https://github.com/AllenCell/nuc-morph-analysis/pull/49/checks#step:5:21)0: error: Incompatible types in assignment (expression has type "Path", variable has type "str")  [assignment]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:202: error: Incompatible types in assignment (expression has type "str", variable has type "Path")  [assignment]
Found 18 errors in 1 file (checked 185 source files)
Error: Process completed with exit code 1.

@pgarrison
Copy link
Collaborator

pgarrison commented Dec 3, 2024

@pgarrison I have struggled to figure out how to fix the mypy errors here. Any idea what's going on? Any help you can give to get this moving along would be really appreciated!

nuc_morph_analysis/analyses/volume/FigS10_workflow.py:121: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "set_xticks"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:122: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "set_xlim"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:170: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "plot"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:171: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "set_xlabel"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:172: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "set_ylabel"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:[17](https://github.com/AllenCell/nuc-morph-analysis/pull/49/checks#step:5:18)8: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "text"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:178: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "transAxes"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:[18](https://github.com/AllenCell/nuc-morph-analysis/pull/49/checks#step:5:19)2: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "legend"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:188: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "get_ylim"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:[19](https://github.com/AllenCell/nuc-morph-analysis/pull/49/checks#step:5:20)0: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "set_yticks"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:191: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "set_ylim"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:193: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "set_yticks"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:194: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "set_ylim"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:195: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "set_xticks"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:196: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "set_xlim"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:197: error: Item "ndarray[Any, Any]" of "Union[Axes, ndarray[Any, Any]]" has no attribute "set_xlabel"  [union-attr]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:[20](https://github.com/AllenCell/nuc-morph-analysis/pull/49/checks#step:5:21)0: error: Incompatible types in assignment (expression has type "Path", variable has type "str")  [assignment]
nuc_morph_analysis/analyses/volume/FigS10_workflow.py:202: error: Incompatible types in assignment (expression has type "str", variable has type "Path")  [assignment]
Found 18 errors in 1 file (checked 185 source files)
Error: Process completed with exit code 1.

Resolved in 5c8303f and 594ba2f and 88bf22f.

Copy link
Contributor

@cfrick13 cfrick13 left a comment

Choose a reason for hiding this comment

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

These changes look great! Thank you so much!

@jcass11 jcass11 merged commit a9aa7a0 into transient_growth_f5 Dec 4, 2024
1 check passed
@jcass11 jcass11 deleted the transient_growth_julie branch December 4, 2024 17:22
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.

5 participants