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

Feat/489 refactor resilience curve and adjusting the calculation #502

Conversation

ArdtK
Copy link
Contributor

@ArdtK ArdtK commented Jun 27, 2024

Issue addressed

Solves #489

Code of conduct

  • I HAVE NOT added sensitive or compromised (test) data to the repository.
  • I HAVE NOT added vulnerabilities to the repository.
  • I HAVE discussed my solution with (other) members of the RA2CE team.

What has been done?

A subpackage with dataclass and related reader is created for resilience_curve.
Losses_base is adjusted to using this new subpackage.
The new dataclass is used to extract the right data for the loss per capita calculation

Checklist

  • Code is formatted using our custom black and isort definitions.
  • Tests are either added or updated.
  • Branch is up to date with master.
  • Updated documentation if needed.

Additional Notes (optional)

N.A.

@ArdtK ArdtK linked an issue Jun 27, 2024 that may be closed by this pull request
2 tasks
@ArdtK ArdtK marked this pull request as draft June 27, 2024 09:14
@ArdtK ArdtK changed the title Feat/489 update the calculate production loss per capita of the losses module Feat/489 refactor resilience curve before adjusting the calculation Jun 27, 2024
@ArdtK ArdtK requested a review from Carsopre June 27, 2024 11:59
@ArdtK ArdtK marked this pull request as ready for review June 27, 2024 11:59
@ArdtK ArdtK changed the title Feat/489 refactor resilience curve before adjusting the calculation Feat/489 refactor resilience curve and adjusting the calculation Jul 2, 2024
Copy link
Collaborator

@Carsopre Carsopre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some remarks to process before merging is possible.

@ArdtK ArdtK mentioned this pull request Jul 2, 2024
7 tasks
Comment on lines +28 to +30
resilience_curves: dict[
tuple[RoadTypeEnum, tuple[float, float]], list[tuple[float, float]]
] = field(default_factory=dict)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although I like this approach slightly more I believe it could be simplified with just a specific class representing the tuple[RoadTypeEnum, tuple[float,float]

@Carsopre Carsopre merged commit a3677bf into master Jul 5, 2024
4 of 5 checks passed
@Carsopre Carsopre deleted the feat/489-update-the-_calculate_production_loss_per_capita-of-the-losses-module branch July 5, 2024 12:17
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.

Update the _calculate_production_loss_per_capita() of the Losses module
2 participants