Skip to content

Conversation

@rugeli
Copy link
Contributor

@rugeli rugeli commented Oct 13, 2025

Problem

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

Solution

What I/we did to solve this problem

  • updated the formula to decay_length = 1 / gradient strength
  • added division by zero protection: return max strength if decay length <=0
  • expanded slider limits from 0-0.99 to 0.01-100

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Steps to Verify:

  1. test the new changes on the preview site

@github-actions
Copy link

github-actions bot commented Oct 13, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 24.69% 367 / 1486
🔵 Statements 24.69% 367 / 1486
🔵 Functions 38.98% 23 / 59
🔵 Branches 72.07% 80 / 111
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/utils/gradient.ts 0% 100% 100% 0% 10, 14-15, 17-25, 38-41, 46-49, 52, 55-56, 59-60, 62-63, 66-70, 72-73, 75-76, 78-84, 86-96
Generated in workflow #89

@github-actions
Copy link

github-actions bot commented Oct 13, 2025

PR Preview Action v1.6.2

🚀 View preview at
https://AllenCell.github.io/cellpack-client/pr-preview/pr-110/

Built to branch gh-pages at 2025-10-15 17:48 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@rugeli rugeli requested review from ascibisz and mogres October 13, 2025 22:24
Copy link

@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 great!! Tested a golgi-endosome recipe on the preview site and it packed as expected!

const storeMin = opt.strength_min ?? 0;
const storeMax = opt.strength_max ?? 0.99;
const storeMin = opt.strength_min ?? 0.01;
const storeMax = opt.strength_max ?? 100;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: since we just defined MAX_GRADIENT_STRENGTH = 100, should we use that here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

great catch! Updating it now

@ascibisz
Copy link
Contributor

ascibisz commented Oct 15, 2025

I'm noticing that the UI only allows you to input certain values, most notably that you can't input anything (via slider or the number input) between 50 and 100. It's kinda weird, and I think that's a bug worth fixing before we merge.

I believe this is because we're clamping precision to 2 decimal points, so we can't have anything for decay_length in the store between 0.01 and 0.02, which translates in the UI to 100 and 50

@rugeli
Copy link
Contributor Author

rugeli commented Oct 15, 2025

I'm noticing that the UI only allows you to input certain values, most notably that you can't input anything (via slider or the number input) between 50 and 100. It's kinda weird, and I think that's a bug worth fixing before we merge.

I believe this is because we're clamping precision to 2 decimal points, so we can't have anything for decay_length in the store between 0.01 and 0.02, which translates in the UI to 100 and 50

ah I see! just updated it to store values with 4 decimals while keeping the UI display at 2 decimals, so the gap 50-100 is not a dead zone anymore. Thanks for testing!
(nvm more bugs here, I'll request you for round 2 review when it's ready)

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.

Update mapping from gradient strength input to decay_length recipe entry

3 participants