@@ -34,37 +34,50 @@ First, let us take a look at the folder and file structure of such a project.
34
34
35
35
.. code-block ::
36
36
37
- src
38
- │ config.py
37
+ my_project
38
+ ├───pytask.ini or tox.ini or setup.cfg
39
39
│
40
- ├───data
41
- │ data_0.csv
42
- │ data_1.csv
43
- │ data_2.csv
44
- │ data_3.csv
40
+ ├───src
41
+ │ └───my_project
42
+ │ ├────config.py
43
+ │ │
44
+ │ ├───data
45
+ │ │ ├────data_0.csv
46
+ │ │ ├────data_1.csv
47
+ │ │ ├────data_2.csv
48
+ │ │ └────data_3.csv
49
+ │ │
50
+ │ ├───data_preparation
51
+ │ │ ├────data_preparation_config.py
52
+ │ │ └────task_prepare_data.py
53
+ │ │
54
+ │ └───estimation
55
+ │ ├────estimation_config.py
56
+ │ └────task_estimate_models.py
45
57
│
46
- ├───data_preparation
47
- │ data_preparation_config.py
48
- │ task_prepare_data.py
49
58
│
50
- └───estimation
51
- estimation_config.py
52
- task_estimate_models.py
59
+ ├───setup.py
60
+ │
61
+ ├───.pytask.sqlite3
62
+ │
63
+ └───bld
64
+
65
+
53
66
54
67
The folder structure, the general ``config.py `` which holds ``SRC `` and ``BLD `` and the
55
68
tasks follow the same structure which is advocated for throughout the tutorials.
56
69
57
- What is new are the local configuration files in each of the subfolders of `` src `` which
58
- contain objects which are shared across tasks. For example,
70
+ What is new are the local configuration files in each of the subfolders of
71
+ `` my_project `` which contain objects which are shared across tasks. For example,
59
72
``data_preparation_config.py `` holds the paths to the processed data and the names of
60
73
the data sets.
61
74
62
75
.. code-block :: python
63
76
64
77
# Content of data_preparation_config.py
65
78
66
- from src .config import BLD
67
- from src .config import SRC
79
+ from my_project .config import BLD
80
+ from my_project .config import SRC
68
81
69
82
70
83
DATA = [" data_0" , " data_1" , " data_2" , " data_3" ]
@@ -87,9 +100,9 @@ parametrization.
87
100
88
101
import pytask
89
102
90
- from src .data_preparation.data_preparation_config import DATA
91
- from src .data_preparation.data_preparation_config import path_to_input_data
92
- from src .data_preparation.data_preparation_config import path_to_processed_data
103
+ from my_project .data_preparation.data_preparation_config import DATA
104
+ from my_project .data_preparation.data_preparation_config import path_to_input_data
105
+ from my_project .data_preparation.data_preparation_config import path_to_processed_data
93
106
94
107
95
108
def _create_parametrization (data ):
@@ -121,7 +134,7 @@ an explicit id.
121
134
.. code-block ::
122
135
123
136
# With id
124
- .../src /data_preparation/task_prepare_data.py::task_prepare_data[data_0]
137
+ .../my_project /data_preparation/task_prepare_data.py::task_prepare_data[data_0]
125
138
126
139
Next, we move to the estimation to see how we can build another parametrization upon the
127
140
previous one.
@@ -130,8 +143,8 @@ previous one.
130
143
131
144
# Content of estimation_config.py
132
145
133
- from src .config import BLD
134
- from src .data_preparation.data_preparation_config import DATA
146
+ from my_project .config import BLD
147
+ from my_project .data_preparation.data_preparation_config import DATA
135
148
136
149
137
150
_MODELS = [" linear_probability" , " logistic_model" , " decision_tree" ]
@@ -164,9 +177,9 @@ And, here is the task file.
164
177
165
178
import pytask
166
179
167
- from src .data_preparation.data_preparation_config import path_to_processed_data
168
- from src .data_preparation.estimation_config import ESTIMATIONS
169
- from src .data_preparation.estimation_config import path_to_estimation_result
180
+ from my_project .data_preparation.data_preparation_config import path_to_processed_data
181
+ from my_project .data_preparation.estimation_config import ESTIMATIONS
182
+ from my_project .data_preparation.estimation_config import path_to_estimation_result
170
183
171
184
172
185
def _create_parametrization (estimations ):
0 commit comments