Skip to content

Improve calculate_score implementation - #21

Open
captureflow[bot] wants to merge 26 commits into
mainfrom
update-calculate_score-106a76bd89bc4339921e556a4a7c6a6f
Open

Improve calculate_score implementation#21
captureflow[bot] wants to merge 26 commits into
mainfrom
update-calculate_score-106a76bd89bc4339921e556a4a7c6a6f

Conversation

@captureflow

@captureflow captureflow Bot commented Apr 3, 2024

Copy link
Copy Markdown

This pull request updates the implementation of calculate_score to 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:27

    • Exception Type: ZeroDivisionError
    • Exception Value: float division by zero
  • Function: calculate_score at /Users/nikitakutc/projects/captureflow-py/clientside/examples/fastapi/utilz.py:28

    • Exception Type: ZeroDivisionError
    • Exception Value: float division by zero

Change Reasoning

The function needs to handle the case where the sum of past_amounts is zero. By checking if the denominator is zero before performing the division, we can avoid raising a ZeroDivisionError. If past_amounts is zero, we need to determine the appropriate behavior. As for now, let's return 0 as the score.

NickKuts and others added 26 commits March 27, 2024 17:13
…tions

Extend clientside/tracer to contain more exception frame data
Make clientside/examples/fastapi use more utility functions
Update clientside/examples with more realistic server
@NickKuts

NickKuts commented Apr 3, 2024

Copy link
Copy Markdown
Contributor

Good job robot, we will have to benchmark your abilities soon

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.

1 participant