-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from open-contracting/red-flags
Red flags
- Loading branch information
Showing
15 changed files
with
11,604 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
{ | ||
"nbformat": 4, | ||
"nbformat_minor": 0, | ||
"metadata": { | ||
"colab": { | ||
"provenance": [], | ||
"toc_visible": true | ||
}, | ||
"kernelspec": { | ||
"name": "python3", | ||
"display_name": "Python 3" | ||
} | ||
}, | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"## Usability analysis" | ||
], | ||
"metadata": { | ||
"id": "s75VrpzLRNkx" | ||
} | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"Generate a list of the fields published:" | ||
], | ||
"metadata": { | ||
"id": "HTkFw9jajocD" | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"source": [ | ||
"fields_list = fields_table.iloc[:, 0].tolist()" | ||
], | ||
"metadata": { | ||
"id": "MgZ3TsCOjozN" | ||
}, | ||
"execution_count": null, | ||
"outputs": [] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"source": [ | ||
"indicators_dic = get_red_flags_dictionary(fields_list)\n", | ||
"result = redflags_checks(fields_list, indicators_dic)" | ||
], | ||
"metadata": { | ||
"id": "xrxFlHz9Hk48" | ||
}, | ||
"execution_count": null, | ||
"outputs": [] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"### Export results" | ||
], | ||
"metadata": { | ||
"id": "Fvej9yl_H5oE" | ||
} | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"#### Load use case indicators spreadsheet" | ||
], | ||
"metadata": { | ||
"id": "EBmaz2VRITHf" | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"outputs": [], | ||
"source": [ | ||
"result_final = check_red_flags_indicators(result)" | ||
], | ||
"metadata": { | ||
"collapsed": false | ||
} | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"#### Table of results" | ||
], | ||
"metadata": { | ||
"id": "sbcQgxItIodv" | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"source": [ | ||
"result_final" | ||
], | ||
"metadata": { | ||
"id": "hMJH_IpAIm9V" | ||
}, | ||
"execution_count": null, | ||
"outputs": [] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"#### Results summary" | ||
], | ||
"metadata": { | ||
"collapsed": false | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"outputs": [], | ||
"source": [ | ||
"table = result_final.groupby(\"calculation\").agg(total_red_flags=(\"R_id\", \"count\")).reset_index()\n", | ||
"table[\"%\"] = round(table[\"total_red_flags\"] / table[\"total_red_flags\"].sum() * 100, 1)\n", | ||
"table" | ||
], | ||
"metadata": { | ||
"collapsed": false | ||
} | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"#### Most common fields to indicators" | ||
], | ||
"metadata": { | ||
"collapsed": false | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"outputs": [], | ||
"source": [ | ||
"common_fields = most_common_fields_to_calculate_indicators(indicators_dic, fields_table)\n", | ||
"common_fields" | ||
], | ||
"metadata": { | ||
"collapsed": false | ||
} | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"#### Save the table to a spreadsheet" | ||
], | ||
"metadata": { | ||
"id": "3001zqj9IxHF" | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"source": [ | ||
"set_spreadsheet_name(\"Red Flags\")\n", | ||
"save_dataframe_to_sheet(result_final, \"red_flags_table\")\n", | ||
"save_dataframe_to_sheet(common_fields, \"common_fields_table\")\n", | ||
"save_dataframe_to_sheet(fields_table, \"fields_list\")" | ||
], | ||
"metadata": { | ||
"id": "Qxb5b7wsI0GM" | ||
}, | ||
"execution_count": null, | ||
"outputs": [] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
{ | ||
"nbformat": 4, | ||
"nbformat_minor": 0, | ||
"metadata": { | ||
"colab": { | ||
"provenance": [], | ||
"toc_visible": true | ||
}, | ||
"kernelspec": { | ||
"name": "python3", | ||
"display_name": "Python 3" | ||
} | ||
}, | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"## Usability analysis" | ||
], | ||
"metadata": { | ||
"id": "s75VrpzLRNkx" | ||
} | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"Generate a list of the fields published:" | ||
], | ||
"metadata": { | ||
"id": "HTkFw9jajocD" | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"source": [ | ||
"fields_list = fields_table.iloc[:, 0].tolist()" | ||
], | ||
"metadata": { | ||
"id": "MgZ3TsCOjozN" | ||
}, | ||
"execution_count": null, | ||
"outputs": [] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"source": [ | ||
"indicators_dict = get_red_flags_dictionary(fields_list)\n", | ||
"result = redflags_checks(fields_list, indicators_dict, check_coverage=True)\n", | ||
"result[\"coverage\"] = get_coverage(indicators_dic)" | ||
], | ||
"metadata": { | ||
"id": "xrxFlHz9Hk48" | ||
}, | ||
"execution_count": null, | ||
"outputs": [] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"### Export and visualize results" | ||
], | ||
"metadata": { | ||
"id": "Fvej9yl_H5oE" | ||
} | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"#### Load use case indicators spreadsheet" | ||
], | ||
"metadata": { | ||
"id": "EBmaz2VRITHf" | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"outputs": [], | ||
"source": [ | ||
"result_final = check_red_flags_indicators(result)" | ||
], | ||
"metadata": { | ||
"collapsed": false | ||
} | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"#### Table of results" | ||
], | ||
"metadata": { | ||
"id": "sbcQgxItIodv" | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"source": [ | ||
"result_final" | ||
], | ||
"metadata": { | ||
"id": "hMJH_IpAIm9V" | ||
}, | ||
"execution_count": null, | ||
"outputs": [] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"#### Most common fields for indicators" | ||
], | ||
"metadata": { | ||
"id": "LXRG5Di4JTC6" | ||
} | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"This table shows the most frequent fields used to calculate indicators and if they are published. You can use this table to highlight to the publisher the key data gaps. " | ||
], | ||
"metadata": { | ||
"id": "dU4jyCZyJaqx" | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"source": [ | ||
"fields_count = most_common_fields_to_calculate_indicators(indicators_dict, fields_table)\n", | ||
"fields_count" | ||
], | ||
"metadata": { | ||
"id": "XZVErXpYJXxV" | ||
}, | ||
"execution_count": null, | ||
"outputs": [] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"#### Save tables to spreadsheet" | ||
], | ||
"metadata": { | ||
"id": "3001zqj9IxHF" | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"source": [ | ||
"save_dataframe_to_sheet(result_final, \"red flags table\")\n", | ||
"save_dataframe_to_sheet(fields_count, \"key fields\")" | ||
], | ||
"metadata": { | ||
"id": "Qxb5b7wsI0GM" | ||
}, | ||
"execution_count": null, | ||
"outputs": [] | ||
} | ||
] | ||
} |
Oops, something went wrong.