Skip to content

Comments

keep name fields visible in recipe json#55

Merged
ascibisz merged 1 commit intomainfrom
fix/show-names
Aug 6, 2025
Merged

keep name fields visible in recipe json#55
ascibisz merged 1 commit intomainfrom
fix/show-names

Conversation

@ascibisz
Copy link
Contributor

@ascibisz ascibisz commented Jul 30, 2025

Problem

Currently, there's a bug when you try to edit a recipe that has gradients. This is because the gradient's name field has been removed during the process of forming the JSON object from the nested firebase references, and we aren't adding it back in when we upload the edited recipe to the recipes_edited firebase collection. The cellPACK python package expects each gradient to have name field present, so it throws an error.

Solution

While I originally removed the "name" field from gradients, objects, and compositions for displaying in the JSON, along with "id" and "dedup_hash", because that information seemed unnecessary / redundant, I now think we should keep the "name" field displayed.

I originally added "name" back just to solve this bug, but fundamentally I think we should include "name" in general. While "dedup_hash" and "id" are firebase fields that the user really doesn't need to see, "name" is an expected field by cellpack, and if the user were to run a recipe locally, they would need to have the "name" field present. Thus, I think we should display it in the recipe JSON, so the user has an accurate representation of what is being run.

To Test

Go to the preview link, select the ER_peroxisome recipe and the rules_shape config, then make a change to the recipe. The packing should run and work as expected (previously, it would have failed)

@github-actions
Copy link

github-actions bot commented Jul 30, 2025

PR Preview Action v1.6.2
Preview removed because the pull request was closed.
2025-08-06 22:00 UTC

@ascibisz ascibisz marked this pull request as ready for review July 30, 2025 23:37
@ascibisz ascibisz requested a review from rugeli July 30, 2025 23:37
@rugeli
Copy link
Contributor

rugeli commented Aug 6, 2025

Nice catching the root cause, it works!

@ascibisz ascibisz merged commit 6cf7a7b into main Aug 6, 2025
1 check passed
@ascibisz ascibisz deleted the fix/show-names branch August 6, 2025 22:00
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.

2 participants