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

User curve model #1529

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

User curve model #1529

wants to merge 5 commits into from

Conversation

louispt1
Copy link
Contributor

@louispt1 louispt1 commented Mar 26, 2025

This PR:

  • Adds a migration to introduce the user curve schema
  • Introduces the user curve model and associates it with a scenario
  • Ports curve and metadata methods from the ScenarioAttachment model to the UserCurve model
  • Introduces MeritCurveSerializer to serialize/deserialize curves directly into and out of Merit::Curve objects
  • Introduces spec for the model and serializer
  • Adjusts attachment.curve method calls to refer instead to the UserCurves model
  • Refactors spec related to custom curves on scenario, inputs, custom curve collection

Note: I compared the size of user curves serialized this way vs the csv files and the MessagePacked versions are larger. Depending on the data, the CSV blobs tend to be around 50kb and the MessagePack blobs tend to be 70kb. Obviously there are other advantages such as speed of read/write and dealing with floating points more effectively, but I thought it would be worth noting that finding here!

Still to implement:

  • Changes to the custom curves controller (csv / json response), custom curve serializer and related spec and methods.
  • Attach / detach curve services.

Closes: #1519 and #1520 and #1518

@louispt1 louispt1 requested a review from noracato March 26, 2025 12:54
@louispt1 louispt1 marked this pull request as draft March 26, 2025 16:13
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 new model UserCurve
1 participant