Skip to content

Commit

Permalink
annual-reports: fix subjects
Browse files Browse the repository at this point in the history
  • Loading branch information
drjova committed Nov 13, 2023
1 parent dfe2f9c commit 9f2d7d4
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion annual-reports/src/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,38 @@ def _backoff_handler(details):
)


ONLY_CERN_SUBJECTS = [
"Particle Physics - Experiment",
"Particle Physics - Phenomenology",
"Particle Physics - Theory",
"Particle Physics - Lattice",
"Nuclear Physics - Experiment",
"Nuclear Physics - Theory",
"General Relativity and Cosmology",
"General Theoretical Physics",
"Detectors and Experimental Techniques",
"Accelerators and Storage Rings",
"Health Physics and Radiation Effects",
"Computing and Computers",
"Mathematical Physics and Mathematics",
"Astrophysics and Astronomy",
"Nonlinear Systems",
"Condensed Matter",
"Other Fields of Physics",
"Chemical Physics and Chemistry",
"Engineering",
"Information Transfer and Management",
"Physics in General",
"Commerce, Economics, Social Science",
"Biography, Geography, History",
"Other Subjects",
"Science in General",
"Quantum Technology",
"Education and Outreach",
"Popular Science",
]


class AnnualReportsAPI:
def __init__(
self,
Expand Down Expand Up @@ -122,7 +154,7 @@ def get_subjects_by_year(self, year):
subjects = {}
for subject in yearly_report.findall("line"):
name = subject.find("result").text
if "TOTAL" in name:
if "TOTAL" in name or name not in ONLY_CERN_SUBJECTS:
continue
subjects[name] = subject.find("nb").text
return subjects
Expand Down

0 comments on commit 9f2d7d4

Please sign in to comment.