AJamesPhillips / DataCurator

DataCurator enables you to map and understand complex systems before helping you plan, communicate and navigate successful interventions in them.
https://DataCurator.org
8 stars 1 forks source link

Counterfactual applied to state_value is not used on state_value's target state component #244

Open AJamesPhillips opened 5 months ago

AJamesPhillips commented 5 months ago

Describe the bug

In the screenshot below the state_value component "Alternative state value for Some state no2", targets the state component "Some state no2". And the counterfactual component "Counterfactual of: Alternative state value for Some state no2" targets this state_value component. However the counterfactual state is not applied to the state component. Nor is it possible to target the state component directly as seen by "Counterfactual of: Some state no2" not having the option to set a counterfactual of the new values forced by the state_value component.

image

To Reproduce

Steps to reproduce the behavior, see this view or use the following components:

[
  {
    "id": "0f7085b0-0bac-4b42-a088-4674b3868a37",
    "created_at": "2023-10-01T23:18:48.510Z",
    "title": "Some state no2",
    "description": "",
    "type": "statev2",
    "values_and_prediction_sets": [
      {
        "id": "vps7ac8468e-330e-42e2-a4f5-d358b1e5a2f8",
        "created_at": "2024-04-09T20:03:12.493Z",
        "base_id": 1,
        "datetime": {},
        "entries": [
          {
            "id": "VAP6cbd318c-5aaa-4cd5-85e3-43edbaf05cc4",
            "explanation": "",
            "probability": 1,
            "conviction": 1,
            "value": "111",
            "description": "",
            "value_id": "b972e48e-cf1e-488f-b7a2-2e053e3ae98a",
            "relative_probability": 1
          },
          {
            "id": "VAP1eea1af5-b813-46d5-a4f0-621cbb5034fd",
            "explanation": "",
            "probability": 0,
            "conviction": 1,
            "value": "222",
            "description": "",
            "relative_probability": 0
          }
        ]
      }
    ],
    "label_ids": [],
    "modified_by_username": "ajp",
    "modified_at": "2024-04-09T20:04:31.726Z",
    "subtype": "number",
    "value_possibilities": {
      "b972e48e-cf1e-488f-b7a2-2e053e3ae98a": {
        "id": "b972e48e-cf1e-488f-b7a2-2e053e3ae98a",
        "value": "111",
        "description": "",
        "order": 0
      }
    },
    "base_id": 1
  },
  {
    "id": "ce2f13e6-10c9-48c9-874a-36d5fb2aed28",
    "created_at": "2024-04-09T20:03:28.018Z",
    "title": "",
    "description": "",
    "type": "counterfactualv2",
    "values_and_prediction_sets": [],
    "label_ids": [],
    "modified_by_username": "ajp",
    "modified_at": "2024-04-09T20:50:57.023Z",
    "target_wcomponent_id": "0f7085b0-0bac-4b42-a088-4674b3868a37",
    "target_VAP_set_id": "vps7ac8468e-330e-42e2-a4f5-d358b1e5a2f8",
    "target_VAP_id": "VAP1eea1af5-b813-46d5-a4f0-621cbb5034fd",
    "base_id": 1
  },
  {
    "id": "e162edf1-6768-4086-ad7a-19f25b420609",
    "created_at": "2023-10-01T23:18:59.717Z",
    "title": "Alternative [state value](https://datacurator.org/) for @@0f7085b0-0bac-4b42-a088-4674b3868a37 <auto generated/>",
    "description": "",
    "type": "state_value",
    "values_and_prediction_sets": [
      {
        "id": "vpsb3864d12-f6fb-44fa-8be0-919574f4fb53",
        "created_at": "2023-10-01T23:21:13.980Z",
        "base_id": 1,
        "datetime": {},
        "entries": [
          {
            "id": "VAPb9717023-50a7-436f-86e2-01eebce0fb02",
            "explanation": "",
            "probability": 1,
            "conviction": 1,
            "value": "123",
            "description": "",
            "value_id": "169f00ce-7096-4a81-b59e-77b30d0e1537",
            "relative_probability": 1
          },
          {
            "id": "VAPea078af5-9361-4513-80aa-9fbb0819d258",
            "explanation": "",
            "probability": 0,
            "conviction": 1,
            "value": "456",
            "description": "",
            "relative_probability": 0
          }
        ]
      }
    ],
    "label_ids": [],
    "modified_by_username": "ajp",
    "modified_at": "2024-04-09T20:04:43.126Z",
    "attribute_wcomponent_id": "0f7085b0-0bac-4b42-a088-4674b3868a37",
    "value_possibilities": {
      "169f00ce-7096-4a81-b59e-77b30d0e1537": {
        "id": "169f00ce-7096-4a81-b59e-77b30d0e1537",
        "value": "123",
        "description": "",
        "order": 0
      }
    },
    "base_id": 1
  },
  {
    "id": "8c7ae547-65db-4c7c-a7cc-044946cc672b",
    "created_at": "2024-04-09T20:04:04.252Z",
    "title": "Counterfactual of: Alternative [state value](https://datacurator.org/) for @@0f7085b0-0bac-4b42-a088-4674b3868a37 <auto generated/>",
    "description": "",
    "type": "counterfactualv2",
    "values_and_prediction_sets": [],
    "label_ids": [],
    "modified_by_username": "ajp",
    "modified_at": "2024-04-09T20:48:32.120Z",
    "target_wcomponent_id": "e162edf1-6768-4086-ad7a-19f25b420609",
    "target_VAP_set_id": "vpsb3864d12-f6fb-44fa-8be0-919574f4fb53",
    "target_VAP_id": "VAPea078af5-9361-4513-80aa-9fbb0819d258",
    "base_id": 1
  }
]

Expected behavior

The counterfactual of "Counterfactual of: Alternative state value for Some state no2" is correctly applied to state_value component "Alternative state value for Some state no2" and this should then be applied to the state component "Some state no2".