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

Upgrade packages #15

Merged
merged 6 commits into from
Aug 8, 2024
Merged

Upgrade packages #15

merged 6 commits into from
Aug 8, 2024

Conversation

pgarrison
Copy link
Collaborator

@pgarrison pgarrison commented Jul 30, 2024

Started by @pgarrison and picked up by @jcass11

Purpose

Main intent:

  • Upgrade package versions

Other changes to fix mypy errors:

  • change an axis object input to a tuple from a list
  • use color hexcodes directly as per my comment below

Testing

  • run_all_manuscript_workflows.py ran without error, checked out a random set of figures and all looked correct
  • ☑️ nuc_morph_analysis/lib/preprocessing/save_datasets_for_quilt.py ran without error but ran into memory issues loading and comparing outputs
  • nuc_morph_analysis/lib/preprocessing/generate_main_manifest.py ran without error and compared output to quilt, only difference is the existence of the parent IDs 71552 and 71115 which is expected)
  • nuc_morph_analysis/lib/preprocessing/generate_perturbation_manifest.py ran without error and compared output to quilt, both feeding control and perturbation manifests are unchanged
  • nuc_morph_analysis/lib/visualization/write_data_for_colorizer.py lots of issues with memory error when not running with --noframes but looking at the output files directly things look good (colony orientation is correct in images, timepoints in correct order, quick scan of values in jsons seem appropriate)

@jcass11
Copy link
Collaborator

jcass11 commented Aug 1, 2024

Looks like the mypy error on usings .colors on a colormap object is an issue on matplotlib's end to fix (pydata/xarray#7802). To get around it I will just replace with the hex codes directly according to the output below. Confirmed that figures result with correct coloring.

Color 0: RGB = (27, 158, 119), Hex = #1b9e77
Color 1: RGB = (217, 95, 2), Hex = #d95f02
Color 2: RGB = (117, 112, 179), Hex = #7570b3
Color 3: RGB = (231, 41, 138), Hex = #e7298a
Color 4: RGB = (102, 166, 30), Hex = #66a61e
Color 5: RGB = (230, 171, 2), Hex = #e6ab02
Color 6: RGB = (166, 118, 29), Hex = #a6761d
Color 7: RGB = (102, 102, 102), Hex = #666666

@jcass11 jcass11 marked this pull request as ready for review August 2, 2024 18:25
@jcass11 jcass11 mentioned this pull request Aug 2, 2024
@pgarrison
Copy link
Collaborator Author

I read the matplotlib.Colormap documentation and found that Colormap.colors is not documented (perhaps only qualitative colormaps have it), but instead Colormap.__call__ is and does the same thing. I pushed a change to continue using matplotlib.Colormap and satisfy mypy.

There is a difference though: the commit I just pushed now gives all the colors an alpha channel (fully opaque).

matplotlib.colormaps.get_cmap("Dark2").colors[7] == (0.4, 0.4, 0.4)
matplotlib.colormaps.get_cmap("Dark2")(7) == (0.4, 0.4, 0.4, 1.0)

My reading of the code makes me think this shouldn't be a problem, since we're just passing the color to matplotlib, but it may be worth further attention @jcass11.

@jcass11 jcass11 added this pull request to the merge queue Aug 8, 2024
Merged via the queue into dev with commit 6f947ed Aug 8, 2024
1 check passed
@jcass11 jcass11 deleted the upgrade-packages branch August 8, 2024 20:00
@pgarrison pgarrison mentioned this pull request Nov 20, 2024
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