Coverage for src/ensae_teaching_cs/data/data1a.py: 100%
7 statements
« prev ^ index » next coverage.py v7.1.0, created at 2023-04-28 06:23 +0200
« prev ^ index » next coverage.py v7.1.0, created at 2023-04-28 06:23 +0200
1"""
2@file
3@brief Data mostly for the first year.
4"""
5from .data_helper import any_local_file
8def anyfile(name, local=True, cache_folder=".", filename=True):
9 """
10 Returns any file in sub folder `data_1a <https://github.com/sdpython/ensae_teaching_cs/tree/master/src/ensae_teaching_cs/data/data_1a>`_.
12 @param name file to download
13 @param local local data or web
14 @param cache_folder where to cache the data if downloaded a second time
15 @param filename return the filename (True) or the content (False)
16 @return text content (str)
17 """
18 return any_local_file(name, "data_1a", cache_folder=cache_folder, filename=filename)
21def marathon(local=True, cache_folder=".", filename=True):
22 """
23 Time about marathons over cities and years
24 See :func:`ensae_teaching_cs.data.data1a.anyfile` to
25 directly download it.
27 @param local local data or web
28 @param cache_folder where to cache the data if downloaded a second time
29 @param filename return the filename (True) or the content (False)
30 @return text content (str)
31 """
32 return anyfile("marathon.txt", local=local, cache_folder=cache_folder, filename=filename)
35def donnees_enquete_2003_television(local=True, cache_folder=".", filename=True):
36 """
37 Time about marathons over cities and years
38 See :func:`ensae_teaching_cs.data.data1a.anyfile` to
39 directly download it.
41 @param local local data or web
42 @param cache_folder where to cache the data if downloaded a second time
43 @param filename return the filename (True) or the content (False)
44 @return text content (str)
45 """
46 return anyfile("donnees_enquete_2003_television.txt", local=local, cache_folder=cache_folder, filename=filename)