-
Notifications
You must be signed in to change notification settings - Fork 2
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
Changes from 19 commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
c78f74d
skeleton of gradient upload
rugeli faf1b53
Merge branch 'main' of https://github.com/mesoscope/cellpack into fea…
rugeli 9b28ad4
reconstruct gradient class
rugeli d50ba40
fix gradient should write
rugeli 87974e8
Merge branch 'feature/firebase-upload-test' of https://github.com/mes…
rugeli c2b7177
pulled mock db for gradient testing
rugeli 069b0ce
test gradient doc
rugeli 2010dbf
upload gradient tests
rugeli 8af2102
fix lint
rugeli dcc4d6a
fix test in db handler for gradient upload
rugeli d977b5a
[wip] get db data in load_file
rugeli 2c1e498
delete as_dict in gradientDoc
rugeli 1f881c8
fix test
rugeli 6ad0389
cleaned as_dict and tests in gradient doc
rugeli cdcc9ab
[wip] resolve reference
rugeli a1ac167
update grad path in obj doc
rugeli 7ea2e59
comment
rugeli 5a4146f
Merge branch 'feature/firebase-upload-gradients' of https://github.co…
rugeli 68aecad
get grad data in downloaded_data
rugeli c1a346f
resolve reference
rugeli d9365d0
resolve gradient reference in local data
rugeli 2abf7cc
resolve grad and pass surface gradient
rugeli 40f7216
fixed gradient update in regions
rugeli fa87f0f
add tests for gradient reference
rugeli 70c3165
linter
rugeli 6dcad95
[wip] collect gradient and obj data for packing
rugeli c7b2f92
let load_file also return database_name
rugeli 289760b
[wip] revert recipe draft
rugeli c5ea1c4
fix gradient in resolve_local_regions
rugeli 9fc15df
remove name key in obj and grad
rugeli 0728304
separate out resolve grad code
rugeli a4af8f6
clean downloading code from this branch
rugeli bb9abeb
linter
rugeli 1e1610c
cleanup
rugeli c1aeea9
Merge branch 'main' of https://github.com/mesoscope/cellpack into fea…
rugeli 20fb882
revert should_write check
rugeli 39435a1
correct obj references in newly uploaded recipes
rugeli f24612d
Update cellpack/autopack/DBRecipeHandler.py
rugeli b07b1b5
Update cellpack/autopack/__init__.py
rugeli 2d0859d
Merge pull request #174 from mesoscope/feature/resovle-grads-in-comp
rugeli 3c09ce9
fixed test after the sub branch merged
rugeli 4125043
lint
rugeli 55859a2
Merge branch 'main' of https://github.com/mesoscope/cellpack into fea…
rugeli 15a12f8
Merge branch 'main' of https://github.com/mesoscope/cellpack into fea…
rugeli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are great, thanks for adding tests! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from cellpack.autopack.DBRecipeHandler import GradientDoc | ||
from cellpack.tests.mocks.mock_db import MockDB | ||
|
||
mock_db = MockDB({}) | ||
|
||
|
||
def test_should_write_with_no_existing_doc(): | ||
gradient_doc = GradientDoc({"name": "test_grad_name", "test_key": "test_value"}) | ||
doc, doc_id = gradient_doc.should_write(mock_db, "test_grad_name") | ||
assert doc_id is None | ||
assert doc is None | ||
|
||
|
||
def test_should_write_with_existing_doc(): | ||
existing_doc = {"name": "test_grad_name", "test_key": "test_value"} | ||
mock_db.data = existing_doc | ||
gradient_doc = GradientDoc({"name": "test_grad_name", "test_key": "test_value"}) | ||
|
||
doc, doc_id = gradient_doc.should_write(mock_db, "test_grad_name") | ||
assert doc_id is not None | ||
assert doc is not None |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.