I have $ x \in \{0,1\}$ and $y \geq 0$ and I want to model that $x=1$ iff $y>0$, is this possible while keeping the constraint linear? Thanks.
One part of the implication is easy $ y \leq Mx$. The other part I can approximate as $ \epsilon x \leq y $. Where $\epsilon$ is small and $M$ is big. But this doesn't work if $y$ is very small.
In practice, if $y$ is computed (as opposed to a parameter that is read in and never changed), the chances are high that you will get a nonzero value (possibly even negative) when it should be zero, due to rounding error. Constraints aside, you probably should set a tolerance value $\epsilon > 0$, small but not too small, and round $y$ to $0$ any time $|y|<\epsilon$. That will let you proceed as you proposed in your question.