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

Feature/firebase upload gradients #170

Merged
merged 44 commits into from
Aug 15, 2023
Merged

Conversation

rugeli
Copy link
Collaborator

@rugeli rugeli commented May 5, 2023

Problem

What is the problem this work solves, including
completes gradient collection upload in #124
closes #129

Solution

What I/we did to solve this problem

  • created GradientDoc class to handle gradient data uploads if it is included in the recipe we are uploading to firebase
  • replaced gradient name with db path in object doc before uploading
  • wrote tests for the gradient upload feature

Expected Behavior

  • uploads gradient data into gradients collection
  • updates gradient's firebase reference in object data
  • will not accept duplicates

Type of change

  • New feature (non-breaking change which adds functionality)

Change summary:

  • recipes I ran for testing: peroxisomes_surface_gradient.json and gradients.json

Steps to Verify:

  1. conda activate autopack
  2. upload -r [relative-path-to-a-gradient-recipe] -c [your-firebase-cred-path]
  3. pytest cellpack

Screenshots (optional):

Screenshot 2023-05-05 at 4 09 58 PM

@github-actions
Copy link

github-actions bot commented May 5, 2023

Packing analysis report

Analysis for packing results located at cellpack/tests/outputs/test_spheres/spheresSST

Ingredient name Encapsulating radius Average number packed
ext_A 25 236.0

Packing image

Packing image

Distance analysis

Expected minimum distance: 50.00
Actual minimum distance: 50.01

Ingredient key Pairwise distance distribution
ext_A Distance distribution ext_A

@codecov-commenter
Copy link

codecov-commenter commented May 5, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.10% 🎉

Comparison is base (8ab1881) 98.42% compared to head (15a12f8) 98.52%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #170      +/-   ##
==========================================
+ Coverage   98.42%   98.52%   +0.10%     
==========================================
  Files          15       16       +1     
  Lines         444      476      +32     
==========================================
+ Hits          437      469      +32     
  Misses          7        7              
Files Changed Coverage Δ
cellpack/tests/test_db_recipe_handler.py 100.00% <100.00%> (ø)
cellpack/tests/test_gradient_doc.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rugeli rugeli marked this pull request as draft May 15, 2023 22:36
@rugeli rugeli marked this pull request as ready for review May 16, 2023 18:40
@rugeli rugeli marked this pull request as draft May 23, 2023 00:35
@rugeli rugeli marked this pull request as ready for review May 25, 2023 18:12
@mogres
Copy link
Collaborator

mogres commented Jun 12, 2023

@rugeli could you pull from main whenever you get a chance so that updates from your other branch get merged in?

for item in CompositionDoc.SHALLOW_MATCH:
if db_data[item] != local_data[item]:
print(db_data[item], local_data[item])
shallow_match = False
break
Copy link
Collaborator

Choose a reason for hiding this comment

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

This break statement should probably be a return statement? It looks like it only breaks out of the inner loop right now.

Suggested change
break
return None, None

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah I know it's confusing, the readability of this function is truly a concern for us. Let's address it during our group programming session this week.

cellpack/autopack/DBRecipeHandler.py Outdated Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

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

These are great, thanks for adding tests!

rugeli and others added 3 commits July 17, 2023 14:52
Copy link
Member

@meganrm meganrm left a comment

Choose a reason for hiding this comment

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

Need to fix a test but otherwise looks good

@rugeli rugeli merged commit e9211d9 into main Aug 15, 2023
7 checks passed
@rugeli rugeli deleted the feature/firebase-upload-gradients branch August 15, 2023 21:15
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.

Firebase: upload gradient recipes
4 participants