From b1d3ba033527276619cd0decba32fb62bcb65145 Mon Sep 17 00:00:00 2001 From: Simon <6615834+simon-20@users.noreply.github.com> Date: Wed, 8 Nov 2023 12:02:31 +0000 Subject: [PATCH 1/2] transaction calculations: fixes #9 --- iatiflattener/__init__.py | 50 +- iatiflattener/model.py | 74 +- .../artefacts/fcdo-transaction-flat.json | 2 +- .../tests/artefacts/fcdo-transaction.json | 2 +- .../artefacts/ifad-transaction-flat.json | 2 +- .../tests/artefacts/ifad-transaction.json | 2 +- .../tests/fixtures/beis-activity.xml | 6190 +++++++++++++++++ .../fixtures/finddiagnostics-activity.xml | 208 + iatiflattener/tests/fixtures/rates.csv | 6 +- .../{unops-at.xml => unops-at-activity.xml} | 0 iatiflattener/tests/test_csv.py | 47 +- iatiflattener/tests/test_transaction.py | 150 +- 12 files changed, 6678 insertions(+), 55 deletions(-) create mode 100644 iatiflattener/tests/fixtures/beis-activity.xml create mode 100644 iatiflattener/tests/fixtures/finddiagnostics-activity.xml rename iatiflattener/tests/fixtures/{unops-at.xml => unops-at-activity.xml} (100%) diff --git a/iatiflattener/__init__.py b/iatiflattener/__init__.py index 3cd3a6f..77f9bfa 100644 --- a/iatiflattener/__init__.py +++ b/iatiflattener/__init__.py @@ -81,17 +81,35 @@ def setup_organisations(self): def process_transaction(self, csvwriter, activity, transaction): + """Called once per element in IATI activity XML file to process the transaction + + :param activity: the parent element + :type activity: lxml.etree._Element + :param transaction: a element + :type transaction: lxml.etree._Element + """ + + # type(activity) is lxml.etree._Element; type(transaction) is lxml.etree._Element _transaction = model.Transaction(activity, transaction, self.activity_cache, - self.exchange_rates, self.countries_currencies, True, self.organisations, self.langs, - self.reporting_organisation_groups) + self.exchange_rates, self.countries_currencies, + True, self.organisations, self.langs, + self.reporting_organisation_groups) + + # the generate() method returns 'self' if successful, otherwise False; so on success, + # `generated` refers to the same object as `_transaction`. + # after `generate()` has been called, its `value_local` value is a dictionary indexed by country code, where + # each value--e.g., generated.value_local['AT']--is the value of the entire transaction in the currency of the + # country specified. generated = _transaction.generate() + if generated is not False: - _flat_transaction = model.FlatTransaction(_transaction, self.category_group).flatten() - for _part_flat_transaction in _flat_transaction: - transaction_csv = model.FlatTransactionBudgetCSV( - countries=self.countries, - csv_writer=csvwriter, - flat_transaction_budget=_part_flat_transaction).output() + _flat_transaction = model.FlatTransaction(_transaction, self.category_group) + _flattened_transaction = _flat_transaction.flatten() + for _part_flat_transaction in _flattened_transaction: + transaction_csv = model.FlatTransactionBudgetCSV(countries=self.countries, + csv_writer=csvwriter, + flat_transaction_budget=_part_flat_transaction) + transaction_csv.output() def process_activity_for_budgets(self, csvwriter, activity): @@ -121,7 +139,13 @@ def process_activity(self, csvwriter, activity): def process_package(self, publisher, package, root_dir): - """Read the activity elements from XML and write out flattened rows to transaction-NN.csv and budget-NN.csv""" + """Read the activity elements from XML and write out flattened rows to transaction-NN.csv and budget-NN.csv + + :param publisher: the publisher of the package being processed + :type publisher: str + :param package: the filename of the XML file (the package) to be processed + :type package: str + """ doc = etree.parse(os.path.join(root_dir, "{}".format(package))) if doc.getroot().get("version") not in ['2.01', '2.02', '2.03']: return @@ -130,15 +154,21 @@ def process_package(self, publisher, package, root_dir): activity_csvwriter = model.ActivityCSVFilesWriter(self.output_dir, headers=self.activity_csv_headers) activities = doc.xpath("//iati-activity") for activity in activities: + # type(activity) is lxml.etree._Element self.process_activity(activity_csvwriter, activity) activity_csvwriter.write() + # csvwriter is an instance of CSVFilesWriter; csvwriter.csvfiles is a dictionary indexed by country code + # which contains a CSV file handle for writing to the CSV ('file'), a csv writer object ('csv'), and a list + # rows, which is populated below with all the rows to be added to the CSV ('rows') csvwriter = model.CSVFilesWriter(budget_transaction='transaction', headers=self.csv_headers, output_dir=self.output_dir) + transactions = doc.xpath("//transaction") for transaction in transactions: + # transaction.getparent() gets the element self.process_transaction(csvwriter, transaction.getparent(), transaction) csvwriter.write() @@ -167,7 +197,7 @@ def run_for_publishers(self): try: if package.endswith(".xml"): self.process_package(publisher, package, - os.path.join(self.iatikitcache_dir, "data", publisher)) + os.path.join(self.iatikitcache_dir, "data", publisher)) except BdbQuit: raise except Exception as e: diff --git a/iatiflattener/model.py b/iatiflattener/model.py index 9ce4d12..843b747 100644 --- a/iatiflattener/model.py +++ b/iatiflattener/model.py @@ -50,8 +50,16 @@ def __init__(self, iati_identifier): setattr(self, field, None) -class ActivityCache(): +class ActivityCache: + """Keeps a cache of ActivityCacheActivity of objects""" + def get(self, iati_identifier): + """Gets (*or adds*) an ActivityCacheActivity from (to) the cache + + :param iati_identifier: activity identifier + :type iati_identifier: str + """ + activity = self.data.get(iati_identifier) if activity is None: self.data[iati_identifier] = ActivityCacheActivity(iati_identifier) @@ -122,9 +130,8 @@ def __init__(self, output_dir='output', headers=[]): self.csv_headers = headers -class FlatBudget(): - def make_flattened(self, country, sector, aid_type, - finance_type, flow_type, budget): +class FlatBudget: + def make_flattened(self, country, sector, aid_type, finance_type, flow_type, budget): for k, v in budget.items(): self.flat_budget[k] = v self.flat_budget['country_code'] = country.get('code') @@ -145,7 +152,9 @@ def make_flattened(self, country, sector, aid_type, self.flat_budget['value_eur'] = ( budget['value_eur'] * pct_adjustment ) - self.flat_budget['value_local'] = dict([(country, (value_local * pct_adjustment)) for country, value_local in self.flat_budget['value_local'].items()]) + + self.flat_budget['value_local'] = dict([(country, (value_local * pct_adjustment)) for \ + country, value_local in self.flat_budget['value_local'].items()]) return dict([(k, v) for k, v in self.flat_budget.items() if k not in ['countries', 'sectors']]) def flatten(self): @@ -183,8 +192,11 @@ def __init__(self, budget, sector_categories={}): self.flat_budget = self.budget_dict -class FlatTransactionBudgetCSV(): +class FlatTransactionBudgetCSV: + """Class takes a flattened transaction/budget obj, sets 'value_local' to value for current country, writes to CSV""" + def get_local_currency(self, country, flat_transaction_budget): + """Reduces the 'value_local' list to a single value for just the current country""" flat_transaction_budget['value_local'] = flat_transaction_budget['value_local'].get(country) return flat_transaction_budget @@ -192,9 +204,14 @@ def output(self): country = self.flat_transaction_budget['country_code'] if country in self.countries: self.csv_writer.append(country=country, - flat_transaction_budget=self.get_local_currency(country, self.flat_transaction_budget)) + flat_transaction_budget=self.get_local_currency(country, self.flat_transaction_budget)) def __init__(self, countries, csv_writer, flat_transaction_budget): + """ + + :param flat_transaction_budget: + :type flat_transaction_budget: dictionary + """ self.countries = countries self.csv_writer = csv_writer self.flat_transaction_budget = flat_transaction_budget @@ -213,25 +230,38 @@ def __init__(self, organisations, csv_writer, activity_data): self.activity_data = activity_data -class FlatTransaction(): +class FlatTransaction: def make_flattened(self, sector, country): + """ + :param sector: dictionary with sector code and percentage + :type sector: {'code':str, 'percentage': float} + :example: {'code': '32182', 'percentage': 72.0} + + :param country: dictionary with country code and percentage + :type country: {'country': str, 'percentage': float} + """ self.flat_transaction['country_code'] = country.get('code') self.flat_transaction['sector_code'] = sector.get('code') self.flat_transaction['sector_category'] = get_sector_category(sector.get('code'), self.sector_categories) sector_pct_adjustment = (country['percentage']/100) * (sector['percentage']/100) - self.flat_transaction['value_original'] = ( - self.transaction.value_original.value * sector_pct_adjustment - ) - self.flat_transaction['value_usd'] = ( - self.transaction.value_usd.value * sector_pct_adjustment - ) - self.flat_transaction['value_eur'] = ( - self.transaction.value_eur.value * sector_pct_adjustment - ) - self.flat_transaction['value_local'] = dict([(country, (value_local * sector_pct_adjustment)) for country, value_local in self.flat_transaction['value_local'].items()]) + + self.flat_transaction['value_original'] = (self.transaction.value_original.value * sector_pct_adjustment) + self.flat_transaction['value_usd'] = (self.transaction.value_usd.value * sector_pct_adjustment) + self.flat_transaction['value_eur'] = (self.transaction.value_eur.value * sector_pct_adjustment) + + # the `value_local` dict has the total value of the transaction listed in each country's local currency; this + # adjusts it according to proportion of total allocated to sector/country + self.flat_transaction['value_local'] = dict([(country, (value_local * sector_pct_adjustment)) for + country, value_local in self.transaction.value_local.value.items()]) + + # this returns a new dictionary which is self.flat_transaction but without 'countries' and 'sectors' return dict([(k, v) for k, v in self.flat_transaction.items() if k not in ['countries', 'sectors']]) def flatten(self): + """ + :return: + :rtype: generator + """ for sector in self.transaction.sectors.value: for country in self.transaction.countries.value: yield self.make_flattened(sector, country) @@ -271,9 +301,7 @@ def _values_local(self): for country in self.countries.value: currency_code = self.currencies.get(country.get('code')) try: - closest_exchange_rate = self.exchange_rates.closest_rate( - currency_code, self.value_date.value - ) + closest_exchange_rate = self.exchange_rates.closest_rate(currency_code, self.value_date.value) exchange_rate = closest_exchange_rate.get('conversion_rate') value = self.value_usd.value * exchange_rate out[country.get('code')] = value @@ -637,6 +665,8 @@ def generate(self): def __init__(self, activity, activity_cache, organisations_cache={}, langs=['en'], reporting_organisation_groups={}): + + # type(activity) = lxml.etree._Element self.activity = activity self.activity_cache = activity_cache.get( self._iati_identifier().value @@ -721,6 +751,8 @@ def generate(self): def __init__(self, activity, transaction, activity_cache, exchange_rates, currencies, limit_transaction_types=True, organisations_cache={}, langs=['en'], reporting_organisation_groups={}): + + # type(transaction) is lxml.etree._Element self.transaction = transaction self.activity = activity self.activity_cache = activity_cache.get( diff --git a/iatiflattener/tests/artefacts/fcdo-transaction-flat.json b/iatiflattener/tests/artefacts/fcdo-transaction-flat.json index 9a19f38..7417cb6 100644 --- a/iatiflattener/tests/artefacts/fcdo-transaction-flat.json +++ b/iatiflattener/tests/artefacts/fcdo-transaction-flat.json @@ -1 +1 @@ -{"iati_identifier": "GB-1-103662-101", "title#en": "PROCOFSERVICES and P0220 for Civil Ser. Cap. Bldng. Liberia", "reporting_org_group": null, "reporting_org#en": "Foreign, Commonwealth and Development Office [GB-GOV-1]", "reporting_org_type": "10", "multi_country": 0, "humanitarian": 0, "aid_type": "C01", "finance_type": "110", "flow_type": "10", "provider_org#en": "UK - Foreign, Commonwealth and Development Office (FCDO) [GB-GOV-1]", "provider_org_type": null, "receiver_org#en": "Adam Smith International [GB-COH-2732176]", "receiver_org_type": "70", "transaction_type": "3", "value_original": 1232.0, "currency_original": "GBP", "value_date": "2010-05-27", "transaction_date": "2010-05-27", "fiscal_year": 2010, "fiscal_quarter": "Q2", "fiscal_year_quarter": "2010 Q2", "exchange_rate": 0.726269155, "exchange_rate_date": "2021-08-31", "value_usd": 1696.3408008150918, "value_eur": 1433.446680400464, "value_local": {"LR": 0.0}, "url": "https://d-portal.org/q.html?aid=GB-1-103662-101", "country_code": "LR", "sector_code": "15110", "sector_category": ""} \ No newline at end of file +{"iati_identifier": "GB-1-103662-101", "title#en": "PROCOFSERVICES and P0220 for Civil Ser. Cap. Bldng. Liberia", "reporting_org_group": null, "reporting_org#en": "Foreign, Commonwealth and Development Office [GB-GOV-1]", "reporting_org_type": "10", "multi_country": 0, "humanitarian": 0, "aid_type": "C01", "finance_type": "110", "flow_type": "10", "provider_org#en": "UK - Foreign, Commonwealth and Development Office (FCDO) [GB-GOV-1]", "provider_org_type": null, "receiver_org#en": "Adam Smith International [GB-COH-2732176]", "receiver_org_type": "70", "transaction_type": "3", "value_original": 1232.0, "currency_original": "GBP", "value_date": "2010-05-27", "transaction_date": "2010-05-27", "fiscal_year": 2010, "fiscal_quarter": "Q2", "fiscal_year_quarter": "2010 Q2", "exchange_rate": 0.726269155, "exchange_rate_date": "2021-08-31", "value_usd": 1696.3408008150918, "value_eur": 1433.446680400464, "value_local": {"LR": 291426.5998257905}, "url": "https://d-portal.org/q.html?aid=GB-1-103662-101", "country_code": "LR", "sector_code": "15110", "sector_category": ""} \ No newline at end of file diff --git a/iatiflattener/tests/artefacts/fcdo-transaction.json b/iatiflattener/tests/artefacts/fcdo-transaction.json index 56dec48..97b547e 100644 --- a/iatiflattener/tests/artefacts/fcdo-transaction.json +++ b/iatiflattener/tests/artefacts/fcdo-transaction.json @@ -1 +1 @@ -{"iati_identifier": "GB-1-103662-101", "title": {"en": "PROCOFSERVICES and P0220 for Civil Ser. Cap. Bldng. Liberia"}, "reporting_org_group": null, "reporting_org": {"en": {"text": "Foreign, Commonwealth and Development Office", "type": "10", "ref": "GB-GOV-1", "display": "Foreign, Commonwealth and Development Office [GB-GOV-1]"}}, "reporting_org_type": "10", "countries": [{"percentage": 100.0, "code": "LR"}], "sectors": [{"percentage": 100.0, "code": "15110"}], "multi_country": 0, "humanitarian": 0, "aid_type": "C01", "finance_type": "110", "flow_type": "10", "provider_org": {"en": {"text": "UK - Foreign, Commonwealth and Development Office (FCDO)", "ref": "GB-GOV-1", "type": null, "display": "UK - Foreign, Commonwealth and Development Office (FCDO) [GB-GOV-1]"}}, "provider_org_type": null, "receiver_org": {"en": {"text": "Adam Smith International", "ref": "GB-COH-2732176", "type": "70", "display": "Adam Smith International [GB-COH-2732176]"}}, "receiver_org_type": "70", "transaction_type": "3", "value_original": 1232.0, "currency_original": "GBP", "value_date": "2010-05-27", "transaction_date": "2010-05-27", "fiscal_year": 2010, "fiscal_quarter": "Q2", "fiscal_year_quarter": "2010 Q2", "exchange_rate": 0.726269155, "exchange_rate_date": "2021-08-31", "value_usd": 1696.3408008150918, "value_eur": 1433.446680400464, "value_local": {"LR": 0.0}, "url": "https://d-portal.org/q.html?aid=GB-1-103662-101"} \ No newline at end of file +{"iati_identifier": "GB-1-103662-101", "title": {"en": "PROCOFSERVICES and P0220 for Civil Ser. Cap. Bldng. Liberia"}, "reporting_org_group": null, "reporting_org": {"en": {"text": "Foreign, Commonwealth and Development Office", "type": "10", "ref": "GB-GOV-1", "display": "Foreign, Commonwealth and Development Office [GB-GOV-1]"}}, "reporting_org_type": "10", "countries": [{"percentage": 100.0, "code": "LR"}], "sectors": [{"percentage": 100.0, "code": "15110"}], "multi_country": 0, "humanitarian": 0, "aid_type": "C01", "finance_type": "110", "flow_type": "10", "provider_org": {"en": {"text": "UK - Foreign, Commonwealth and Development Office (FCDO)", "ref": "GB-GOV-1", "type": null, "display": "UK - Foreign, Commonwealth and Development Office (FCDO) [GB-GOV-1]"}}, "provider_org_type": null, "receiver_org": {"en": {"text": "Adam Smith International", "ref": "GB-COH-2732176", "type": "70", "display": "Adam Smith International [GB-COH-2732176]"}}, "receiver_org_type": "70", "transaction_type": "3", "value_original": 1232.0, "currency_original": "GBP", "value_date": "2010-05-27", "transaction_date": "2010-05-27", "fiscal_year": 2010, "fiscal_quarter": "Q2", "fiscal_year_quarter": "2010 Q2", "exchange_rate": 0.726269155, "exchange_rate_date": "2021-08-31", "value_usd": 1696.3408008150918, "value_eur": 1433.446680400464, "value_local": {"LR": 291426.5998257905}, "url": "https://d-portal.org/q.html?aid=GB-1-103662-101"} \ No newline at end of file diff --git a/iatiflattener/tests/artefacts/ifad-transaction-flat.json b/iatiflattener/tests/artefacts/ifad-transaction-flat.json index b889368..7671f87 100644 --- a/iatiflattener/tests/artefacts/ifad-transaction-flat.json +++ b/iatiflattener/tests/artefacts/ifad-transaction-flat.json @@ -1 +1 @@ -{"iati_identifier": "XM-DAC-41108-1100001761", "title#en": "Rural Development: Tree Crops Extension Project", "reporting_org_group": null, "reporting_org#en": "International Fund for Agricultural Development [XM-DAC-41108]", "reporting_org_type": "40", "multi_country": 0, "humanitarian": 0, "aid_type": "C01", "finance_type": "421", "flow_type": "20", "provider_org#en": "International Fund for Agricultural Development [XM-DAC-41108]", "provider_org_type": "40", "receiver_org#en": null, "receiver_org_type": null, "transaction_type": "2", "value_original": 9480000.0, "currency_original": "XDR", "value_date": "2015-12-10", "transaction_date": "2015-12-10", "fiscal_year": 2015, "fiscal_quarter": "Q4", "fiscal_year_quarter": "2015 Q4", "exchange_rate": 0.702121, "exchange_rate_date": "2021-08-31", "value_usd": 13501946.245732574, "value_eur": 11409452.638049567, "value_local": {"LR": 0.0}, "url": "https://d-portal.org/q.html?aid=XM-DAC-41108-1100001761", "country_code": "LR", "sector_code": "", "sector_category": ""} \ No newline at end of file +{"iati_identifier": "XM-DAC-41108-1100001761", "title#en": "Rural Development: Tree Crops Extension Project", "reporting_org_group": null, "reporting_org#en": "International Fund for Agricultural Development [XM-DAC-41108]", "reporting_org_type": "40", "multi_country": 0, "humanitarian": 0, "aid_type": "C01", "finance_type": "421", "flow_type": "20", "provider_org#en": "International Fund for Agricultural Development [XM-DAC-41108]", "provider_org_type": "40", "receiver_org#en": null, "receiver_org_type": null, "transaction_type": "2", "value_original": 9480000.0, "currency_original": "XDR", "value_date": "2015-12-10", "transaction_date": "2015-12-10", "fiscal_year": 2015, "fiscal_quarter": "Q4", "fiscal_year_quarter": "2015 Q4", "exchange_rate": 0.702121, "exchange_rate_date": "2021-08-31", "value_usd": 13501946.245732574, "value_eur": 11409452.638049567, "value_local": {"LR": 2319596559.567368}, "url": "https://d-portal.org/q.html?aid=XM-DAC-41108-1100001761", "country_code": "LR", "sector_code": "", "sector_category": ""} \ No newline at end of file diff --git a/iatiflattener/tests/artefacts/ifad-transaction.json b/iatiflattener/tests/artefacts/ifad-transaction.json index d00fbef..1755c38 100644 --- a/iatiflattener/tests/artefacts/ifad-transaction.json +++ b/iatiflattener/tests/artefacts/ifad-transaction.json @@ -1 +1 @@ -{"iati_identifier": "XM-DAC-41108-1100001761", "title": {"en": "Rural Development: Tree Crops Extension Project"}, "reporting_org_group": null, "reporting_org": {"en": {"text": "International Fund for Agricultural Development", "type": "40", "ref": "XM-DAC-41108", "display": "International Fund for Agricultural Development [XM-DAC-41108]"}}, "reporting_org_type": "40", "countries": [{"percentage": 100.0, "code": "LR"}], "sectors": [{"percentage": 100.0, "code": ""}], "multi_country": 0, "humanitarian": 0, "aid_type": "C01", "finance_type": "421", "flow_type": "20", "provider_org": {"en": {"text": "International Fund for Agricultural Development", "ref": "XM-DAC-41108", "type": "40", "display": "International Fund for Agricultural Development [XM-DAC-41108]"}}, "provider_org_type": "40", "receiver_org": {"en": {"text": null, "ref": null, "type": null, "display": null}}, "receiver_org_type": null, "transaction_type": "2", "value_original": 9480000.0, "currency_original": "XDR", "value_date": "2015-12-10", "transaction_date": "2015-12-10", "fiscal_year": 2015, "fiscal_quarter": "Q4", "fiscal_year_quarter": "2015 Q4", "exchange_rate": 0.702121, "exchange_rate_date": "2021-08-31", "value_usd": 13501946.245732574, "value_eur": 11409452.638049567, "value_local": {"LR": 0.0}, "url": "https://d-portal.org/q.html?aid=XM-DAC-41108-1100001761"} \ No newline at end of file +{"iati_identifier": "XM-DAC-41108-1100001761", "title": {"en": "Rural Development: Tree Crops Extension Project"}, "reporting_org_group": null, "reporting_org": {"en": {"text": "International Fund for Agricultural Development", "type": "40", "ref": "XM-DAC-41108", "display": "International Fund for Agricultural Development [XM-DAC-41108]"}}, "reporting_org_type": "40", "countries": [{"percentage": 100.0, "code": "LR"}], "sectors": [{"percentage": 100.0, "code": ""}], "multi_country": 0, "humanitarian": 0, "aid_type": "C01", "finance_type": "421", "flow_type": "20", "provider_org": {"en": {"text": "International Fund for Agricultural Development", "ref": "XM-DAC-41108", "type": "40", "display": "International Fund for Agricultural Development [XM-DAC-41108]"}}, "provider_org_type": "40", "receiver_org": {"en": {"text": null, "ref": null, "type": null, "display": null}}, "receiver_org_type": null, "transaction_type": "2", "value_original": 9480000.0, "currency_original": "XDR", "value_date": "2015-12-10", "transaction_date": "2015-12-10", "fiscal_year": 2015, "fiscal_quarter": "Q4", "fiscal_year_quarter": "2015 Q4", "exchange_rate": 0.702121, "exchange_rate_date": "2021-08-31", "value_usd": 13501946.245732574, "value_eur": 11409452.638049567, "value_local": {"LR": 2319596559.567368}, "url": "https://d-portal.org/q.html?aid=XM-DAC-41108-1100001761"} \ No newline at end of file diff --git a/iatiflattener/tests/fixtures/beis-activity.xml b/iatiflattener/tests/fixtures/beis-activity.xml new file mode 100644 index 0000000..38f61db --- /dev/null +++ b/iatiflattener/tests/fixtures/beis-activity.xml @@ -0,0 +1,6190 @@ + + + + GB-GOV-13-GCRF-BF-7TNK9LD-GBYPTX3 + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + <narrative>SFC - GCRF QR funding</narrative> + + + Formula GCRF funding to the Scottish Funding Council to support Scottish higher education institutes (HEIs) to carry out ODA-eligible activities in line with their three-year institutional strategies. ODA research grants do not represent the full economic cost of research and therefore additional funding is provided to Scottish HEIs in proportion to their Research Excellence Grant (REG). In FY19/20 funding was allocated to 18 Scottish higher education institutes to support existing ODA grant funding and small projects. GCRF has now supported more than 800 projects at Scottish institutions, involving over 80 developing country partners. + + + This activity contributes to the aims and objectives of BEIS ODA Research and Innovation funds the Newton Fund and the Global Challenges Research Fund. They fund UK supported research and innovation to help people in low and middleincome countries. +This will: +• Help us to make progress towards UnitedNations’ Sustainable Development Goals +• Improve capabilities for research and innovation around the world +• Create the networks and opportunities for groups of researchers to work together on specific challenges +• Enhance people’s welfare and create opportunities for them +• Improve governance, policies and practices +• Reduce gender inequalities + + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + BEIS FINANCE + + + BEIS FINANCE + + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + + + + + + Department of Business Energy and Industrial Strategy + + + General enquiries + + enquiries@odamanagement.org + https://www.gov.uk/government/publications/beis-official-development-assistance-research-and-innovation + + Department of Business, Energy and Industrial Strategy, 4th Floor, 1 Victoria Street, SW1H 0ET + + + + Algeria + + + Libya + + + Morocco + + + Tunisia + + + Egypt + + + Burundi + + + Comoros (the) + + + Ethiopia + + + Kenya + + + Madagascar + + + Malawi + + + Mauritius + + + + + + Mozambique + + + Zimbabwe + + + Rwanda + + + Eritrea + + + Somalia + + + Djibouti + + + Sudan (the) + + + South Sudan + + + Tanzania, United Republic of + + + Uganda + + + Zambia + + + Angola + + + Cameroon + + + Central African Republic (the) + + + Chad + + + Congo (the) + + + Congo (the Democratic Republic of the) + + + Gabon + + + Equatorial Guinea + + + Sao Tome and Principe + + + South Africa + + + Botswana + + + Lesotho + + + Namibia + + + Eswatini + + + Cabo Verde + + + Benin + + + Gambia (the) + + + Ghana + + + Guinea + + + Guinea-Bissau + + + Côte d'Ivoire + + + Liberia + + + Mali + + + Mauritania + + + Niger (the) + + + Nigeria + + + Senegal + + + Sierra Leone + + + Saint Helena, Ascension and Tristan da Cunha + + + Togo + + + Burkina Faso + + + + + + + + + Cuba + + + Dominican Republic (the) + + + Haiti + + + Jamaica + + + + + + + + + + + + + + + Antigua and Barbuda + + + Dominica + + + Grenada + + + + + + Saint Lucia + + + Saint Vincent and the Grenadines + + + Montserrat + + + + + + + + + + + + Costa Rica + + + El Salvador + + + Guatemala + + + Honduras + + + Belize + + + Mexico + + + Nicaragua + + + Panama + + + Argentina + + + Bolivia (Plurinational State of) + + + Brazil + + + Colombia + + + Ecuador + + + + + + Guyana + + + Paraguay + + + Peru + + + Suriname + + + Venezuela (Bolivarian Republic of) + + + + + + Cambodia + + + China (People's Republic of) + + + + + + + + + Indonesia + + + Korea (the Democratic People's Republic of) + + + Korea (the Republic of) + + + Lao People's Democratic Republic (the) + + + + + + Malaysia + + + Mongolia + + + Philippines (the) + + + + + + Thailand + + + Timor-Leste + + + Viet Nam + + + + + + Iran (Islamic Republic of) + + + Iraq + + + + + + Jordan + + + West Bank and Gaza Strip (Palestinian territory) + + + + + + Lebanon + + + + + + + + + + + + Syrian Arab Republic + + + + + + Yemen + + + Armenia + + + Azerbaijan + + + Georgia + + + Kazakhstan + + + Kyrgyzstan + + + Tajikistan + + + Turkmenistan + + + Uzbekistan + + + Afghanistan + + + Bhutan + + + Myanmar + + + Sri Lanka + + + India + + + Maldives + + + Nepal + + + Pakistan + + + Bangladesh + + + + + + + + + + + + Turkey + + + Kosovo + + + + + + + + + Serbia + + + Bosnia and Herzegovina + + + Montenegro + + + North Macedonia + + + Albania + + + Ukraine + + + Belarus + + + Moldova (the Republic of) + + + Fiji + + + + + + Vanuatu + + + Papua New Guinea + + + Solomon Islands + + + Kiribati + + + Nauru + + + + + + Marshall Islands (the) + + + Micronesia (Federated States of) + + + Palau + + + + + + Niue + + + Tokelau + + + Tonga + + + Tuvalu + + + Wallis and Futuna + + + Samoa + + + + + + + + + + + + + + + + + + + 13216359.0 + + + + + 11825888.0 + + + + + + 5172459.0 + + FQ2 2021-2022 spend on SFC - GCRF QR funding + + + Department for Business, Energy and Industrial Strategy + + + + + + 8043900.0 + + FQ2 2021-2022 spend on SFC - GCRF QR funding + + + Department for Business, Energy and Industrial Strategy + + + + + + 11825888.0 + + FQ2 2021-2022 spend on SFC - GCRF QR funding + + + Department for Business, Energy and Industrial Strategy + + + + + + 11825888.0 + + Commitment SFC - GCRF QR funding + + + Department for Business, Energy and Industrial Strategy + + + + + + + GB-GOV-13-GCRF-BF-7TNK9LD-NLFLATK + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + <narrative>Global Challenges Research Fund Evaluation</narrative> + + + The overall purpose of the GCRF evaluation is to assess the extent to which GCRF has +achieved its objectives and contributed to its intended impacts. + + + This activity contributes to the aims and objectives of BEIS ODA Research and Innovation funds the Newton Fund and the Global Challenges Research Fund. They fund UK supported research and innovation to help people in low and middleincome countries. +This will: +• Help us to make progress towards UnitedNations’ Sustainable Development Goals +• Improve capabilities for research and innovation around the world +• Create the networks and opportunities for groups of researchers to work together on specific challenges +• Enhance people’s welfare and create opportunities for them +• Improve governance, policies and practices +• Reduce gender inequalities + + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + BEIS FINANCE + + + BEIS FINANCE + + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + + + + + + Department of Business Energy and Industrial Strategy + + + General enquiries + + enquiries@odamanagement.org + https://www.gov.uk/government/publications/beis-official-development-assistance-research-and-innovation + + Department of Business, Energy and Industrial Strategy, 4th Floor, 1 Victoria Street, SW1H 0ET + + + + Algeria + + + Libya + + + Morocco + + + Tunisia + + + Egypt + + + Burundi + + + Comoros (the) + + + Ethiopia + + + Kenya + + + Madagascar + + + Malawi + + + Mauritius + + + + + + Mozambique + + + Zimbabwe + + + Rwanda + + + Eritrea + + + Somalia + + + Djibouti + + + Sudan (the) + + + South Sudan + + + Tanzania, United Republic of + + + Uganda + + + Zambia + + + Angola + + + Cameroon + + + Central African Republic (the) + + + Chad + + + Congo (the) + + + Congo (the Democratic Republic of the) + + + Gabon + + + Equatorial Guinea + + + Sao Tome and Principe + + + South Africa + + + Botswana + + + Lesotho + + + Namibia + + + Eswatini + + + Cabo Verde + + + Benin + + + Gambia (the) + + + Ghana + + + Guinea + + + Guinea-Bissau + + + Côte d'Ivoire + + + Liberia + + + Mali + + + Mauritania + + + Niger (the) + + + Nigeria + + + Senegal + + + Sierra Leone + + + Saint Helena, Ascension and Tristan da Cunha + + + Togo + + + Burkina Faso + + + + + + + + + Cuba + + + Dominican Republic (the) + + + Haiti + + + Jamaica + + + + + + + + + + + + + + + Antigua and Barbuda + + + Dominica + + + Grenada + + + + + + Saint Lucia + + + Saint Vincent and the Grenadines + + + Montserrat + + + + + + + + + + + + Costa Rica + + + El Salvador + + + Guatemala + + + Honduras + + + Belize + + + Mexico + + + Nicaragua + + + Panama + + + Argentina + + + Bolivia (Plurinational State of) + + + Brazil + + + Colombia + + + Ecuador + + + + + + Guyana + + + Paraguay + + + Peru + + + Suriname + + + Venezuela (Bolivarian Republic of) + + + + + + Cambodia + + + China (People's Republic of) + + + + + + + + + Indonesia + + + Korea (the Democratic People's Republic of) + + + Korea (the Republic of) + + + Lao People's Democratic Republic (the) + + + + + + Malaysia + + + Mongolia + + + Philippines (the) + + + + + + Thailand + + + Timor-Leste + + + Viet Nam + + + + + + Iran (Islamic Republic of) + + + Iraq + + + + + + Jordan + + + West Bank and Gaza Strip (Palestinian territory) + + + + + + Lebanon + + + + + + + + + + + + Syrian Arab Republic + + + + + + Yemen + + + Armenia + + + Azerbaijan + + + Georgia + + + Kazakhstan + + + Kyrgyzstan + + + Tajikistan + + + Turkmenistan + + + Uzbekistan + + + Afghanistan + + + Bhutan + + + Myanmar + + + Sri Lanka + + + India + + + Maldives + + + Nepal + + + Pakistan + + + Bangladesh + + + + + + + + + + + + Turkey + + + Kosovo + + + + + + + + + Serbia + + + Bosnia and Herzegovina + + + Montenegro + + + North Macedonia + + + Albania + + + Ukraine + + + Belarus + + + Moldova (the Republic of) + + + Fiji + + + + + + Vanuatu + + + Papua New Guinea + + + Solomon Islands + + + Kiribati + + + Nauru + + + + + + Marshall Islands (the) + + + Micronesia (Federated States of) + + + Palau + + + + + + Niue + + + Tokelau + + + Tonga + + + Tuvalu + + + Wallis and Futuna + + + Samoa + + + + + + + + + + + + + + + + + + + 44947.5 + + + + + 497290.0 + + + + + 346990.0 + + + + + 768233.99 + + + + + 380416.0 + + + + + 412839.00 + + Department for Business, Energy and Industrial Strategy + + + + + + 354764.74 + + Department for Business, Energy and Industrial Strategy + + + + + + 128150.00 + + Department for Business, Energy and Industrial Strategy + + + + + + 369140.00 + + Department for Business, Energy and Industrial Strategy + + + + + + 38922.00 + + Department for Business, Energy and Industrial Strategy + + + + + + 341494.00 + + Department for Business, Energy and Industrial Strategy + + + + + + + 310749.25 + + FQ3 2021-2022 spend on GCRF Evaluation + + + DEPARTMENT FOR BUSINESS, ENERGY AND INDUSTRIAL STRATEGY + + + + + + 48550.0 + + FQ2 2021-2022 spend on GCRF Evaluation + + + Department for Business, Energy and Industrial Strategy + + + + + + 54170.0 + + FQ2 2021-2022 spend on GCRF Evaluation + + + Department for Business, Energy and Industrial Strategy + + + + + + 38769.0 + + FQ2 2021-2022 spend on GCRF Evaluation + + + Department for Business, Energy and Industrial Strategy + + + + + + 248546.0 + + FQ2 2021-2022 spend on GCRF Evaluation + + + Department for Business, Energy and Industrial Strategy + + + + + + 59675.0 + + FQ2 2021-2022 spend on GCRF Evaluation + + + Department for Business, Energy and Industrial Strategy + + + + + + 44947.5 + + FQ2 2021-2022 spend on GCRF Evaluation + + + Department for Business, Energy and Industrial Strategy + + + + + + 2037877.49 + + Commitment GCRF Evaluation + + + Department for Business, Energy and Industrial Strategy + + + + + + + GB-GOV-13-GCRF-BF-7TNK9LD-CJV6BWG + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + <narrative>Transformation Project - ODA Reporting Tool (ODART)</narrative> + + + The Reporting ODA Digital Service (RODA) is the data submission, processing, reporting repository system for data on BEIS R&I ODA Eligible Programmes delivered by Delivery Partners + + + This activity contributes to the aims and objectives of BEIS ODA Research and Innovation funds the Newton Fund and the Global Challenges Research Fund. They fund UK supported research and innovation to help people in low and middleincome countries. +This will: +• Help us to make progress towards UnitedNations’ Sustainable Development Goals +• Improve capabilities for research and innovation around the world +• Create the networks and opportunities for groups of researchers to work together on specific challenges +• Enhance people’s welfare and create opportunities for them +• Improve governance, policies and practices +• Reduce gender inequalities + + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + BEIS FINANCE + + + BEIS FINANCE + + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + + + + + + Department of Business Energy and Industrial Strategy + + + General enquiries + + enquiries@odamanagement.org + https://www.gov.uk/government/publications/beis-official-development-assistance-research-and-innovation + + Department of Business, Energy and Industrial Strategy, 4th Floor, 1 Victoria Street, SW1H 0ET + + + + Algeria + + + Libya + + + Morocco + + + Tunisia + + + Egypt + + + Burundi + + + Comoros (the) + + + Ethiopia + + + Kenya + + + Madagascar + + + Malawi + + + Mauritius + + + + + + Mozambique + + + Zimbabwe + + + Rwanda + + + Eritrea + + + Somalia + + + Djibouti + + + Sudan (the) + + + South Sudan + + + Tanzania, United Republic of + + + Uganda + + + Zambia + + + Angola + + + Cameroon + + + Central African Republic (the) + + + Chad + + + Congo (the) + + + Congo (the Democratic Republic of the) + + + Gabon + + + Equatorial Guinea + + + Sao Tome and Principe + + + South Africa + + + Botswana + + + Lesotho + + + Namibia + + + Eswatini + + + Cabo Verde + + + Benin + + + Gambia (the) + + + Ghana + + + Guinea + + + Guinea-Bissau + + + Côte d'Ivoire + + + Liberia + + + Mali + + + Mauritania + + + Niger (the) + + + Nigeria + + + Senegal + + + Sierra Leone + + + Saint Helena, Ascension and Tristan da Cunha + + + Togo + + + Burkina Faso + + + + + + + + + Cuba + + + Dominican Republic (the) + + + Haiti + + + Jamaica + + + + + + + + + + + + + + + Antigua and Barbuda + + + Dominica + + + Grenada + + + + + + Saint Lucia + + + Saint Vincent and the Grenadines + + + Montserrat + + + + + + + + + + + + Costa Rica + + + El Salvador + + + Guatemala + + + Honduras + + + Belize + + + Mexico + + + Nicaragua + + + Panama + + + Argentina + + + Bolivia (Plurinational State of) + + + Brazil + + + Colombia + + + Ecuador + + + + + + Guyana + + + Paraguay + + + Peru + + + Suriname + + + Venezuela (Bolivarian Republic of) + + + + + + Cambodia + + + China (People's Republic of) + + + + + + + + + Indonesia + + + Korea (the Democratic People's Republic of) + + + Korea (the Republic of) + + + Lao People's Democratic Republic (the) + + + + + + Malaysia + + + Mongolia + + + Philippines (the) + + + + + + Thailand + + + Timor-Leste + + + Viet Nam + + + + + + Iran (Islamic Republic of) + + + Iraq + + + + + + Jordan + + + West Bank and Gaza Strip (Palestinian territory) + + + + + + Lebanon + + + + + + + + + + + + Syrian Arab Republic + + + + + + Yemen + + + Armenia + + + Azerbaijan + + + Georgia + + + Kazakhstan + + + Kyrgyzstan + + + Tajikistan + + + Turkmenistan + + + Uzbekistan + + + Afghanistan + + + Bhutan + + + Myanmar + + + Sri Lanka + + + India + + + Maldives + + + Nepal + + + Pakistan + + + Bangladesh + + + + + + + + + + + + Turkey + + + Kosovo + + + + + + + + + Serbia + + + Bosnia and Herzegovina + + + Montenegro + + + North Macedonia + + + Albania + + + Ukraine + + + Belarus + + + Moldova (the Republic of) + + + Fiji + + + + + + Vanuatu + + + Papua New Guinea + + + Solomon Islands + + + Kiribati + + + Nauru + + + + + + Marshall Islands (the) + + + Micronesia (Federated States of) + + + Palau + + + + + + Niue + + + Tokelau + + + Tonga + + + Tuvalu + + + Wallis and Futuna + + + Samoa + + + + + + + + + + + + + + + + + + + 752063.7 + + + + + 1472953.89 + + + + + 978360.59 + + + + + 88000.0 + + + + + 88000.0 + + + + + 169785.00 + + Department for Business, Energy and Industrial Strategy + + + + + + 239510.00 + + Department for Business, Energy and Industrial Strategy + + + + + + 22000.00 + + Department for Business, Energy and Industrial Strategy + + + + + + 22000.00 + + Department for Business, Energy and Industrial Strategy + + + + + + 22000.00 + + Department for Business, Energy and Industrial Strategy + + + + + + 22000.00 + + Department for Business, Energy and Industrial Strategy + + + + + + 22000.00 + + Department for Business, Energy and Industrial Strategy + + + + + + 22000.00 + + Department for Business, Energy and Industrial Strategy + + + + + + 22000.00 + + Department for Business, Energy and Industrial Strategy + + + + + + 22000.00 + + Department for Business, Energy and Industrial Strategy + + + + + + + 158247.58 + + FQ3 2021-2022 spend on Transformation Project - ODA Reporting Tool (ODART) + + + DEPARTMENT FOR BUSINESS, ENERGY AND INDUSTRIAL STRATEGY + + + + + + 285866.81 + + FQ2 2021-2022 spend on Transformation Project - ODA Reporting Tool (ODART) + + + Department for Business, Energy and Industrial Strategy + + + + + + 294736.2 + + FQ2 2021-2022 spend on Transformation Project - ODA Reporting Tool (ODART) + + + Department for Business, Energy and Industrial Strategy + + + + + + 439279.38 + + FQ2 2021-2022 spend on Transformation Project - ODA Reporting Tool (ODART) + + + Department for Business, Energy and Industrial Strategy + + + + + + 314890.45 + + FQ2 2021-2022 spend on Transformation Project - ODA Reporting Tool (ODART) + + + Department for Business, Energy and Industrial Strategy + + + + + + 362362.5 + + FQ2 2021-2022 spend on Transformation Project - ODA Reporting Tool (ODART) + + + Department for Business, Energy and Industrial Strategy + + + + + + 356421.56 + + FQ2 2021-2022 spend on Transformation Project - ODA Reporting Tool (ODART) + + + Department for Business, Energy and Industrial Strategy + + + + + + 267420.73 + + FQ2 2021-2022 spend on Transformation Project - ODA Reporting Tool (ODART) + + + Department for Business, Energy and Industrial Strategy + + + + + + 223982.97 + + FQ2 2021-2022 spend on Transformation Project - ODA Reporting Tool (ODART) + + + Department for Business, Energy and Industrial Strategy + + + + + + 29212.0 + + FQ2 2021-2022 spend on Transformation Project - ODA Reporting Tool (ODART) + + + Department for Business, Energy and Industrial Strategy + + + + + + 231448.0 + + FQ2 2021-2022 spend on Transformation Project - ODA Reporting Tool (ODART) + + + Department for Business, Energy and Industrial Strategy + + + + + + 3379378.18 + + Commitment for Transformation Project - ODA Reporting Tool (ODART) + + + Department for Business, Energy and Industrial Strategy + + + + + + + GB-GOV-13-GCRF-BF-7TNK9LD-YNLLBYF + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + <narrative>UUKi Delivery Support</narrative> + + + These are delivery cost for shared learning workshops/training and best practice (for current and future applicants) on ODA assurance, eligibility, reporting and partnership working through either the NF and GCRF + + + This activity contributes to the aims and objectives of BEIS ODA Research and Innovation funds the Newton Fund and the Global Challenges Research Fund. They fund UK supported research and innovation to help people in low and middleincome countries. +This will: +• Help us to make progress towards UnitedNations’ Sustainable Development Goals +• Improve capabilities for research and innovation around the world +• Create the networks and opportunities for groups of researchers to work together on specific challenges +• Enhance people’s welfare and create opportunities for them +• Improve governance, policies and practices +• Reduce gender inequalities + + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + BEIS FINANCE + + + BEIS FINANCE + + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + + + + + + Department of Business Energy and Industrial Strategy + + + General enquiries + + enquiries@odamanagement.org + https://www.gov.uk/government/publications/beis-official-development-assistance-research-and-innovation + + Department of Business, Energy and Industrial Strategy, 4th Floor, 1 Victoria Street, SW1H 0ET + + + + Algeria + + + Libya + + + Morocco + + + Tunisia + + + Egypt + + + Burundi + + + Comoros (the) + + + Ethiopia + + + Kenya + + + Madagascar + + + Malawi + + + Mauritius + + + + + + Mozambique + + + Zimbabwe + + + Rwanda + + + Eritrea + + + Somalia + + + Djibouti + + + Sudan (the) + + + South Sudan + + + Tanzania, United Republic of + + + Uganda + + + Zambia + + + Angola + + + Cameroon + + + Central African Republic (the) + + + Chad + + + Congo (the) + + + Congo (the Democratic Republic of the) + + + Gabon + + + Equatorial Guinea + + + Sao Tome and Principe + + + South Africa + + + Botswana + + + Lesotho + + + Namibia + + + Eswatini + + + Cabo Verde + + + Benin + + + Gambia (the) + + + Ghana + + + Guinea + + + Guinea-Bissau + + + Côte d'Ivoire + + + Liberia + + + Mali + + + Mauritania + + + Niger (the) + + + Nigeria + + + Senegal + + + Sierra Leone + + + Saint Helena, Ascension and Tristan da Cunha + + + Togo + + + Burkina Faso + + + + + + + + + Cuba + + + Dominican Republic (the) + + + Haiti + + + Jamaica + + + + + + + + + + + + + + + Antigua and Barbuda + + + Dominica + + + Grenada + + + + + + Saint Lucia + + + Saint Vincent and the Grenadines + + + Montserrat + + + + + + + + + + + + Costa Rica + + + El Salvador + + + Guatemala + + + Honduras + + + Belize + + + Mexico + + + Nicaragua + + + Panama + + + Argentina + + + Bolivia (Plurinational State of) + + + Brazil + + + Colombia + + + Ecuador + + + + + + Guyana + + + Paraguay + + + Peru + + + Suriname + + + Venezuela (Bolivarian Republic of) + + + + + + Cambodia + + + China (People's Republic of) + + + + + + + + + Indonesia + + + Korea (the Democratic People's Republic of) + + + Korea (the Republic of) + + + Lao People's Democratic Republic (the) + + + + + + Malaysia + + + Mongolia + + + Philippines (the) + + + + + + Thailand + + + Timor-Leste + + + Viet Nam + + + + + + Iran (Islamic Republic of) + + + Iraq + + + + + + Jordan + + + West Bank and Gaza Strip (Palestinian territory) + + + + + + Lebanon + + + + + + + + + + + + Syrian Arab Republic + + + + + + Yemen + + + Armenia + + + Azerbaijan + + + Georgia + + + Kazakhstan + + + Kyrgyzstan + + + Tajikistan + + + Turkmenistan + + + Uzbekistan + + + Afghanistan + + + Bhutan + + + Myanmar + + + Sri Lanka + + + India + + + Maldives + + + Nepal + + + Pakistan + + + Bangladesh + + + + + + + + + + + + Turkey + + + Kosovo + + + + + + + + + Serbia + + + Bosnia and Herzegovina + + + Montenegro + + + North Macedonia + + + Albania + + + Ukraine + + + Belarus + + + Moldova (the Republic of) + + + Fiji + + + + + + Vanuatu + + + Papua New Guinea + + + Solomon Islands + + + Kiribati + + + Nauru + + + + + + Marshall Islands (the) + + + Micronesia (Federated States of) + + + Palau + + + + + + Niue + + + Tokelau + + + Tonga + + + Tuvalu + + + Wallis and Futuna + + + Samoa + + + + + + + + + + + + + + + + + + + 55000.0 + + + + + 85832.0 + + + + + 102082.0 + + + + + 13750.00 + + Department for Business, Energy and Industrial Strategy + + + + + + 27500.00 + + Department for Business, Energy and Industrial Strategy + + + + + + + 13750.0 + + FQ3 2021-2022 spend on UUKi Delivery Support + + + DEPARTMENT FOR BUSINESS, ENERGY AND INDUSTRIAL STRATEGY + + + + + + 13750.0 + + FQ2 2021-2022 spend on UUKi Delivery Support + + + Department for Business, Energy and Industrial Strategy + + + + + + 37708.0 + + FQ2 2021-2022 spend on UUKi Delivery Support + + + Department for Business, Energy and Industrial Strategy + + + + + + 21458.0 + + FQ2 2021-2022 spend on UUKi Delivery Support + + + Department for Business, Energy and Industrial Strategy + + + + + + 42916.0 + + FQ2 2021-2022 spend on UUKi Delivery Support + + + Department for Business, Energy and Industrial Strategy + + + + + + 42916.0 + + FQ2 2021-2022 spend on UUKi Delivery Support + + + Department for Business, Energy and Industrial Strategy + + + + + + 21458.0 + + FQ2 2021-2022 spend on UUKi Delivery Support + + + Department for Business, Energy and Industrial Strategy + + + + + + 21458.0 + + FQ2 2021-2022 spend on UUKi Delivery Support + + + Department for Business, Energy and Industrial Strategy + + + + + + 242914.0 + + Activity Commitment + + + Department for Business, Energy and Industrial Strategy + + + + + + + GB-GOV-13-GCRF-BF-7TNK9LD-GL66264 + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + <narrative>ODA website - cross-cutting for both ODA funds</narrative> + + + This is the website for NF and GCRF consortia that promotes funding calls and impact case studies as well as publishing report such as the annual report and monitoring and evaluation documentation. + + + This activity contributes to the aims and objectives of BEIS ODA Research and Innovation funds the Newton Fund and the Global Challenges Research Fund. They fund UK supported research and innovation to help people in low and middleincome countries. +This will: +• Help us to make progress towards UnitedNations’ Sustainable Development Goals +• Improve capabilities for research and innovation around the world +• Create the networks and opportunities for groups of researchers to work together on specific challenges +• Enhance people’s welfare and create opportunities for them +• Improve governance, policies and practices +• Reduce gender inequalities + + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + BEIS FINANCE + + + BEIS FINANCE + + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + + + + + + Department of Business Energy and Industrial Strategy + + + General enquiries + + enquiries@odamanagement.org + https://www.gov.uk/government/publications/beis-official-development-assistance-research-and-innovation + + Department of Business, Energy and Industrial Strategy, 4th Floor, 1 Victoria Street, SW1H 0ET + + + + Algeria + + + Libya + + + Morocco + + + Tunisia + + + Egypt + + + Burundi + + + Comoros (the) + + + Ethiopia + + + Kenya + + + Madagascar + + + Malawi + + + Mauritius + + + + + + Mozambique + + + Zimbabwe + + + Rwanda + + + Eritrea + + + Somalia + + + Djibouti + + + Sudan (the) + + + South Sudan + + + Tanzania, United Republic of + + + Uganda + + + Zambia + + + Angola + + + Cameroon + + + Central African Republic (the) + + + Chad + + + Congo (the) + + + Congo (the Democratic Republic of the) + + + Gabon + + + Equatorial Guinea + + + Sao Tome and Principe + + + South Africa + + + Botswana + + + Lesotho + + + Namibia + + + Eswatini + + + Cabo Verde + + + Benin + + + Gambia (the) + + + Ghana + + + Guinea + + + Guinea-Bissau + + + Côte d'Ivoire + + + Liberia + + + Mali + + + Mauritania + + + Niger (the) + + + Nigeria + + + Senegal + + + Sierra Leone + + + Saint Helena, Ascension and Tristan da Cunha + + + Togo + + + Burkina Faso + + + + + + + + + Cuba + + + Dominican Republic (the) + + + Haiti + + + Jamaica + + + + + + + + + + + + + + + Antigua and Barbuda + + + Dominica + + + Grenada + + + + + + Saint Lucia + + + Saint Vincent and the Grenadines + + + Montserrat + + + + + + + + + + + + Costa Rica + + + El Salvador + + + Guatemala + + + Honduras + + + Belize + + + Mexico + + + Nicaragua + + + Panama + + + Argentina + + + Bolivia (Plurinational State of) + + + Brazil + + + Colombia + + + Ecuador + + + + + + Guyana + + + Paraguay + + + Peru + + + Suriname + + + Venezuela (Bolivarian Republic of) + + + + + + Cambodia + + + China (People's Republic of) + + + + + + + + + Indonesia + + + Korea (the Democratic People's Republic of) + + + Korea (the Republic of) + + + Lao People's Democratic Republic (the) + + + + + + Malaysia + + + Mongolia + + + Philippines (the) + + + + + + Thailand + + + Timor-Leste + + + Viet Nam + + + + + + Iran (Islamic Republic of) + + + Iraq + + + + + + Jordan + + + West Bank and Gaza Strip (Palestinian territory) + + + + + + Lebanon + + + + + + + + + + + + Syrian Arab Republic + + + + + + Yemen + + + Armenia + + + Azerbaijan + + + Georgia + + + Kazakhstan + + + Kyrgyzstan + + + Tajikistan + + + Turkmenistan + + + Uzbekistan + + + Afghanistan + + + Bhutan + + + Myanmar + + + Sri Lanka + + + India + + + Maldives + + + Nepal + + + Pakistan + + + Bangladesh + + + + + + + + + + + + Turkey + + + Kosovo + + + + + + + + + Serbia + + + Bosnia and Herzegovina + + + Montenegro + + + North Macedonia + + + Albania + + + Ukraine + + + Belarus + + + Moldova (the Republic of) + + + Fiji + + + + + + Vanuatu + + + Papua New Guinea + + + Solomon Islands + + + Kiribati + + + Nauru + + + + + + Marshall Islands (the) + + + Micronesia (Federated States of) + + + Palau + + + + + + Niue + + + Tokelau + + + Tonga + + + Tuvalu + + + Wallis and Futuna + + + Samoa + + + + + + + + + + + + + + + + + + + 13235.0 + + + + + 7053.00 + + Department for Business, Energy and Industrial Strategy + + + + + + 3006.00 + + Department for Business, Energy and Industrial Strategy + + + + + + + 8919.0 + + FQ3 2021-2022 spend on ODA website - cross-cutting for both ODA funds + + + DEPARTMENT FOR BUSINESS, ENERGY AND INDUSTRIAL STRATEGY + + + + + + 1310.0 + + FQ2 2021-2022 spend on ODA website - cross-cutting for both ODA funds + + + Department for Business, Energy and Industrial Strategy + + + + + + 13235.0 + + Activity commitment + + + Department for Business, Energy and Industrial Strategy + + + + + + + GB-GOV-13-GCRF-BF-7TNK9LD-MGTU53A + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + <narrative>Ad-hoc GCRF activity on BEIS Finance system</narrative> + + + Increased contributions towards a range of research projects jointly funded with DFID, and funding for the Devolved Administrations for disbursement to universities within the devolved regions to fund the full economic cost of GCRF ODA research. + + + This activity contributes to the aims and objectives of BEIS ODA Research and Innovation funds the Newton Fund and the Global Challenges Research Fund. They fund UK supported research and innovation to help people in low and middleincome countries. +This will: +• Help us to make progress towards UnitedNations’ Sustainable Development Goals +• Improve capabilities for research and innovation around the world +• Create the networks and opportunities for groups of researchers to work together on specific challenges +• Enhance people’s welfare and create opportunities for them +• Improve governance, policies and practices +• Reduce gender inequalities + + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + BEIS FINANCE + + + BEIS FINANCE + + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + + + + + + Department of Business Energy and Industrial Strategy + + + General enquiries + + enquiries@odamanagement.org + https://www.gov.uk/government/publications/beis-official-development-assistance-research-and-innovation + + Department of Business, Energy and Industrial Strategy, 4th Floor, 1 Victoria Street, SW1H 0ET + + + + Algeria + + + Libya + + + Morocco + + + Tunisia + + + Egypt + + + Burundi + + + Comoros (the) + + + Ethiopia + + + Kenya + + + Madagascar + + + Malawi + + + Mauritius + + + + + + Mozambique + + + Zimbabwe + + + Rwanda + + + Eritrea + + + Somalia + + + Djibouti + + + Sudan (the) + + + South Sudan + + + Tanzania, United Republic of + + + Uganda + + + Zambia + + + Angola + + + Cameroon + + + Central African Republic (the) + + + Chad + + + Congo (the) + + + Congo (the Democratic Republic of the) + + + Gabon + + + Equatorial Guinea + + + Sao Tome and Principe + + + South Africa + + + Botswana + + + Lesotho + + + Namibia + + + Eswatini + + + Cabo Verde + + + Benin + + + Gambia (the) + + + Ghana + + + Guinea + + + Guinea-Bissau + + + Côte d'Ivoire + + + Liberia + + + Mali + + + Mauritania + + + Niger (the) + + + Nigeria + + + Senegal + + + Sierra Leone + + + Saint Helena, Ascension and Tristan da Cunha + + + Togo + + + Burkina Faso + + + + + + + + + Cuba + + + Dominican Republic (the) + + + Haiti + + + Jamaica + + + + + + + + + + + + + + + Antigua and Barbuda + + + Dominica + + + Grenada + + + + + + Saint Lucia + + + Saint Vincent and the Grenadines + + + Montserrat + + + + + + + + + + + + Costa Rica + + + El Salvador + + + Guatemala + + + Honduras + + + Belize + + + Mexico + + + Nicaragua + + + Panama + + + Argentina + + + Bolivia (Plurinational State of) + + + Brazil + + + Colombia + + + Ecuador + + + + + + Guyana + + + Paraguay + + + Peru + + + Suriname + + + Venezuela (Bolivarian Republic of) + + + + + + Cambodia + + + China (People's Republic of) + + + + + + + + + Indonesia + + + Korea (the Democratic People's Republic of) + + + Korea (the Republic of) + + + Lao People's Democratic Republic (the) + + + + + + Malaysia + + + Mongolia + + + Philippines (the) + + + + + + Thailand + + + Timor-Leste + + + Viet Nam + + + + + + Iran (Islamic Republic of) + + + Iraq + + + + + + Jordan + + + West Bank and Gaza Strip (Palestinian territory) + + + + + + Lebanon + + + + + + + + + + + + Syrian Arab Republic + + + + + + Yemen + + + Armenia + + + Azerbaijan + + + Georgia + + + Kazakhstan + + + Kyrgyzstan + + + Tajikistan + + + Turkmenistan + + + Uzbekistan + + + Afghanistan + + + Bhutan + + + Myanmar + + + Sri Lanka + + + India + + + Maldives + + + Nepal + + + Pakistan + + + Bangladesh + + + + + + + + + + + + Turkey + + + Kosovo + + + + + + + + + Serbia + + + Bosnia and Herzegovina + + + Montenegro + + + North Macedonia + + + Albania + + + Ukraine + + + Belarus + + + Moldova (the Republic of) + + + Fiji + + + + + + Vanuatu + + + Papua New Guinea + + + Solomon Islands + + + Kiribati + + + Nauru + + + + + + Marshall Islands (the) + + + Micronesia (Federated States of) + + + Palau + + + + + + Niue + + + Tokelau + + + Tonga + + + Tuvalu + + + Wallis and Futuna + + + Samoa + + + + + + + + + + + + + + + + + + + 69750.0 + + + + + + 69750.0 + + FQ2 2021-2022 spend on Ad-hoc GCRF activity on BEIS Finance system + + + Department for Business, Energy and Industrial Strategy + + + + + + 69750.0 + + Activity Commitment + + + Department for Business, Energy and Industrial Strategy + + + + + + + GB-GOV-13-GCRF-BF-7TNK9LD-UBSPZA4 + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + <narrative>DfE NI - GCRF QR funding</narrative> + + + Grant to Department for the Economy, Northern Ireland to enable Northern Irish higher education institutes to carry out pre-agreed ODA-eligible activities in line with their institutional strategies. For Queen’s University Belfast in FY2019/20 this included: workshops in Cambodia, Vietnam, South Africa, and Uganda about health and education; 11 pilot projects spanning 16 eligible countries (Angola, Burundi, China, Colombia, Ghana, India, Kenya, Kosovo, Malaysia, Nigeria, South Africa, Sri Lanka, Tanzania, Uganda, Vietnam and Zimbabwe); and additional support to GCRF and NF-funded activities. For Ulster University in FY2019/20 funding supported six pump-priming projects on: LMIC maternal, neonatal and child health; PTSD in Rwanda; Decision-Making in Policy Making in Africa and Central Asia; and hearing impairment and dementia in China. + + + This activity contributes to the aims and objectives of BEIS ODA Research and Innovation funds the Newton Fund and the Global Challenges Research Fund. They fund UK supported research and innovation to help people in low and middleincome countries. +This will: +• Help us to make progress towards UnitedNations’ Sustainable Development Goals +• Improve capabilities for research and innovation around the world +• Create the networks and opportunities for groups of researchers to work together on specific challenges +• Enhance people’s welfare and create opportunities for them +• Improve governance, policies and practices +• Reduce gender inequalities + + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + BEIS FINANCE + + + BEIS FINANCE + + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + + + + + + Department of Business Energy and Industrial Strategy + + + General enquiries + + enquiries@odamanagement.org + https://www.gov.uk/government/publications/beis-official-development-assistance-research-and-innovation + + Department of Business, Energy and Industrial Strategy, 4th Floor, 1 Victoria Street, SW1H 0ET + + + + Algeria + + + Libya + + + Morocco + + + Tunisia + + + Egypt + + + Burundi + + + Comoros (the) + + + Ethiopia + + + Kenya + + + Madagascar + + + Malawi + + + Mauritius + + + + + + Mozambique + + + Zimbabwe + + + Rwanda + + + Eritrea + + + Somalia + + + Djibouti + + + Sudan (the) + + + South Sudan + + + Tanzania, United Republic of + + + Uganda + + + Zambia + + + Angola + + + Cameroon + + + Central African Republic (the) + + + Chad + + + Congo (the) + + + Congo (the Democratic Republic of the) + + + Gabon + + + Equatorial Guinea + + + Sao Tome and Principe + + + South Africa + + + Botswana + + + Lesotho + + + Namibia + + + Eswatini + + + Cabo Verde + + + Benin + + + Gambia (the) + + + Ghana + + + Guinea + + + Guinea-Bissau + + + Côte d'Ivoire + + + Liberia + + + Mali + + + Mauritania + + + Niger (the) + + + Nigeria + + + Senegal + + + Sierra Leone + + + Saint Helena, Ascension and Tristan da Cunha + + + Togo + + + Burkina Faso + + + + + + + + + Cuba + + + Dominican Republic (the) + + + Haiti + + + Jamaica + + + + + + + + + + + + + + + Antigua and Barbuda + + + Dominica + + + Grenada + + + + + + Saint Lucia + + + Saint Vincent and the Grenadines + + + Montserrat + + + + + + + + + + + + Costa Rica + + + El Salvador + + + Guatemala + + + Honduras + + + Belize + + + Mexico + + + Nicaragua + + + Panama + + + Argentina + + + Bolivia (Plurinational State of) + + + Brazil + + + Colombia + + + Ecuador + + + + + + Guyana + + + Paraguay + + + Peru + + + Suriname + + + Venezuela (Bolivarian Republic of) + + + + + + Cambodia + + + China (People's Republic of) + + + + + + + + + Indonesia + + + Korea (the Democratic People's Republic of) + + + Korea (the Republic of) + + + Lao People's Democratic Republic (the) + + + + + + Malaysia + + + Mongolia + + + Philippines (the) + + + + + + Thailand + + + Timor-Leste + + + Viet Nam + + + + + + Iran (Islamic Republic of) + + + Iraq + + + + + + Jordan + + + West Bank and Gaza Strip (Palestinian territory) + + + + + + Lebanon + + + + + + + + + + + + Syrian Arab Republic + + + + + + Yemen + + + Armenia + + + Azerbaijan + + + Georgia + + + Kazakhstan + + + Kyrgyzstan + + + Tajikistan + + + Turkmenistan + + + Uzbekistan + + + Afghanistan + + + Bhutan + + + Myanmar + + + Sri Lanka + + + India + + + Maldives + + + Nepal + + + Pakistan + + + Bangladesh + + + + + + + + + + + + Turkey + + + Kosovo + + + + + + + + + Serbia + + + Bosnia and Herzegovina + + + Montenegro + + + North Macedonia + + + Albania + + + Ukraine + + + Belarus + + + Moldova (the Republic of) + + + Fiji + + + + + + Vanuatu + + + Papua New Guinea + + + Solomon Islands + + + Kiribati + + + Nauru + + + + + + Marshall Islands (the) + + + Micronesia (Federated States of) + + + Palau + + + + + + Niue + + + Tokelau + + + Tonga + + + Tuvalu + + + Wallis and Futuna + + + Samoa + + + + + + + + + + + + + + + + + + + 828516.0 + + + + + 1098336.5 + + + + + + 429853.0 + + FQ2 2021-2022 spend on DfE NI - GCRF QR funding + + + Department for Business, Energy and Industrial Strategy + + + + + + 668483.5 + + FQ2 2021-2022 spend on DfE NI - GCRF QR funding + + + Department for Business, Energy and Industrial Strategy + + + + + + 828516.0 + + FQ2 2021-2022 spend on DfE NI - GCRF QR funding + + + Department for Business, Energy and Industrial Strategy + + + + + + 1926852.50 + + Commitment DfE NI - GCRF QR funding + + + Department for Business, Energy and Industrial Strategy + + + + + + + GB-GOV-13-GCRF-BF-7TNK9LD-JQSCSMF + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + <narrative>HEFCW - GCRF QR funding</narrative> + + + Additional GCRF funding to the Higher Education Funding Council for Wales to support Welsh higher education institutes (HEIs) to carry out ODA-eligible activities in line with their institutional strategies. ODA research grants do not represent the full economic cost of research and therefore additional funding is provided to Welsh HEIs in line with their research council grant income. In FY19/20 funding was allocated to Aberystwyth University, Bangor University, Cardiff University and Swansea University. In FY19/20, the funding was used to fund: the full economic cost of existing ODA eligible activities (e.g. already funded by GCRF); small ODA-eligible projects; fellowships to ODA-eligible researchers; and to increase collaboration and impact. 53 ODA-eligible countries have been reported as benefiting from the funded work, with Brazil and India the most frequently mentioned. By region, the largest number of projects were based in the LDC’s (Least Developed Countries) in Asia, South America, and East Africa, with only a few projects in the middle-income countries such as Kazakhstan, Kyrgyzstan and Georgia. + + + This activity contributes to the aims and objectives of BEIS ODA Research and Innovation funds the Newton Fund and the Global Challenges Research Fund. They fund UK supported research and innovation to help people in low and middleincome countries. +This will: +• Help us to make progress towards UnitedNations’ Sustainable Development Goals +• Improve capabilities for research and innovation around the world +• Create the networks and opportunities for groups of researchers to work together on specific challenges +• Enhance people’s welfare and create opportunities for them +• Improve governance, policies and practices +• Reduce gender inequalities + + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + BEIS FINANCE + + + BEIS FINANCE + + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + + + + + + Department of Business Energy and Industrial Strategy + + + General enquiries + + enquiries@odamanagement.org + https://www.gov.uk/government/publications/beis-official-development-assistance-research-and-innovation + + Department of Business, Energy and Industrial Strategy, 4th Floor, 1 Victoria Street, SW1H 0ET + + + + Algeria + + + Libya + + + Morocco + + + Tunisia + + + Egypt + + + Burundi + + + Comoros (the) + + + Ethiopia + + + Kenya + + + Madagascar + + + Malawi + + + Mauritius + + + + + + Mozambique + + + Zimbabwe + + + Rwanda + + + Eritrea + + + Somalia + + + Djibouti + + + Sudan (the) + + + South Sudan + + + Tanzania, United Republic of + + + Uganda + + + Zambia + + + Angola + + + Cameroon + + + Central African Republic (the) + + + Chad + + + Congo (the) + + + Congo (the Democratic Republic of the) + + + Gabon + + + Equatorial Guinea + + + Sao Tome and Principe + + + South Africa + + + Botswana + + + Lesotho + + + Namibia + + + Eswatini + + + Cabo Verde + + + Benin + + + Gambia (the) + + + Ghana + + + Guinea + + + Guinea-Bissau + + + Côte d'Ivoire + + + Liberia + + + Mali + + + Mauritania + + + Niger (the) + + + Nigeria + + + Senegal + + + Sierra Leone + + + Saint Helena, Ascension and Tristan da Cunha + + + Togo + + + Burkina Faso + + + + + + + + + Cuba + + + Dominican Republic (the) + + + Haiti + + + Jamaica + + + + + + + + + + + + + + + Antigua and Barbuda + + + Dominica + + + Grenada + + + + + + Saint Lucia + + + Saint Vincent and the Grenadines + + + Montserrat + + + + + + + + + + + + Costa Rica + + + El Salvador + + + Guatemala + + + Honduras + + + Belize + + + Mexico + + + Nicaragua + + + Panama + + + Argentina + + + Bolivia (Plurinational State of) + + + Brazil + + + Colombia + + + Ecuador + + + + + + Guyana + + + Paraguay + + + Peru + + + Suriname + + + Venezuela (Bolivarian Republic of) + + + + + + Cambodia + + + China (People's Republic of) + + + + + + + + + Indonesia + + + Korea (the Democratic People's Republic of) + + + Korea (the Republic of) + + + Lao People's Democratic Republic (the) + + + + + + Malaysia + + + Mongolia + + + Philippines (the) + + + + + + Thailand + + + Timor-Leste + + + Viet Nam + + + + + + Iran (Islamic Republic of) + + + Iraq + + + + + + Jordan + + + West Bank and Gaza Strip (Palestinian territory) + + + + + + Lebanon + + + + + + + + + + + + Syrian Arab Republic + + + + + + Yemen + + + Armenia + + + Azerbaijan + + + Georgia + + + Kazakhstan + + + Kyrgyzstan + + + Tajikistan + + + Turkmenistan + + + Uzbekistan + + + Afghanistan + + + Bhutan + + + Myanmar + + + Sri Lanka + + + India + + + Maldives + + + Nepal + + + Pakistan + + + Bangladesh + + + + + + + + + + + + Turkey + + + Kosovo + + + + + + + + + Serbia + + + Bosnia and Herzegovina + + + Montenegro + + + North Macedonia + + + Albania + + + Ukraine + + + Belarus + + + Moldova (the Republic of) + + + Fiji + + + + + + Vanuatu + + + Papua New Guinea + + + Solomon Islands + + + Kiribati + + + Nauru + + + + + + Marshall Islands (the) + + + Micronesia (Federated States of) + + + Palau + + + + + + Niue + + + Tokelau + + + Tonga + + + Tuvalu + + + Wallis and Futuna + + + Samoa + + + + + + + + + + + + + + + + + + + 2532444.0 + + + + + 2813923.0 + + + + + + 1101279.5 + + FQ2 2021-2022 spend on HEFCW - GCRF QR funding + + + Department for Business, Energy and Industrial Strategy + + + + + + 1712643.5 + + FQ2 2021-2022 spend on HEFCW - GCRF QR funding + + + Department for Business, Energy and Industrial Strategy + + + + + + 2532444.0 + + FQ2 2021-2022 spend on HEFCW - GCRF QR funding + + + Department for Business, Energy and Industrial Strategy + + + + + + 5346367.0 + + ACtivity Commitment + + + Department for Business, Energy and Industrial Strategy + + + + + + + GB-GOV-13-GCRF-BF-7TNK9LD-6HMS4XB + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + <narrative>ODA BEIS analysts - cross-cutting for both ODA funds</narrative> + + + ODA BEIS analysts. For the monitoring and evaluation and learning for NF and GCRF + + + This activity contributes to the aims and objectives of BEIS ODA Research and Innovation funds the Newton Fund and the Global Challenges Research Fund. They fund UK supported research and innovation to help people in low and middleincome countries. +This will: +• Help us to make progress towards UnitedNations’ Sustainable Development Goals +• Improve capabilities for research and innovation around the world +• Create the networks and opportunities for groups of researchers to work together on specific challenges +• Enhance people’s welfare and create opportunities for them +• Improve governance, policies and practices +• Reduce gender inequalities + + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + BEIS FINANCE + + + BEIS FINANCE + + + DEPARTMENT FOR BUSINESS, ENERGY & INDUSTRIAL STRATEGY + + + + + + + + Department of Business Energy and Industrial Strategy + + + General enquiries + + enquiries@odamanagement.org + https://www.gov.uk/government/publications/beis-official-development-assistance-research-and-innovation + + Department of Business, Energy and Industrial Strategy, 4th Floor, 1 Victoria Street, SW1H 0ET + + + + Algeria + + + Libya + + + Morocco + + + Tunisia + + + Egypt + + + Burundi + + + Comoros (the) + + + Ethiopia + + + Kenya + + + Madagascar + + + Malawi + + + Mauritius + + + + + + Mozambique + + + Zimbabwe + + + Rwanda + + + Eritrea + + + Somalia + + + Djibouti + + + Sudan (the) + + + South Sudan + + + Tanzania, United Republic of + + + Uganda + + + Zambia + + + Angola + + + Cameroon + + + Central African Republic (the) + + + Chad + + + Congo (the) + + + Congo (the Democratic Republic of the) + + + Gabon + + + Equatorial Guinea + + + Sao Tome and Principe + + + South Africa + + + Botswana + + + Lesotho + + + Namibia + + + Eswatini + + + Cabo Verde + + + Benin + + + Gambia (the) + + + Ghana + + + Guinea + + + Guinea-Bissau + + + Côte d'Ivoire + + + Liberia + + + Mali + + + Mauritania + + + Niger (the) + + + Nigeria + + + Senegal + + + Sierra Leone + + + Saint Helena, Ascension and Tristan da Cunha + + + Togo + + + Burkina Faso + + + + + + + + + Cuba + + + Dominican Republic (the) + + + Haiti + + + Jamaica + + + + + + + + + + + + + + + Antigua and Barbuda + + + Dominica + + + Grenada + + + + + + Saint Lucia + + + Saint Vincent and the Grenadines + + + Montserrat + + + + + + + + + + + + Costa Rica + + + El Salvador + + + Guatemala + + + Honduras + + + Belize + + + Mexico + + + Nicaragua + + + Panama + + + Argentina + + + Bolivia (Plurinational State of) + + + Brazil + + + Colombia + + + Ecuador + + + + + + Guyana + + + Paraguay + + + Peru + + + Suriname + + + Venezuela (Bolivarian Republic of) + + + + + + Cambodia + + + China (People's Republic of) + + + + + + + + + Indonesia + + + Korea (the Democratic People's Republic of) + + + Korea (the Republic of) + + + Lao People's Democratic Republic (the) + + + + + + Malaysia + + + Mongolia + + + Philippines (the) + + + + + + Thailand + + + Timor-Leste + + + Viet Nam + + + + + + Iran (Islamic Republic of) + + + Iraq + + + + + + Jordan + + + West Bank and Gaza Strip (Palestinian territory) + + + + + + Lebanon + + + + + + + + + + + + Syrian Arab Republic + + + + + + Yemen + + + Armenia + + + Azerbaijan + + + Georgia + + + Kazakhstan + + + Kyrgyzstan + + + Tajikistan + + + Turkmenistan + + + Uzbekistan + + + Afghanistan + + + Bhutan + + + Myanmar + + + Sri Lanka + + + India + + + Maldives + + + Nepal + + + Pakistan + + + Bangladesh + + + + + + + + + + + + Turkey + + + Kosovo + + + + + + + + + Serbia + + + Bosnia and Herzegovina + + + Montenegro + + + North Macedonia + + + Albania + + + Ukraine + + + Belarus + + + Moldova (the Republic of) + + + Fiji + + + + + + Vanuatu + + + Papua New Guinea + + + Solomon Islands + + + Kiribati + + + Nauru + + + + + + Marshall Islands (the) + + + Micronesia (Federated States of) + + + Palau + + + + + + Niue + + + Tokelau + + + Tonga + + + Tuvalu + + + Wallis and Futuna + + + Samoa + + + + + + + + + + + + + + + + + + + 169277.59 + + + + + 128150.0 + + + + + 48750.00 + + Department for Business, Energy and Industrial Strategy + + + + + + 48750.00 + + Department for Business, Energy and Industrial Strategy + + + + + + 128150.00 + + Department for Business, Energy and Industrial Strategy + + + + + + + 2753.68 + + FQ3 2021-2022 spend on ODA BEIS analysts - cross-cutting for both ODA funds + + + DEPARTMENT FOR BUSINESS, ENERGY AND INDUSTRIAL STRATEGY + + + + + + 71271.44 + + FQ2 2021-2022 spend on ODA BEIS analysts - cross-cutting for both ODA funds + + + Department for Business, Energy and Industrial Strategy + + + + + + 46502.47 + + FQ2 2021-2022 spend on ODA BEIS analysts - cross-cutting for both ODA funds + + + Department for Business, Energy and Industrial Strategy + + + + + + 297427.59 + + Activity Commitment + + + Department for Business, Energy and Industrial Strategy + + + + + + diff --git a/iatiflattener/tests/fixtures/finddiagnostics-activity.xml b/iatiflattener/tests/fixtures/finddiagnostics-activity.xml new file mode 100644 index 0000000..469f419 --- /dev/null +++ b/iatiflattener/tests/fixtures/finddiagnostics-activity.xml @@ -0,0 +1,208 @@ + + + + + CH-FDJP-110.162.567-FIND2021 + + Foundation for Innovative New Diagnostics + + + <narrative xml:lang="en">Ensure equitable access to reliable diagnosis around the world</narrative> + + + Despite the ongoing challenges of the COVID-19 pandemic, FIND capitalized on its recently launched strategy and achieved its 2021 goals, delivering an average of 81% of programmatic performance objectives (versus 80% target). Outside COVID, four products in FIND’s product development portfolio received regulatory clearance; evidence was generated to support six World Health Organization (WHO) recommendations and policy documents; and 36 clinical studies were conducted, 28 of which relied on newly developed approaches to remote work and remote training. Notably, in 2021, FIND was especially focused on its role in supporting global access to COVID-19 tests and genomic sequencing, through its role in the Access to COVID-19 Tools Accelerator Diagnostics Pillar (ACT-A Dx). In part, this meant engaging substantially with multiple global agencies, and absorbing a large injection of COVID-19 work into ongoing work across FIND’s disease portfolio, including in pandemics threats. + + + Australia - Department of Foreign Affairs and Trade + + + Bill & Melinda Gates Foundation + + + Germany - Ministry for Economic Cooperation and Development + + + Department of Foreign Affairs, trade and development + + + UK - Foreign, Commonwealth and Development Office + + + Gordon & Betty Moore Foundation + + + JHPIEGO + + + Federal Ministry of Education and Research + + + Mission of Kuwait to the United Nations + + + Netherlands - Ministry of Foreign Affairs + + + Norad - Norwegian Agency for Development Cooperation + + + PATH + + + Optum Global Solutions (India) Private Limited + + + Rockefeller Foundation + + + Ministry of Finance, Kingdom of Saudi Arabia + + + Switzerland - Swiss Agency for Development and Cooperation (SDC) + + + The Global Fund to Fight AIDS, Tuberculosis and Malaria + + + Trafigura Foundation + + + UNITAID + + + World Health Organization (WHO) + + + + End of activity + + + Start of activity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + R&D portfolio + + + Access portfolio + + + + + 71189586.11 + + + + + 71189586 + + + + + + 71189586 + + ACT-A Dx annual allocated funds + + + + + + + + 5300364.96 + + Annual amount allocated from the Dutch PDP core grant + + + Dutch Ministry of Foreign Affairs (DGIS), Netherlands + + + Foundation for Innovative New Diagnostics + + + + + + 5300364.96 + + ACT-A Dx annual allocated funds + + + ACT-A Dx annual allocated funds + + + + diff --git a/iatiflattener/tests/fixtures/rates.csv b/iatiflattener/tests/fixtures/rates.csv index 79321be..43424b1 100644 --- a/iatiflattener/tests/fixtures/rates.csv +++ b/iatiflattener/tests/fixtures/rates.csv @@ -4,4 +4,8 @@ Date,Rate,Currency,Frequency,Source 2021-08-31,0.726269155,GBP,M,IMF 2021-08-31,85.2,BDT,M,IMF 2021-08-31,0.702121,XDR,M,IMF -2021-08-31,6.82795,DKK,IMF +2021-08-31,6.82795,DKK,M,IMF +2021-08-31,171.7972,LRD,M,IMF +2021-08-31,3.6725,AED,M,IMF +2021-08-31,642.44255,AOA,M,IMF +2021-08-31,97.64,ARS,M,IMF diff --git a/iatiflattener/tests/fixtures/unops-at.xml b/iatiflattener/tests/fixtures/unops-at-activity.xml similarity index 100% rename from iatiflattener/tests/fixtures/unops-at.xml rename to iatiflattener/tests/fixtures/unops-at-activity.xml diff --git a/iatiflattener/tests/test_csv.py b/iatiflattener/tests/test_csv.py index 9ce6143..9e53b4f 100644 --- a/iatiflattener/tests/test_csv.py +++ b/iatiflattener/tests/test_csv.py @@ -102,7 +102,7 @@ def test_row(self, flattener, package, csvfile): 'transaction_type': '3', 'value_original': '1232.0', 'currency_original': 'GBP', 'value_usd': '1696.3408008150918', 'exchange_rate_date': '2021-08-31', 'exchange_rate': '0.726269155', 'value_eur': '1433.446680400464', - 'value_local': '0.0', + 'value_local': '291426.5998257905', 'transaction_date': '2010-05-27', 'country_code': 'LR', 'multi_country': '0', 'sector_category': '150', 'sector_code': '15110', 'humanitarian': '0', 'fiscal_year': '2010', 'fiscal_quarter': 'Q2', @@ -116,12 +116,51 @@ def test_group_headers_en(self, flattener, package, groupedfile_en): def test_first_row_en(self, flattener, package, groupedfile_en): first_row = [cell.value for cell in next(groupedfile_en.worksheets[0].iter_rows(min_row=2, max_row=2))] - assert first_row == ['GB-1-103662-101', 'PROCOFSERVICES and P0220 for Civil Ser. Cap. Bldng. Liberia', 'GB - United Kingdom', 'UK - Foreign, Commonwealth and Development Office [GB-GOV-1]', '10 - Government', 'C01 - Project-type interventions', '110 - Standard grant', '10 - ODA', 'UK - Foreign, Commonwealth and Development Office [GB-GOV-1]', 'No data', 'Adam Smith International [GB-COH-2732176]', '70 - Private Sector', '3 - Disbursement', 'LR - Liberia', 0, '150 - Government & Civil Society', '15110 - Public sector policy and administrative management', 0, 2010, 'Q2', '2010 Q2', 'https://d-portal.org/q.html?aid=GB-1-103662-101', 1696.34080081509, 1433.44668040046, 0] + assert first_row == ['GB-1-103662-101', + 'PROCOFSERVICES and P0220 for Civil Ser. Cap. Bldng. Liberia', + 'GB - United Kingdom', + 'UK - Foreign, Commonwealth and Development Office [GB-GOV-1]', + '10 - Government', 'C01 - Project-type interventions', + '110 - Standard grant', + '10 - ODA', + 'UK - Foreign, Commonwealth and Development Office [GB-GOV-1]', + 'No data', + 'Adam Smith International [GB-COH-2732176]', + '70 - Private Sector', + '3 - Disbursement', + 'LR - Liberia', + 0, + '150 - Government & Civil Society', + '15110 - Public sector policy and administrative management', + 0, + 2010, + 'Q2', + '2010 Q2', + 'https://d-portal.org/q.html?aid=GB-1-103662-101', + 1696.34080081509, + 1433.44668040046, + 291426.599825791] def test_group_headers_fr(self, flattener, package, groupedfile_fr): headers_row = [cell.value for cell in next(groupedfile_fr.worksheets[0].iter_rows(min_row=1, max_row=1))] - assert headers_row == ['Identifiant de l’IITA', 'Titre', 'Groupe d’organisme déclarant', 'Organisme déclarant', 'Type d’organisme déclarant', 'Type d’aide', 'Type de financement', 'Type de flux', 'Organisme prestataire', 'Type d’organisme prestataire', 'Organisme bénéficiaire', 'Type d’organisme bénéficiaire', 'Type de transaction', 'Pays ou région bénéficiaire', 'Multipays', 'Catégorie de secteur', 'Secteur', 'Humanitaire', 'Année civile', 'Trimestre civil', 'Année et trimestre civils', 'URL', 'Valeur (USD)', 'Valeur (EUR)', 'Valeur (Monnaie locale)'] + assert headers_row == ['Identifiant de l’IITA', + 'Titre', 'Groupe d’organisme déclarant', 'Organisme déclarant', + 'Type d’organisme déclarant', 'Type d’aide', 'Type de financement', + 'Type de flux', 'Organisme prestataire', 'Type d’organisme prestataire', 'Organisme bénéficiaire', 'Type d’organisme bénéficiaire', 'Type de transaction', 'Pays ou région bénéficiaire', 'Multipays', 'Catégorie de secteur', 'Secteur', 'Humanitaire', 'Année civile', 'Trimestre civil', 'Année et trimestre civils', 'URL', 'Valeur (USD)', 'Valeur (EUR)', 'Valeur (Monnaie locale)'] def test_first_row_fr(self, flattener, package, groupedfile_fr): first_row = [cell.value for cell in next(groupedfile_fr.worksheets[0].iter_rows(min_row=2, max_row=2))] - assert first_row == ['GB-1-103662-101', 'PROCOFSERVICES and P0220 for Civil Ser. Cap. Bldng. Liberia', 'GB - Royaume-Uni (le)', 'Royaume-Uni – Ministère des Affaires étrangères, du Commonwealth et du ' 'Développement [GB-GOV-1]', '10 - Gouvernement', 'C01 - Interventions de type projet', '110 - Dons ordinaires', '10 - APD', 'Royaume-Uni – Ministère des Affaires étrangères, du Commonwealth et du ' 'Développement [GB-GOV-1]', 'Aucune donnée', 'Adam Smith International [GB-COH-2732176]', '70 - Secteur privé', '3 - Décaissement', 'LR - Libéria (le)', 0, '150 - Gouvernement & Société Civile', '15110 - Politiques publiques et gestion administrative', 0, 2010, 'Q2', '2010 Q2', 'https://d-portal.org/q.html?aid=GB-1-103662-101', 1696.34080081509, 1433.44668040046, 0] + assert first_row == ['GB-1-103662-101', 'PROCOFSERVICES and P0220 for Civil Ser. Cap. Bldng. Liberia', + 'GB - Royaume-Uni (le)', + 'Royaume-Uni – Ministère des Affaires étrangères, du Commonwealth et du ' 'Développement [GB-GOV-1]', + '10 - Gouvernement', 'C01 - Interventions de type projet', '110 - Dons ordinaires', + '10 - APD', + 'Royaume-Uni – Ministère des Affaires étrangères, du Commonwealth et du ' 'Développement [GB-GOV-1]', + 'Aucune donnée', 'Adam Smith International [GB-COH-2732176]', + '70 - Secteur privé', '3 - Décaissement', 'LR - Libéria (le)', 0, + '150 - Gouvernement & Société Civile', + '15110 - Politiques publiques et gestion administrative', 0, 2010, 'Q2', '2010 Q2', + 'https://d-portal.org/q.html?aid=GB-1-103662-101', + 1696.34080081509, + 1433.44668040046, + 291426.599825791] diff --git a/iatiflattener/tests/test_transaction.py b/iatiflattener/tests/test_transaction.py index deefb96..1ec5fe4 100644 --- a/iatiflattener/tests/test_transaction.py +++ b/iatiflattener/tests/test_transaction.py @@ -5,12 +5,11 @@ from iatiflattener import model from lxml import etree -exchange_rates = exchangerates.CurrencyConverter( - update=False, source="iatiflattener/tests/fixtures/rates.csv") +exchange_rates = exchangerates.CurrencyConverter(update=False, source="iatiflattener/tests/fixtures/rates.csv") assert "GBP" in exchange_rates.known_currencies() -countries_currencies = {'BD': 'BDT'} +countries_currencies = {'AE': 'AED', 'AO': 'AOA', 'AR': 'ARS', 'BD': 'BDT', 'LR': 'LRD', 'AT': 'EUR'} def write_outputs(publisher, transaction, flat_transaction_json): @@ -20,8 +19,7 @@ def write_outputs(publisher, transaction, flat_transaction_json): json_file.write(flat_transaction_json) -@pytest.mark.parametrize("publisher", ["fcdo", "canada", "usaid", "usaid-humanitarian", "ifad"]) -class TestModel(): +class TestModel: @pytest.fixture() def node(self, publisher): @@ -33,53 +31,175 @@ def transaction(self, node): activity_cache = model.ActivityCache() _transaction_node = node _activity_node = _transaction_node.getparent() - _transaction = model.Transaction(_activity_node, _transaction_node, - activity_cache, exchange_rates, countries_currencies) + _transaction = model.Transaction(_activity_node, _transaction_node, activity_cache, + exchange_rates, countries_currencies) _transaction.generate() return _transaction @pytest.fixture - def flat_transaction(self, transaction): + def flat_transaction_first_item(self, transaction): _flat_transaction = model.FlatTransaction(transaction) return list(_flat_transaction.flatten())[0] + @pytest.fixture + def transaction_flattened_as_list(self, transaction): + _flat_transaction = model.FlatTransaction(transaction) + return list(_flat_transaction.flatten()) + @pytest.fixture def flat_transaction_json(self, transaction): _flat_transaction = model.FlatTransaction(transaction) return list(_flat_transaction.flatten_json())[0] + @pytest.mark.parametrize("publisher", ["fcdo", "canada", "usaid", "usaid-humanitarian", "ifad"]) def test_as_dict(self, publisher, transaction): with open('iatiflattener/tests/artefacts/{}-transaction.json'.format(publisher), 'r') as json_file: assert transaction.jsonify() == json_file.read() + @pytest.mark.parametrize("publisher", ["fcdo", "canada", "usaid", "usaid-humanitarian", "ifad"]) def test_flat_transaction(self, publisher, transaction, flat_transaction_json): with open('iatiflattener/tests/artefacts/{}-transaction-flat.json'.format(publisher), 'r') as json_file: assert flat_transaction_json == json_file.read() - def test_flat_transaction_values(self, transaction, flat_transaction): + @pytest.mark.parametrize("publisher", ["fcdo", "canada", "usaid", "usaid-humanitarian", "ifad"]) + def test_flat_transaction_usd_values(self, transaction, flat_transaction_first_item): """ Confirm that the flat transaction value is the USD value * country percentage * sector percentage """ - country = flat_transaction['country_code'] + country = flat_transaction_first_item['country_code'] transaction_dict = transaction.as_dict() country_pct = list(filter(lambda _country: _country['code'] == country, transaction_dict['countries']))[0]['percentage'] - sector = flat_transaction['sector_code'] + sector = flat_transaction_first_item['sector_code'] sector_pct = list(filter(lambda _sector: _sector['code'] == sector, transaction_dict['sectors']))[0]['percentage'] - assert flat_transaction['value_usd'] == transaction_dict['value_usd'] * (country_pct/100) * (sector_pct/100) + assert flat_transaction_first_item['value_usd'] == transaction_dict['value_usd'] * (country_pct / 100) * (sector_pct / 100) - def test_humanitarian(self, publisher, transaction, flat_transaction): + @pytest.mark.parametrize("publisher", ["fcdo", "canada", "usaid", "usaid-humanitarian", "ifad"]) + def test_humanitarian(self, publisher, transaction, flat_transaction_first_item): """Checks to see if humanitarian transactions are set correctly""" if publisher == 'usaid-humanitarian': assert transaction.humanitarian.transaction.get('humanitarian', False) in ('1', True) - assert flat_transaction['humanitarian'] == 1 + assert flat_transaction_first_item['humanitarian'] == 1 else: assert transaction.humanitarian.transaction.get('humanitarian', False) in ('0', False) - assert flat_transaction['humanitarian'] == 0 + assert flat_transaction_first_item['humanitarian'] == 0 + @pytest.mark.parametrize("publisher", ["fcdo", "canada", "usaid", "usaid-humanitarian", "ifad"]) def _test_write_outputs(self, publisher, transaction, flat_transaction_json): """ Remove the underscore to enable writing, if you update any of the outputs. """ write_outputs(publisher, transaction, flat_transaction_json) + @pytest.mark.parametrize("publisher", ["fcdo", "canada", "ifad", "gdihub", "finddiagnostics", "beis"]) + def test_transaction_value_usd(self, publisher, transaction): + """Tests the `value_usd` field on transactions for the first transaction in each file""" + + expected_data = {'fcdo': 1232 / 0.726269155, # GBP + 'canada': 1664612 / 1.2617, # CAD + 'ifad': 9480000 / 0.702121, # XDR + 'gdihub': 56826.74 / 0.726269155, # GBP + "finddiagnostics": 71189586, # USD + "beis": 5172459.0 / 0.726269155} # GBP + + assert transaction.value_usd.value == expected_data[publisher] + + @pytest.mark.parametrize("publisher", ["fcdo", "canada", "ifad", "gdihub", "finddiagnostics", "beis"]) + def test_transaction_value_original(self, publisher, transaction): + """Tests the `value_original` field on transactions for the first transaction in each file""" + + expected_data = {'fcdo': 1232, # GBP + 'canada': 1664612, # CAD + 'ifad': 9480000, # XDR + 'gdihub': 56826.74, # GBP + "finddiagnostics": 71189586, # USD + "beis": 5172459.0} # GBP + + assert transaction.value_original.value == expected_data[publisher] + + @pytest.mark.parametrize("publisher", ["fcdo", "ifad", "unops-at"]) + def test_transaction_value_local(self, publisher, transaction): + """Tests the `value_original` field on transactions for the first transaction in each file""" + + expected_data = {'fcdo': {'LR': 1232 / 0.726269155 * 171.7972}, # GBP -> USD -> LRD + 'ifad': {'LR': 9480000 / 0.702121 * 171.7972}, # XDR -> USD -> LRD + 'unops-at': {'AT': 1321549 * 0.845022816} # GBP + } + + assert transaction.value_local.value == expected_data[publisher] + + @pytest.mark.parametrize("publisher", ["fcdo", "finddiagnostics"]) + def test_flat_transaction_value_usd(self, publisher, transaction, transaction_flattened_as_list): + """Tests the `value_usd` field on transactions for the few flattened transaction items""" + + expected_data = {'fcdo': {'LR': {'15110': 1232 / 0.726269155}}, + "finddiagnostics": {'AO': {'32182': (71189586 / 100) * 0.18 * 0.72, + '12210': (71189586 / 100) * 0.18 * 0.28}, + 'AE': {'32182': (71189586 / 100) * 0.01 * 0.72, + '12210': (71189586 / 100) * 0.01 * 0.28}, + 'AR': {'32182': (71189586 / 100) * 0.01 * 0.72, + '12210': (71189586 / 100) * 0.01 * 0.28}, + 'AT': {'32182': (71189586 / 100) * 0.0001 * 0.72, + '12210': (71189586 / 100) * 0.0001 * 0.28}, + }} + + for country_code in expected_data[publisher]: + for sector_code in expected_data[publisher][country_code]: + for transaction_entry in transaction_flattened_as_list: + if transaction_entry['country_code'] == country_code \ + and transaction_entry['sector_code'] == sector_code: + assert (transaction_entry['value_usd'] == + pytest.approx(expected_data[publisher][country_code][sector_code])) + + @pytest.mark.parametrize("publisher", ["fcdo", "finddiagnostics"]) + def test_flat_transaction_value_original(self, publisher, transaction, + transaction_flattened_as_list): + """Tests the `value_original` field on transactions for the few flattened transaction items""" + + expected_data = {'fcdo': {'LR': {'15110': 1232}}, # original currency here is GBP + "finddiagnostics": {'AO': {'32182': (71189586 / 100) * 0.18 * 0.72, # same as value_usd test + '12210': (71189586 / 100) * 0.18 * 0.28}, # b/c original is USD + 'AE': {'32182': (71189586 / 100) * 0.01 * 0.72, + '12210': (71189586 / 100) * 0.01 * 0.28}, + 'AR': {'32182': (71189586 / 100) * 0.01 * 0.72, + '12210': (71189586 / 100) * 0.01 * 0.28}, + 'AT': {'32182': (71189586 / 100) * 0.0001 * 0.72, + '12210': (71189586 / 100) * 0.0001 * 0.28}, + }} + + for country_code in expected_data[publisher]: + for sector_code in expected_data[publisher][country_code]: + for transaction_entry in transaction_flattened_as_list: + if transaction_entry['country_code'] == country_code \ + and transaction_entry['sector_code'] == sector_code: + assert (transaction_entry['value_original'] == + pytest.approx(expected_data[publisher][country_code][sector_code])) + + @pytest.mark.parametrize("publisher", ["fcdo", "finddiagnostics"]) + def test_flat_transaction_value_local(self, publisher, transaction, transaction_flattened_as_list): + """Tests the `value_local` field on transactions for the first transaction in each file""" + + # fcdo: value_original is in GBP, so convert to US dollars, then to Liberian dollars. there is only a single + # country or sector, so no splitting + # finddiagnostics: value_original is in USD, so convert to percent, then split by country, then sector, then + # multiply by the appropriate currency for value_local (Angolan Kwanza, UAE Dirham, Argentine + # Peso, and EUR respectively) + expected_data = {'fcdo': {'LR': {'15110': (1232 / 0.726269155) * 171.7972}}, + "finddiagnostics": {'AO': {'32182': (71189586 / 100) * 0.18 * 0.72 * 642.44255, + '12210': (71189586 / 100) * 0.18 * 0.28 * 642.44255}, + 'AE': {'32182': (71189586 / 100) * 0.01 * 0.72 * 3.6725, + '12210': (71189586 / 100) * 0.01 * 0.28 * 3.6725}, + 'AR': {'32182': (71189586 / 100) * 0.01 * 0.72 * 97.64, + '12210': (71189586 / 100) * 0.01 * 0.28 * 97.64}, + 'AT': {'32182': (71189586 / 100) * 0.0001 * 0.72 * 0.845022816, + '12210': (71189586 / 100) * 0.0001 * 0.28 * 0.845022816}, + }} + + for country_code in expected_data[publisher]: + for sector_code in expected_data[publisher][country_code]: + for transaction_entry in transaction_flattened_as_list: + if transaction_entry['country_code'] == country_code \ + and transaction_entry['sector_code'] == sector_code: + assert (transaction_entry['value_local'][country_code] == + pytest.approx(expected_data[publisher][country_code][sector_code])) + From c2ba8b25b83ba91a1ddb6b51b88d2ae7a61324bc Mon Sep 17 00:00:00 2001 From: Simon <6615834+simon-20@users.noreply.github.com> Date: Tue, 14 Nov 2023 11:30:59 +0000 Subject: [PATCH 2/2] Update test calculations to read in more logical way --- iatiflattener/tests/test_transaction.py | 39 +++++++++++++------------ 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/iatiflattener/tests/test_transaction.py b/iatiflattener/tests/test_transaction.py index 1ec5fe4..1b5f2e1 100644 --- a/iatiflattener/tests/test_transaction.py +++ b/iatiflattener/tests/test_transaction.py @@ -157,14 +157,14 @@ def test_flat_transaction_value_original(self, publisher, transaction, """Tests the `value_original` field on transactions for the few flattened transaction items""" expected_data = {'fcdo': {'LR': {'15110': 1232}}, # original currency here is GBP - "finddiagnostics": {'AO': {'32182': (71189586 / 100) * 0.18 * 0.72, # same as value_usd test - '12210': (71189586 / 100) * 0.18 * 0.28}, # b/c original is USD - 'AE': {'32182': (71189586 / 100) * 0.01 * 0.72, - '12210': (71189586 / 100) * 0.01 * 0.28}, - 'AR': {'32182': (71189586 / 100) * 0.01 * 0.72, - '12210': (71189586 / 100) * 0.01 * 0.28}, - 'AT': {'32182': (71189586 / 100) * 0.0001 * 0.72, - '12210': (71189586 / 100) * 0.0001 * 0.28}, + "finddiagnostics": {'AO': {'32182': 71189586 * 0.0018 * 0.72, # same as value_usd test + '12210': 71189586 * 0.0018 * 0.28}, # b/c original is USD + 'AE': {'32182': 71189586 * 0.0001 * 0.72, + '12210': 71189586 * 0.0001 * 0.28}, + 'AR': {'32182': 71189586 * 0.0001 * 0.72, + '12210': 71189586 * 0.0001 * 0.28}, + 'AT': {'32182': 71189586 * 0.000001 * 0.72, + '12210': 71189586 * 0.000001 * 0.28}, }} for country_code in expected_data[publisher]: @@ -181,18 +181,19 @@ def test_flat_transaction_value_local(self, publisher, transaction, transaction_ # fcdo: value_original is in GBP, so convert to US dollars, then to Liberian dollars. there is only a single # country or sector, so no splitting - # finddiagnostics: value_original is in USD, so convert to percent, then split by country, then sector, then - # multiply by the appropriate currency for value_local (Angolan Kwanza, UAE Dirham, Argentine - # Peso, and EUR respectively) + # finddiagnostics: value_original is in USD, so just split by country, then + # sector, then multiply by the appropriate currency for + # value_local (Angolan Kwanza, UAE Dirham, Argentine Peso, and + # EUR respectively) expected_data = {'fcdo': {'LR': {'15110': (1232 / 0.726269155) * 171.7972}}, - "finddiagnostics": {'AO': {'32182': (71189586 / 100) * 0.18 * 0.72 * 642.44255, - '12210': (71189586 / 100) * 0.18 * 0.28 * 642.44255}, - 'AE': {'32182': (71189586 / 100) * 0.01 * 0.72 * 3.6725, - '12210': (71189586 / 100) * 0.01 * 0.28 * 3.6725}, - 'AR': {'32182': (71189586 / 100) * 0.01 * 0.72 * 97.64, - '12210': (71189586 / 100) * 0.01 * 0.28 * 97.64}, - 'AT': {'32182': (71189586 / 100) * 0.0001 * 0.72 * 0.845022816, - '12210': (71189586 / 100) * 0.0001 * 0.28 * 0.845022816}, + "finddiagnostics": {'AO': {'32182': 71189586 * 0.0018 * 0.72 * 642.44255, + '12210': 71189586 * 0.0018 * 0.28 * 642.44255}, + 'AE': {'32182': 71189586 * 0.0001 * 0.72 * 3.6725, + '12210': 71189586 * 0.0001 * 0.28 * 3.6725}, + 'AR': {'32182': 71189586 * 0.0001 * 0.72 * 97.64, + '12210': 71189586 * 0.0001 * 0.28 * 97.64}, + 'AT': {'32182': 71189586 * 0.000001 * 0.72 * 0.845022816, + '12210': 71189586 * 0.000001 * 0.28 * 0.845022816}, }} for country_code in expected_data[publisher]: