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: 659 convert damage classes into dataclasses; add a reader for damage curves #656

Merged

Conversation

ArdtK
Copy link
Contributor

@ArdtK ArdtK commented Dec 12, 2024

Issue addressed

Solves #659

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?

  • Rename subpackage analysis\damages\damage to analysis\damages\damage_functions. Not having damages functions will fail not the initialization.
  • Split class ManualDamageFunctions into a dataclass and a reader.
  • Convert DamageFractionUniform and MaxDamage (renamed from MaxDamageByRoadTypeByLane) into dataclasses.
  • Adjust Damages to read the damage functions in the init.

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)

Add any additional notes or information that may be helpful.

@ArdtK ArdtK linked an issue Dec 12, 2024 that may be closed by this pull request
5 tasks
@ArdtK ArdtK linked an issue Dec 12, 2024 that may be closed by this pull request
@ArdtK ArdtK changed the title chore: rename subpackage and classes; add typehints feat: 654 convert damage classes into dataclasses; add a reader for damage curves Dec 12, 2024
@ArdtK ArdtK linked an issue Dec 12, 2024 that may be closed by this pull request
@ArdtK ArdtK changed the title feat: 654 convert damage classes into dataclasses; add a reader for damage curves feat: 659 convert damage classes into dataclasses; add a reader for damage curves Dec 12, 2024
@ArdtK ArdtK marked this pull request as ready for review December 12, 2024 17:10
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 need to be addressed prior to merge of this issue. Please have special attention to the comments made on ra2ce/analysis/damages/damage_functions/damage_function_road_type_lane.py

In addition, please ensure either the issue linked to this PR or its parent issue contain a description on why these changes are required.

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.

Two lesser remarks.

@ArdtK ArdtK merged commit 313fc99 into master Dec 13, 2024
1 of 2 checks passed
@ArdtK ArdtK deleted the feat/654-experiment-with-damages-and-losses-without-input-files branch December 13, 2024 13:37
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.

Create dataclass/reader for damage functions
2 participants