Skip to content

Commit 4dd6a69

Browse files
committed
Remove QuickCharts from documentation and test data
1 parent e016c17 commit 4dd6a69

File tree

8 files changed

+524
-183
lines changed

8 files changed

+524
-183
lines changed

documentation/index.md

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ upload your datasets to HDX.
2929
- [Organization](#organization)
3030
- [Custom Visualization](#custom-visualization)
3131
- [Resource Generation](#resource-generation)
32-
- [QuickCharts Generation](#quickcharts-generation)
3332
- [Resource Specific Operations](#resource-specific-operations)
3433
- [Showcase Management](#showcase-management)
3534
- [User Management](#user-management)
@@ -871,38 +870,6 @@ The rest of the arguments are the same as for `generate_resource`.
871870
RESOURCE_DATA, HEADER_INSERTIONS, ROW_FUNCTION,
872871
DATECOL or YEARCOL or DATE_FUNCTION, **KWARGS)
873872

874-
### QuickCharts Generation
875-
876-
QuickCharts can be generated for datasets using the call below. RESOURCE is a
877-
a resource id or name, or resource metadata from a Resource object or a
878-
dictionary, or the position of the resource in the dataset. It defaults to the
879-
position 0. PATH points to configuration which if not supplied, defaults to the
880-
internal indicators resource view template. You can disable specific bites by
881-
providing BITES_DISABLED, a list of 3 bools where True indicates a specific bite
882-
is disabled and False indicates leave enabled.
883-
884-
datasets.generate_quickcharts(RESOURCE, "PATH", BITES_DISABLED, INDICATORS,
885-
FIND_REPLACE)
886-
887-
The parameter INDICATORS is only for use with the built-in configuration and is
888-
a list with 3 dictionaries of form:
889-
890-
{"code": "MY_INDICATOR_CODE", "title": "MY_INDICATOR_TITLE",
891-
"unit": "MY_INDICATOR_UNIT"}.
892-
893-
Optionally, the following defaults can be overridden in INDICATORS:
894-
895-
{"code_col": "#indicator+code", "value_col": "#indicator+value+num",
896-
"date_col": "#date+year", "date_format": "%Y", "aggregate_col": "null"}.
897-
898-
The built-in configuration assumes data will be of form similar to below:
899-
900-
GHO (CODE),ENDYEAR,Numeric
901-
#indicator+code,#date+year+end,#indicator+value+num
902-
VIOLENCE_HOMICIDERATE,1994,123.4
903-
MDG_0000000001,2015,123.4
904-
905-
906873
## Resource Specific Operations
907874

908875
When creating or updating a resource that doesn't have an id, if you supply a parameter

tests/fixtures/update_dataset_resources/expected_resources_to_update.json

Lines changed: 83 additions & 85 deletions
Large diffs are not rendered by default.

tests/fixtures/update_dataset_resources/unesco_dataset.json

Lines changed: 326 additions & 1 deletion
Large diffs are not rendered by default.

tests/fixtures/update_dataset_resources/unesco_update_dataset.json

Lines changed: 106 additions & 1 deletion
Large diffs are not rendered by default.

tests/fixtures/update_logic/update_logic_resources.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,6 @@
192192
for Zambia, description: "*Neglected Tropical Diseases:*\n[Number of new leprosy\
193193
\ cases](https://w", format: CSV, url: https://stage.data-humdata-org.ahconu.org/dataset/3adc4bb0-faef-42ae-bd67-0ea08918a629/resource/12fdb6cb-5e00-45b5-a6b5-611847866440/download/neglected-tropical-diseases_indicators_zmb.csv,
194194
url_type: upload, resource_type: file.upload}
195-
- {id: ad2d521e-3a0e-451e-977c-bcbf125cec55, name: QuickCharts Indicators for Zambia,
196-
description: Cut down data for QuickCharts, format: CSV, url: https://stage.data-humdata-org.ahconu.org/dataset/3adc4bb0-faef-42ae-bd67-0ea08918a629/resource/ad2d521e-3a0e-451e-977c-bcbf125cec55/download/qc_health_indicators_zmb.csv,
197-
url_type: upload, resource_type: file.upload}
198195
- {id: 19caff60-fd38-42b4-a17a-63abfaf0911e, name: TOBACCO Indicators for Zambia,
199196
description: "*TOBACCO:*\n[Monitor](https://www.who.int/data/gho/indicator-metadata-r",
200197
format: CSV, url: https://stage.data-humdata-org.ahconu.org/dataset/3adc4bb0-faef-42ae-bd67-0ea08918a629/resource/19caff60-fd38-42b4-a17a-63abfaf0911e/download/tobacco_indicators_zmb.csv,

tests/fixtures/update_logic/update_logic_resources_new.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,3 @@
211211
\ vitamin A deficiency in preschool-age children (s", format: csv, url_type: upload,
212212
resource_type: file.upload}
213213
file_to_upload: /tmp/WHO/nlis_indicators_ZMB.csv
214-
- resource: {name: QuickCharts Indicators for Zambia, description: Cut down data for
215-
QuickCharts, format: csv, url_type: upload, resource_type: file.upload}
216-
file_to_upload: /tmp/WHO/qc_health_indicators_ZMB.csv

tests/hdx/data/test_update_dataset_resources.py

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ class TestUpdateDatasetResourcesLogic:
2222
"Other Policy Relevant Indicators metadata": "opri_metadata_zwe.csv",
2323
"Demographic and Socio-economic data": "dem_data_zwe.csv",
2424
"Demographic and Socio-economic indicator list": "dem_indicatorlist_zwe.csv",
25-
"QuickCharts-SDG 4 Global and Thematic data": "qc_sdg_data_zwe.csv",
2625
}
2726

2827
@pytest.fixture(scope="function")
@@ -109,17 +108,15 @@ def test_dataset_update_resources(
109108
statuses,
110109
) = dataset._dataset_update_resources(True, True, True, True)
111110
assert resources_to_update == expected_resources_to_update
112-
assert resources_to_delete == [8, 2, 1, 0]
111+
assert resources_to_delete == [6, 2, 1, 0]
113112
assert filestore_resources == {
114113
3: fixture_path / "sdg_data_zwe.csv",
115114
4: fixture_path / "sdg_indicatorlist_zwe.csv",
116115
5: fixture_path / "sdg_metadata_zwe.csv",
117-
6: fixture_path / "dem_data_zwe.csv",
118116
7: fixture_path / "dem_indicatorlist_zwe.csv",
119-
9: fixture_path / "opri_data_zwe.csv",
120-
10: fixture_path / "opri_indicatorlist_zwe.csv",
121-
11: fixture_path / "opri_metadata_zwe.csv",
122-
12: fixture_path / "qc_sdg_data_zwe.csv",
117+
8: fixture_path / "opri_data_zwe.csv",
118+
9: fixture_path / "opri_indicatorlist_zwe.csv",
119+
10: fixture_path / "opri_metadata_zwe.csv",
123120
}
124121
assert new_resource_order == [
125122
("SDG 4 Global and Thematic data", "csv"),
@@ -128,17 +125,13 @@ def test_dataset_update_resources(
128125
("Other Policy Relevant Indicators data", "csv"),
129126
("Other Policy Relevant Indicators indicator list", "csv"),
130127
("Other Policy Relevant Indicators metadata", "csv"),
131-
("Demographic and Socio-economic data", "csv"),
132128
("Demographic and Socio-economic indicator list", "csv"),
133-
("QuickCharts-SDG 4 Global and Thematic data", "csv"),
134129
]
135130
assert statuses == {
136-
"Demographic and Socio-economic data": 2,
137131
"Demographic and Socio-economic indicator list": 2,
138132
"Other Policy Relevant Indicators data": 2,
139133
"Other Policy Relevant Indicators indicator list": 2,
140134
"Other Policy Relevant Indicators metadata": 2,
141-
"QuickCharts-SDG 4 Global and Thematic data": 2,
142135
"SDG 4 Global and Thematic data": 2,
143136
"SDG 4 Global and Thematic indicator list": 2,
144137
"SDG 4 Global and Thematic metadata": 2,
@@ -162,12 +155,10 @@ def test_dataset_update_resources(
162155
"update__resources__0__upload": fixture_path / "sdg_data_zwe.csv",
163156
"update__resources__1__upload": fixture_path / "sdg_indicatorlist_zwe.csv",
164157
"update__resources__2__upload": fixture_path / "sdg_metadata_zwe.csv",
165-
"update__resources__3__upload": fixture_path / "dem_data_zwe.csv",
166-
"update__resources__4__upload": fixture_path / "dem_indicatorlist_zwe.csv",
167-
"update__resources__5__upload": fixture_path / "opri_data_zwe.csv",
168-
"update__resources__6__upload": fixture_path / "opri_indicatorlist_zwe.csv",
169-
"update__resources__7__upload": fixture_path / "opri_metadata_zwe.csv",
170-
"update__resources__8__upload": fixture_path / "qc_sdg_data_zwe.csv",
158+
"update__resources__3__upload": fixture_path / "dem_indicatorlist_zwe.csv",
159+
"update__resources__4__upload": fixture_path / "opri_data_zwe.csv",
160+
"update__resources__5__upload": fixture_path / "opri_indicatorlist_zwe.csv",
161+
"update__resources__6__upload": fixture_path / "opri_metadata_zwe.csv",
171162
}
172163
resources = results["update"]["resources"]
173164
cutdown_resources = []
@@ -209,14 +200,6 @@ def test_dataset_update_resources(
209200
"url": "updated_by_file_upload_step",
210201
"url_type": "upload",
211202
},
212-
{
213-
"dataset_preview_enabled": "False",
214-
"format": "csv",
215-
"name": "Demographic and Socio-economic data",
216-
"resource_type": "file.upload",
217-
"url": "updated_by_file_upload_step",
218-
"url_type": "upload",
219-
},
220203
{
221204
"dataset_preview_enabled": "False",
222205
"format": "csv",
@@ -249,14 +232,6 @@ def test_dataset_update_resources(
249232
"url": "updated_by_file_upload_step",
250233
"url_type": "upload",
251234
},
252-
{
253-
"dataset_preview_enabled": "True",
254-
"format": "csv",
255-
"name": "QuickCharts-SDG 4 Global and Thematic data",
256-
"resource_type": "file.upload",
257-
"url": "updated_by_file_upload_step",
258-
"url_type": "upload",
259-
},
260235
]
261236

262237
def test_dataset_update_resources_position(

tests/hdx/data/test_update_logic.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ def check_resources(update, results):
149149
name,
150150
{
151151
"all_health": "health",
152-
"quickcharts": "qc_health",
153152
"for_zambia": "ZMB.csv",
154153
},
155154
)
@@ -216,7 +215,6 @@ def test_update_logic_1(
216215
"Noncommunicable diseases and mental health Indicators for Zambia": 2,
217216
"Nutrition Indicators for Zambia": 2,
218217
"Public health and environment Indicators for Zambia": 2,
219-
"QuickCharts Indicators for Zambia": 2,
220218
"RSUD: GOVERNANCE, POLICY AND FINANCING : PREVENTION Indicators for Zambia": 2,
221219
"RSUD: GOVERNANCE, POLICY AND FINANCING: FINANCING Indicators for Zambia": 2,
222220
"RSUD: GOVERNANCE, POLICY AND FINANCING: TREATMENT Indicators for Zambia": 2,
@@ -792,16 +790,6 @@ def test_update_logic_1(
792790
"url": "updated_by_file_upload_step",
793791
"url_type": "upload",
794792
},
795-
{
796-
"description": "Cut down data for QuickCharts",
797-
"format": "csv",
798-
"hash": "d82c8d1619ad8176d665453cfb2e55f0",
799-
"name": "QuickCharts Indicators for Zambia",
800-
"resource_type": "file.upload",
801-
"size": 2,
802-
"url": "updated_by_file_upload_step",
803-
"url_type": "upload",
804-
},
805793
{
806794
"description": "*TOBACCO:*\n"
807795
"[Monitor](https://www.who.int/data/gho/indicator-metadata-r",
@@ -936,7 +924,6 @@ def test_update_logic_2(
936924
"Noncommunicable diseases and mental health Indicators for Zambia": 2,
937925
"Nutrition Indicators for Zambia": 2,
938926
"Public health and environment Indicators for Zambia": 2,
939-
"QuickCharts Indicators for Zambia": 2,
940927
"RSUD: GOVERNANCE, POLICY AND FINANCING : PREVENTION Indicators for Zambia": 2,
941928
"RSUD: GOVERNANCE, POLICY AND FINANCING: FINANCING Indicators for Zambia": 2,
942929
"RSUD: GOVERNANCE, POLICY AND FINANCING: TREATMENT Indicators for Zambia": 2,
@@ -960,7 +947,7 @@ def test_update_logic_2(
960947
"Urban health Indicators for Zambia": 2,
961948
"World Health Statistics Indicators for Zambia": 2,
962949
}
963-
assert results["filter"] == ["-resources__53"]
950+
assert results["filter"] == ["-resources__52"]
964951
update = results["update"]
965952
del update["updated_by_script"]
966953
assert update == {
@@ -1525,16 +1512,6 @@ def test_update_logic_2(
15251512
"url": "updated_by_file_upload_step",
15261513
"url_type": "upload",
15271514
},
1528-
{
1529-
"description": "Cut down data for QuickCharts",
1530-
"format": "csv",
1531-
"hash": "d82c8d1619ad8176d665453cfb2e55f0",
1532-
"name": "QuickCharts Indicators for Zambia",
1533-
"resource_type": "file.upload",
1534-
"size": 2,
1535-
"url": "updated_by_file_upload_step",
1536-
"url_type": "upload",
1537-
},
15381515
{
15391516
"description": "*TOBACCO:*\n"
15401517
"[Monitor](https://www.who.int/data/gho/indicator-metadata-r",

0 commit comments

Comments
 (0)