Improve calculate_score implementation - #21
Open
captureflow[bot] wants to merge 26 commits into
Open
Conversation
…tions Extend clientside/tracer to contain more exception frame data
Reformatting: black&isort
Reformatting: black&isort
Add types to serverside/server.py
bump clientside pypi dist
Make clientside/examples/fastapi use more utility functions
Basic exception handling
Update README
Add README diagram and intro
Update READMEs
Update clientside/examples with more realistic server
Contributor
|
Good job robot, we will have to benchmark your abilities soon |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the implementation of
calculate_scoreto address the identified issues. Below is the context and reasoning behind these changes.Detailed Exception Context
Function: score_transaction at
/Users/nikitakutc/projects/captureflow-py/clientside/examples/fastapi/server.py:27Function: calculate_score at
/Users/nikitakutc/projects/captureflow-py/clientside/examples/fastapi/utilz.py:28Change Reasoning
The function needs to handle the case where the sum of
past_amountsis zero. By checking if the denominator is zero before performing the division, we can avoid raising aZeroDivisionError. Ifpast_amountsis zero, we need to determine the appropriate behavior. As for now, let's return 0 as the score.