Skip to content

Test and DRY functions that prepare representions of sets of values and probabilities (VAP sets) for UI #243

@AJamesPhillips

Description

@AJamesPhillips

Currently

  • There are three main locations where the VAP set values are displayed in the UI:
    1. location 1: in the node view (value_and_prediction_summary) the "present" VAP set is shown (based on sim and created datetimes)
    2. location 2: on the component form under the component title the "present" VAP set is shown (based on sim and created datetimes)
    3. location 3: in the component form under "Value Predictions" a summary of each VAP set is shown
2024-03-15 VAP set value representations image 1
  • It is inefficient and harder to develop the code as there are multiple routes to achieve similar end results.

Description (acceptance criteria)

  • Having one test file that tests how a state wcomponent's VAP sets are prepared for presentation in the different locations of the UI.
  • The tests should include when a counterfactual is applied and when a state_value is in effect.
  • Refactor to the underlying code to use a DRYer set of functions to prepare this state.
  • Fix the current linting errors

Why (hypothesis)

Alternatives you've considered

None.

Additional context

Whilst trying to implement #241 it became apparent that invalid numbers where not being presented in an intelligible or consistent way #242 and that to implement #241 and #242 it would be easier if there was one function to extract state values from wcomponents or a specific VAP set, with or without counterfactuals already applied to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions