cleanup: move config to python code #45
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
removed dynamic configuration loader from yaml file (ssda903/fixtures/config/standard-v1.yaml) and moved it into python code.
Now, age brackets, placement categories and costs are all written in python, so everything is detectable by your IDE.
Also changed all the dataframe values to just have the "label" of the placement category or age bracket - that's the human readable value, which is easy to display in the web but still accessible programmatically, with the enum values.
@amynickolls just be aware that everytime you need to filter something use it like this:
Because:
PlacementCategories
is an enumPlacementCategories.NOT_IN_CARE
is an enum memberPlacementCategories.NOT_IN_CARE.name
is actually "NOT_IN_CARE", the enum member namePlacementCategories.NOT_IN_CARE.value
is an instance of the dataclassPlacementCategory
with it's label "Not in care"PlacementCategories.NOT_IN_CARE.value.label
is the name of thisPlacementCategory
instance, so in this case "Not in care"There's examples in the docstrings of PlacementCategories and AgeBrackets.
I hope now it's more clear!!