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

Policy Generator tool, first pass #365

Conversation

ahouseholder
Copy link
Contributor

@ahouseholder ahouseholder commented Oct 31, 2023

This PR contains a python class that generates an SSVC decision policy (aka a "tree") that fully enumerates a set of decision points and their values, and assigns an outcome to each input value tuple. It does so by

  • constructing a partial order over all the input value tuples
  • generating a topological sort over the resulting partial order
  • assigning outcomes according to a set of provided weights
  • emitting a CSV that replicates the format we've previously used to represent decision policies
  • (one column for each decision point, plus an outcome column filled in with the assignments made)

If you run policy_generator.py directly, it outputs a policy that's rather close to the Deployer 2.1 tree.

At this point, my goal is to get the module in place with this PR.

We will need to figure out what the UI is for it, and how to make it easier to use. Right now, you have to write python code to use it, an example of which is provided in ssvc.policy_generator.main, but it can probably be made easier to use. One usability issue I can see coming soon is how someone figures out which decision point (and version) to use as input, and how they represent their outcome set. My preference would be to create a separate issue to come back to the CLI side of this tool in the future. For now, I think it's usable enough for someone comfortable with some light coding-by-example, such as a Jupyter notebook user. I created a separate issue to capture the UI followup task (#366) .

One notable addition in this PR is the creation of src/ssvc/outcomes/base.py, which contains a python representation of an OutcomeGroup and OutcomeValues, and src/ssvc/outcomes/groups.py which provides a variety of examples thereof. I think we discussed not versioning outcome sets (I called them outcome groups which have outcome values here but if there's a preference to rename them simply outcomes with outcome values, that's an easy change to make.)

This PR

I included #337 and #335 because they were good exercise for building OutcomeGroup objects.

@ahouseholder ahouseholder added documentation Improvements or additions to documentation enhancement New feature or request tools Software Tools labels Oct 31, 2023
@ahouseholder ahouseholder self-assigned this Oct 31, 2023
@ahouseholder ahouseholder linked an issue Oct 31, 2023 that may be closed by this pull request
@ahouseholder ahouseholder mentioned this pull request Nov 8, 2023
1 task
Copy link
Collaborator

@j--- j--- left a comment

Choose a reason for hiding this comment

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

This looks like it has all the parts it needs. I didn't do independent runtime testing.

src/ssvc/policy_generator.py Show resolved Hide resolved
@ahouseholder ahouseholder merged commit 621ce0f into main Nov 9, 2023
1 check passed
@ahouseholder ahouseholder deleted the 336-tool-to-distribute-outcome-set-across-a-decision-point-group branch November 9, 2023 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request tools Software Tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MoSCoW outcome set Tool to distribute outcome set across a decision point group
2 participants