From 7a0433f3743d1a88eeed22c8867f57d4704610be Mon Sep 17 00:00:00 2001 From: Giovanni Squillero Date: Wed, 10 Jul 2024 00:47:24 +1000 Subject: [PATCH] Update --- Python/exams/armstrong/evaluation-grid.md | 0 Python/exams/ascii-stats/evaluation-grid.md | 0 Python/exams/connect-four/evaluation-grid.md | 0 Python/exams/consumption+production/README.md | 2 +- .../consumption+production/consumption+production.py | 9 ++++++--- Python/exams/worms/README.md | 0 6 files changed, 7 insertions(+), 4 deletions(-) mode change 100755 => 100644 Python/exams/armstrong/evaluation-grid.md mode change 100755 => 100644 Python/exams/ascii-stats/evaluation-grid.md mode change 100755 => 100644 Python/exams/connect-four/evaluation-grid.md mode change 100755 => 100644 Python/exams/worms/README.md diff --git a/Python/exams/armstrong/evaluation-grid.md b/Python/exams/armstrong/evaluation-grid.md old mode 100755 new mode 100644 diff --git a/Python/exams/ascii-stats/evaluation-grid.md b/Python/exams/ascii-stats/evaluation-grid.md old mode 100755 new mode 100644 diff --git a/Python/exams/connect-four/evaluation-grid.md b/Python/exams/connect-four/evaluation-grid.md old mode 100755 new mode 100644 diff --git a/Python/exams/consumption+production/README.md b/Python/exams/consumption+production/README.md index f5de3574..6309911a 100644 --- a/Python/exams/consumption+production/README.md +++ b/Python/exams/consumption+production/README.md @@ -1,4 +1,4 @@ -# Consumption and Production Analysis +# CONSUMPTION AND PRODUCTION ANALYSIS An energy company has collected the energy consumption of a series of households by sampling data every 15 minutes. The company wants to estimate the energy benefit of installing photovoltaic systems in various households. For each household, the size of the installable photovoltaic system (in m2) and the system's efficiency are known. Additionally, the company has collected solar radiation data for the area of interest. The goal is to analyze these data to calculate self-consumption, self-sufficiency, self-consumed energy, produced energy, and energy fed into the grid for each household (and for the aggregate of households). To do this, various indicators need to be calculated and a statistics report generated. diff --git a/Python/exams/consumption+production/consumption+production.py b/Python/exams/consumption+production/consumption+production.py index 2aa0aaee..a612de21 100644 --- a/Python/exams/consumption+production/consumption+production.py +++ b/Python/exams/consumption+production/consumption+production.py @@ -13,9 +13,12 @@ def read_data(filename): """Read a CSV file and return an unrolled list of dictionaries.""" - with open(filename, newline='') as csvfile: - reader = DictReader(csvfile, delimiter=';') - data = list(reader) + try: + with open(filename, newline='') as csvfile: + reader = DictReader(csvfile, delimiter=';') + data = list(reader) + except OSError as problem: + exit(f"{filename}: {problem}") return data diff --git a/Python/exams/worms/README.md b/Python/exams/worms/README.md old mode 100755 new mode 100644