diff --git a/src/BatchCodeTablePersister.py b/src/BatchCodeTablePersister.py index 15f7a1774f4..c11e9906ddf 100644 --- a/src/BatchCodeTablePersister.py +++ b/src/BatchCodeTablePersister.py @@ -2,19 +2,8 @@ from IOUtils import IOUtils import numpy as np -def createAndSaveBatchCodeTables( - minADRsForLethality, - batchCodeTableFactory, - onCountryProcessed = lambda country: None): - _createAndSaveBatchCodeTableForCountry( - createBatchCodeTableForCountry = lambda country: batchCodeTableFactory.createGlobalBatchCodeTable(), - country = 'Global', - minADRsForLethality = minADRsForLethality, - onCountryProcessed = onCountryProcessed) - - -def _createAndSaveBatchCodeTableForCountry(createBatchCodeTableForCountry, country, minADRsForLethality, onCountryProcessed): - batchCodeTable = createBatchCodeTableForCountry(country) +def createAndSaveGlobalBatchCodeTable(minADRsForLethality, batchCodeTableFactory): + batchCodeTable = batchCodeTableFactory.createGlobalBatchCodeTable() batchCodeTable.index.set_names("Batch", inplace=True) if minADRsForLethality is not None: batchCodeTable.loc[ @@ -33,7 +22,4 @@ def _createAndSaveBatchCodeTableForCountry(createBatchCodeTableForCountry, count 'Severe reports', 'Lethality' ]] - IOUtils.saveDataFrameAsJson( - batchCodeTable, - '../docs/data/batchCodeTables/' + country + '.json') - onCountryProcessed(country) + IOUtils.saveDataFrameAsJson(batchCodeTable, '../docs/data/batchCodeTables/Global.json') diff --git a/src/HowBadIsMyBatch.ipynb b/src/HowBadIsMyBatch.ipynb index 48c3afe51ff..0468ac010c2 100644 --- a/src/HowBadIsMyBatch.ipynb +++ b/src/HowBadIsMyBatch.ipynb @@ -18,7 +18,7 @@ "from DateProvider import DateProvider\n", "from InternationalVaersCovid19Provider import getInternationalVaersCovid19, get_international_VAERSVAX_VAERSSYMPTOMS_Covid19\n", "from BatchCodeTableHtmlUpdater import updateBatchCodeTableHtmlFile\n", - "from BatchCodeTablePersister import createAndSaveBatchCodeTables\n", + "from BatchCodeTablePersister import createAndSaveGlobalBatchCodeTable\n", "from SymptomByBatchcodeTableFactory import SymptomByBatchcodeTableFactory\n", "from HistogramFactoryAndPersister import createAndSaveGlobalHistograms\n", "from BatchCodeTableFactory import BatchCodeTableFactory" @@ -149,10 +149,9 @@ "metadata": {}, "outputs": [], "source": [ - "createAndSaveBatchCodeTables(\n", + "createAndSaveGlobalBatchCodeTable(\n", " minADRsForLethality = 100,\n", - " batchCodeTableFactory = BatchCodeTableFactory(internationalVaersCovid19),\n", - " onCountryProcessed = display)" + " batchCodeTableFactory = BatchCodeTableFactory(internationalVaersCovid19))" ] }, {