Update phase/compute.py
Browse filesmodified PCI description to be dynamic
- phase/compute.py +16 -7
phase/compute.py
CHANGED
|
@@ -45,21 +45,30 @@ class ParticipationAdoptionIndex:
|
|
| 45 |
|
| 46 |
# ----- percent-based values -----
|
| 47 |
final_pcr = round(pcr * 100, 2)
|
|
|
|
|
|
|
| 48 |
final_peg = round(peg * 100, 2)
|
| 49 |
-
final_pci = round(pci
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
self.components_1 = {
|
| 52 |
-
"PCR (Participation Coverage Ratio)": {"Value": final_pcr, "Description": "
|
| 53 |
-
"SPI-A (Silent Participation Inference - Silent Non-Adoption)": {"Value":
|
| 54 |
-
"SPI-B (Silent Participation Inference - Silent Adoption)": {"Value":
|
| 55 |
-
"PEG (Participation-to-Expression Gap)": {"Value": final_peg, "Description": "
|
| 56 |
}
|
| 57 |
|
| 58 |
self.components_2 = {
|
| 59 |
"PCI (Participation Concentration Index)":
|
| 60 |
{"Value": final_pci,
|
| 61 |
-
"Description":
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
| 63 |
"Group Summary":
|
| 64 |
{"Minimum Participating Groups": f"At least {effective_groups_int} groups meaningfully participated.",
|
| 65 |
"Effective Participation Groups": f"Participation is roughly equivalent to {effective_groups_rounded} equally sized groups."
|
|
|
|
| 45 |
|
| 46 |
# ----- percent-based values -----
|
| 47 |
final_pcr = round(pcr * 100, 2)
|
| 48 |
+
final_spi_a = round(spi_a * 100, 2)
|
| 49 |
+
final_spi_b = round(spi_b * 100, 2)
|
| 50 |
final_peg = round(peg * 100, 2)
|
| 51 |
+
final_pci = round(pci, 2)
|
| 52 |
+
|
| 53 |
+
# ----- pci pivot value -----
|
| 54 |
+
pic_mid = 0.5
|
| 55 |
+
# ---------------------------
|
| 56 |
|
| 57 |
self.components_1 = {
|
| 58 |
+
"PCR (Participation Coverage Ratio)": {"Value": final_pcr, "Description": f"{final_pcr}% of the target population has participated."},
|
| 59 |
+
"SPI-A (Silent Participation Inference - Silent Non-Adoption)": {"Value": final_spi_a, "Description": f"{final_spi_a}% of the target population were not reached or excluded."},
|
| 60 |
+
"SPI-B (Silent Participation Inference - Silent Adoption)": {"Value": final_spi_b, "Description": f"{final_spi_b}% of the target population has participated silently."},
|
| 61 |
+
"PEG (Participation-to-Expression Gap)": {"Value": final_peg, "Description": f"{final_peg}% of participants did not express feedback despite participating."}
|
| 62 |
}
|
| 63 |
|
| 64 |
self.components_2 = {
|
| 65 |
"PCI (Participation Concentration Index)":
|
| 66 |
{"Value": final_pci,
|
| 67 |
+
"Description": (
|
| 68 |
+
f"A PCI of {final_pci} suggests "
|
| 69 |
+
f"{'high' if final_pci >= pci_mid else 'low'} participation concentration, "
|
| 70 |
+
f"{'dominated by fewer groups' if final_pci >= pci_mid else 'with participation spread across groups'}."
|
| 71 |
+
),
|
| 72 |
"Group Summary":
|
| 73 |
{"Minimum Participating Groups": f"At least {effective_groups_int} groups meaningfully participated.",
|
| 74 |
"Effective Participation Groups": f"Participation is roughly equivalent to {effective_groups_rounded} equally sized groups."
|