Skip to content
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

wtw node's treat_current_input method can produce a division by 0 #64

Open
RobinMaesPrior opened this issue Feb 1, 2024 · 0 comments
Open

Comments

@RobinMaesPrior
Copy link
Collaborator

RobinMaesPrior commented Feb 1, 2024

Suggested work around is:

denominator = self.liquor["volume"] + influent["volume"] * self.liquor_multiplier["volume"]
if denominator != 0:
    self.liquor[key] = (
        self.liquor[key] * self.liquor["volume"]
        + influent[key] * influent["volume"] * self.liquor_multiplier["volume"]
    ) / denominator
else:
    # Handle the case where the denominator is zero
    self.liquor[key] = 0  # or some other default value
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

No branches or pull requests

1 participant