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/run inherited objects #198

Merged

Conversation

rugeli
Copy link
Collaborator

@rugeli rugeli commented Sep 27, 2023

Problem

What is the problem this work solves, including
closes #171

Solution

What I/we did to solve this problem

  • added a flag resolve_inheritance within the_read() method of recipe_loader.py
  • when getting the full recipe data for upload, set the flag to false so the inherited objects won't be resolved, and the key inherit will be retained
  • When uploading an individual object and an "inherit" key is identified, the reference of the inherited object will be linked
  • resolved conflicts and bugs that arose from the inheritance reconstruction during uploading and downloading

Type of change

Please delete options that are not relevant.

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

Steps to Verify:

  1. upload -r examples/recipes/v2/gradients.json
  2. pack -r firebase:recipes/gradients_v-default

Screenshots (optional):

Show-n-tell images/animations here
Before - the inheritance key was resolved when receiving the full recipe data for uploading
Screenshot 2023-09-27 at 1 30 24 PM
After - the key inherit is now retained and its value points to a reference
Screenshot 2023-09-27 at 1 13 27 PM

Keyfiles (delete if not relevant):

  1. DBRecipeHandler.py
  2. recipe_loader.py

@github-actions
Copy link

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

@rugeli rugeli requested review from meganrm and mogres September 27, 2023 20:47
@rugeli rugeli mentioned this pull request Oct 6, 2023
Copy link
Collaborator

@mogres mogres left a comment

Choose a reason for hiding this comment

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

Looks good to me! Test recipe upload and packing ran as expected.

@rugeli rugeli merged commit cc97646 into feature/run-recipes-from-firebase Oct 12, 2023
2 checks passed
@rugeli rugeli deleted the feature/run-inherited-objects branch October 12, 2023 21:24
rugeli added a commit that referenced this pull request Dec 18, 2023
* [wip] prep recipe data for packing

* get creds from local file

* save firebase creds to a .creds file

* remove cred arg

* check for already handled values in remote recipes

* can pack one sphere

* * adding username to .creds
* formatting

* move `write_username_to_creds`

* download recipe testing

* edit comment

* code refactor

* lint

* format tests

* add prep_db_doc

* changed class name in DBRecipeHandler

* fix lint and test errors

* initialize firebase handler only once

* refactor message

* add remote db options in `pack`

* remove a print statement

* rename and reorg DB handler

* fix tests

* move database_ids enum to interface_objects

* remove db_handler in pack and recipe_loader

* send db_handler in to autopack

* rename functions

* integrate DATABASE_NAMES into interface_objects

* lint

* Feature/run inherited objects (#198)

* turn off resolving inheritance while uploading

* able to upload recipes having "inherit" key

* get download and pack to work, refactors needed

* refactors

* formatting

* testing and refactor

* Feature/save metadata to firebase (#206)

* refactor AWS and firebase handler

* databases initiation handling

* refactor

* Update .gitignore

Co-authored-by: Saurabh Mogre <[email protected]>

* add file existence check

* refactor is_nested_list method

* revert write_json_file

* formatting

---------

Co-authored-by: meganrm <[email protected]>
Co-authored-by: Saurabh Mogre <[email protected]>
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.

3 participants