Skip to content

Commit

Permalink
Update countries attributes (#351)
Browse files Browse the repository at this point in the history
* Update countries attributes

* Update copyright

* Bump nomenclature requirement version

* Switch black to ruff

* Ruff reformatting
  • Loading branch information
dc-almeida authored Oct 3, 2024
1 parent 3176f88 commit 09c0e05
Show file tree
Hide file tree
Showing 11 changed files with 227 additions and 200 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Ruff
on: [ push, pull_request ]
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# Project definitions for the openENTRANCE project

Copyright 2020-2023 openENTRANCE consortium
Copyright 2020-2024 openENTRANCE consortium

This repository is licensed under the Apache License, Version 2.0 (the "License"); see
the [LICENSE](LICENSE) for details.

[![license](https://img.shields.io/badge/License-Apache%202.0-black)](https://github.com/openENTRANCE/openentrance/blob/main/LICENSE)
[![python](https://img.shields.io/badge/python-3.7_|_3.8_|_3.9-blue?logo=python&logoColor=white)](https://github.com/openENTRANCE/openentrance)
[![Code style:
black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

## Aim and scope of this repository

Expand Down
92 changes: 46 additions & 46 deletions definitions/region/countries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,233 +7,233 @@
eu_member: false
iso2: AL
iso3: ALB
iso3_codes: ALB
countries: [Albania]
- Andorra:
eu_member: false
iso2: AD
iso3: AND
iso3_codes: AND
countries: [Andorra]
- Austria:
eu_member: true
iso2: AT
iso3: AUT
iso3_codes: AUT
countries: [Austria]
- Belarus:
eu_member: false
iso2: BY
iso3: BLR
iso3_codes: BLR
countries: [Belarus]
- Belgium:
eu_member: true
iso2: BE
iso3: BEL
iso3_codes: BEL
countries: [Belgium]
- Bosnia and Herzegovina:
eu_member: false
iso2: BA
iso3: BIH
iso3_codes: BIH
countries: [Bosnia and Herzegovina]
- Bulgaria:
eu_member: true
iso2: BG
iso3: BGR
iso3_codes: BGR
countries: [Bulgaria]
- Croatia:
eu_member: true
iso2: HR
iso3: HRV
iso3_codes: HRV
countries: [Croatia]
- Cyprus:
eu_member: true
iso2: CY
iso3: CYP
iso3_codes: CYP
countries: [Cyprus]
- Czech Republic:
eu_member: true
iso2: CZ
iso3: CZE
iso3_codes: CZE
countries: [Czechia]
- Denmark:
eu_member: true
iso2: DK
iso3: DNK
iso3_codes: DNK
countries: [Denmark]
- Estonia:
eu_member: true
iso2: EE
iso3: EST
iso3_codes: EST
countries: [Estonia]
- Finland:
eu_member: true
iso2: FI
iso3: FIN
iso3_codes: FIN
countries: [Finland]
- France:
eu_member: true
iso2: FR
iso3: FRA
iso3_codes: FRA
countries: [France]
- Germany:
eu_member: true
iso2: DE
iso3: DEU
iso3_codes: DEU
countries: [Germany]
- Gibraltar:
eu_member: false
iso2: GI
iso3: GIB
iso3_codes: GIB
countries: [Gibraltar]
- Greece:
eu_member: true
iso2: GR
iso2_alt: EL # the European Commission uses alternative ISO2 codes
iso3: GRC
iso3_codes: GRC
countries: [Greece]
- Hungary:
eu_member: true
iso2: HU
iso3: HUN
iso3_codes: HUN
countries: [Hungary]
- Iceland:
eu_member: false
iso2: IS
iso3: ISL
iso3_codes: ISL
countries: [Iceland]
- Ireland:
eu_member: true
iso2: IE
iso3: IRL
iso3_codes: IRL
countries: [Ireland]
- Italy:
eu_member: true
iso2: IT
iso3: ITA
iso3_codes: ITA
countries: [Italy]
- Kosovo:
eu_member: false
iso2: XK
iso3: XKX
# this ISO3 code is not recognized by the pycountry package
countries: [Kosovo]
- Latvia:
eu_member: true
iso2: LV
iso3: LVA
iso3_codes: LVA
countries: [Latvia]
- Liechtenstein:
eu_member: false
iso2: LI
iso3: LIE
iso3_codes: LIE
countries: [Liechtenstein]
- Lithuania:
eu_member: true
iso2: LT
iso3: LTU
iso3_codes: LTU
countries: [Lithuania]
- Luxembourg:
eu_member: true
iso2: LU
iso3: LUX
iso3_codes: LUX
countries: [Luxembourg]
- Malta:
eu_member: true
iso2: MT
iso3: MLT
iso3_codes: MLT
countries: [Malta]
- Moldova:
eu_member: false
iso2: MD
iso3: MDA
iso3_codes: MDA
countries: [Moldova]
- Monaco:
eu_member: false
iso2: MC
iso3: MCO
iso3_codes: MCO
countries: [Monaco]
- Montenegro:
eu_member: false
iso2: ME
iso3: MNE
iso3_codes: MNE
countries: [Montenegro]
- North Macedonia:
eu_member: false
iso2: MK
iso3: MKD
iso3_codes: MKD
countries: [North Macedonia]
- Norway:
eu_member: false
iso2: 'NO'
iso3: NOR
iso3_codes: NOR
countries: [Norway]
- Poland:
eu_member: true
iso2: PL
iso3: POL
iso3_codes: POL
countries: [Poland]
- Portugal:
eu_member: true
iso2: PT
iso3: PRT
iso3_codes: PRT
countries: [Portugal]
- Romania:
eu_member: true
iso2: RO
iso3: ROU
iso3_codes: ROU
countries: [Romania]
- Russia:
eu_member: false
iso2: RU
iso3: RUS
iso3_codes: RUS
countries: [Russian Federation]
- Serbia:
eu_member: false
iso2: RS
iso3: SRB
iso3_codes: SRB
countries: [Serbia]
- Slovakia:
eu_member: true
iso2: SK
iso3: SVK
iso3_codes: SVK
countries: [Slovakia]
- Slovenia:
eu_member: true
iso2: SI
iso3: SVN
iso3_codes: SVN
countries: [Slovenia]
- Spain:
eu_member: true
iso2: ES
iso3: ESP
iso3_codes: ESP
countries: [Spain]
- Sweden:
eu_member: true
iso2: SE
iso3: SWE
iso3_codes: SWE
countries: [Sweden]
- Switzerland:
eu_member: false
iso2: CH
iso3: CHE
iso3_codes: CHE
countries: [Switzerland]
- The Netherlands:
eu_member: true
iso2: NL
iso3: NLD
iso3_codes: NLD
countries: [Netherlands]
synonyms: ['Netherlands']
- Turkey:
eu_member: false
iso2: TR
iso3: TUR
iso3_codes: TUR
countries: [Turkey]
- Ukraine:
eu_member: false
iso2: UA
iso3: UKR
iso3_codes: UKR
countries: [Ukraine]
- United Kingdom:
eu_member: false
iso2: GB
iso2_alt: UK # the European Commission uses alternative ISO2 codes
iso3: GBR
iso3_codes: GBR
countries: [United Kingdom]
synonyms: ['Great Britain']
3 changes: 1 addition & 2 deletions definitions/region/data/write-nuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

# open the three files and write headers
files = []
for (n, text) in descriptions:
for n, text in descriptions:
file = open(f"../nuts{n}.yaml", "w")
file.write(f"# This file was created using the script `data/{this}`\n")
file.write("# DO NOT ALTER THIS FILE MANUALLY!\n\n")
Expand All @@ -40,7 +40,6 @@
# iterate over dataframe and parse codes and names
country, _n1, _n2 = None, None, None
for i, row in df.iterrows():

if str(row["Code 2021"]) == "nan":
continue

Expand Down
24 changes: 12 additions & 12 deletions definitions/region/european-regions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,35 +90,35 @@
- INNOPATHS regions:
- Germany (IP):
innopaths: DEU
countries: Germany
countries: [Germany]
- Eastern Europe (IP):
innopaths: ECE
countries: Czech Republic, Estonia, Latvia, Lithuania, Poland, Slovakia
countries: [Czechia, Estonia, Latvia, Lithuania, Poland, Slovakia]
- Scandinavia (IP):
innopaths: ENC
countries: Denmark, Finland, Sweden
countries: [Denmark, Finland, Sweden]
- South-East Europe (IP):
innopaths: ECS
countries: Bulgaria, Croatia, Hungary, Romania, Slovenia
countries: [Bulgaria, Croatia, Hungary, Romania, Slovenia]
- Southern Europe (IP):
innopaths: ESC
countries: Cyprus, Greece, Italy, Malta
countries: [Cyprus, Greece, Italy, Malta]
- Iberian Peninsula (IP):
innopaths: ESW
countries: Portugal, Spain
countries: [Portugal, Spain]
- Central Europe (IP):
innopaths: EWN
countries: Austria, Belgium, Luxembourg, Netherlands
countries: [Austria, Belgium, Luxembourg, Netherlands]
- France (IP):
innopaths: FRA
countries: France
countries: [France]
- United Kingdom & Ireland (IP):
innopaths: UKI
countries: UK, Ireland
countries: [United Kingdom, Ireland]
- Northern non-EU Europe (IP):
innopaths: NEN
countries: Iceland, Liechtenstein, Norway, Switzerland
countries: [Iceland, Liechtenstein, Norway, Switzerland]
- Southern non-EU Europe (IP):
innopaths: NES
countries: Albania, Andorra, Bosnia and Herzegovina, North Macedonia, Monaco,
Montenegro, Serbia, Turkey
countries: [Albania, Andorra, Bosnia and Herzegovina, North Macedonia, Monaco,
Montenegro, Serbia, Turkey]
Loading

0 comments on commit 09c0e05

Please sign in to comment.