Skip to content

Update givpower calculation - #55

Merged
alireza-sharifpour merged 8 commits into
stagingfrom
update-givpower-calculation
Sep 6, 2025
Merged

Update givpower calculation#55
alireza-sharifpour merged 8 commits into
stagingfrom
update-givpower-calculation

Conversation

@alireza-sharifpour

Copy link
Copy Markdown
Member

No description provided.

- Deleted the GET_TOP_POWER_RANK_QUERY as it is no longer needed for GIVpower scoring normalization.
- Deleted the getTopPowerRank method as it is no longer necessary for GIVpower scoring normalization, following recent updates to scoring calculations.
- Deleted the getTopPowerRank method and the GET_TOP_POWER_RANK_QUERY as they are no longer necessary for GIVpower scoring normalization, streamlining the ImpactGraphService.
- Revised comments in ScoringInputDto to enhance clarity regarding the highest power rank value for normalization, specifying behavior when null or undefined.
…d improved logging

- Added checks to prevent division by zero in scoring calculations, returning 0 and logging warnings for invalid decay days and minimum posts thresholds.
- Improved logging for GIVpower rank score calculations, including input values and results for better debugging.
- Updated the getDaysSince method to return 0 for future dates, ensuring accurate decay calculations.
- Modified evaluateProjects method to accept projects with power data and highestPowerRank, enhancing flexibility in project evaluations.
- Improved logging to include project power data and evaluation details for better debugging.
- Removed the need to fetch top power rank, streamlining the evaluation process and reducing unnecessary queries.
- Updated related methods to ensure consistent handling of power rank values across evaluations.
- Introduced ProjectWithPowerDto to encapsulate project ID and optional power metrics.
- Updated EvaluateProjectsRequestDto to accept an array of ProjectWithPowerDto, enhancing the structure for project evaluations.
…werRank

- Added highestPowerRank property to EvaluateMultipleCausesRequestDto, allowing for optional inclusion of a numeric power rank in evaluation requests.
- Enhanced validation with IsOptional and IsNumber decorators to ensure proper handling of the new property.
@alireza-sharifpour
alireza-sharifpour merged commit db0d4ba into staging Sep 6, 2025
3 checks passed
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