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

Generator Constraints and Violation Messages #1559

Merged
merged 4 commits into from
Sep 13, 2024

Conversation

JoelCourtney
Copy link
Contributor

@JoelCourtney JoelCourtney commented Sep 12, 2024

  • Tickets addressed:
  • Review: By commit
  • Merge strategy: Merge (no squash)

Description

This adds the GeneratorConstraint abstract class, which is a helper class that enables a more imperative programing style in constraints. When writing goal I've found it pretty natural to switch from a functional style when getting and transforming inputs, to an imperative style when creating outputs. So I made a similar system for constraints where you can repeatedly call violate(Violation) or one of its derivatives instead of aggregating everything in a single Violations timeline.

This also adds the first step for support of violation messages, as in customizable strings that can explain the violation to the user in the UI, and can be different for each violation generated. This doesn't do anything with the messages, it just stores them in the Violation class.

Verification

I made a unit test to make sure the generator aggregates the results correctly.

Documentation

I wrote the docs after I made these changes; they are actually already live.

Future work

@JoelCourtney JoelCourtney added the constraints Anything related to the constraints domain label Sep 12, 2024
@JoelCourtney JoelCourtney self-assigned this Sep 12, 2024
@JoelCourtney JoelCourtney requested a review from a team as a code owner September 12, 2024 23:39
@JoelCourtney JoelCourtney requested review from mattdailis and removed request for jmdelfa September 12, 2024 23:41
Copy link
Collaborator

@mattdailis mattdailis left a comment

Choose a reason for hiding this comment

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

I like the new imperative interface - and also that it augments rather than replaces the functional one 💯

@JoelCourtney
Copy link
Contributor Author

Docs update at NASA-AMMOS/aerie-docs#187

@JoelCourtney JoelCourtney merged commit 9af4b3c into develop Sep 13, 2024
10 checks passed
@JoelCourtney JoelCourtney deleted the feature/generator-constraints branch September 13, 2024 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
constraints Anything related to the constraints domain
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants