Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rugeli committed Jul 14, 2023
1 parent 898561a commit ad56993
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
6 changes: 1 addition & 5 deletions cellpack/autopack/DBHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,7 @@ def prep_data_for_db(data):
unpacked_value = vars(value)
modified_data[key] = unpacked_value
if isinstance(unpacked_value, dict):
modified_data[key] = DBHandler.prep_data_for_db(
unpacked_value
)
modified_data[key] = DBHandler.prep_data_for_db(unpacked_value)
# If the value is a dictionary, recursively convert its nested lists to dictionaries
elif isinstance(value, dict):
modified_data[key] = DBHandler.prep_data_for_db(value)
Expand Down Expand Up @@ -557,8 +555,6 @@ def update_or_create_metadata(self, collection, id, data):
except NotFound:
self.db.set_doc(collection, id, data)



def prep_db_doc_for_download(self, db_doc):
"""
convert data from db and resolve references.
Expand Down
6 changes: 3 additions & 3 deletions cellpack/autopack/FirebaseHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def get_creds():
if creds is None or "firebase" not in creds:
creds = FirebaseHandler.write_creds_path()
return creds["firebase"]

@staticmethod
def get_username():
creds = read_json_file("./.creds")
Expand All @@ -61,7 +61,7 @@ def doc_id(doc):
@staticmethod
def create_path(collection, doc_id):
return f"firebase:{collection}/{doc_id}"

@staticmethod
def create_timestamp():
return firestore.SERVER_TIMESTAMP
Expand All @@ -83,7 +83,7 @@ def update_doc(self, collection, id, data):
doc_ref.update(data)
print(f"successfully updated to path: {doc_ref.path}")
return doc_ref

@staticmethod
def update_reference_on_doc(doc_ref, index, new_item_ref):
doc_ref.update({index: new_item_ref})
Expand Down
2 changes: 1 addition & 1 deletion cellpack/autopack/writers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def save_as_simularium(
autopack.helper.add_grid_data_to_scene(
f"{gradient.name}-distances", grid_positions, values
)

file_name = autopack.helper.writeToFile(
f"{result_file_path}_results", env.boundingBox, env.name, env.version
)
Expand Down

0 comments on commit ad56993

Please sign in to comment.