You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-7Lines changed: 17 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,11 @@ results in a database. Errors that occur during execution are also captured by t
8
8
## Installation and configuration
9
9
In order to install the package via pip use the command
10
10
```
11
-
pip install py_experimenter
11
+
pip install py-experimenter
12
+
```
13
+
You can then import the PyExperimenter by using
14
+
```
15
+
from py_experimenter import PyExperimenter
12
16
```
13
17
14
18
### Configuration file
@@ -23,12 +27,15 @@ In the following we will go through these sections and go into more detail about
23
27
The database section contains the credentials for the database where the experiment parameters, results, potential errors and meta information of the experiments are written.
24
28
```
25
29
[DATABASE]
26
-
host=<hostname>
27
-
user=<username>
30
+
provider=<sqlite or mysql>
31
+
host=<hostname> (only required when using mysql as provider)
32
+
user=<username> (only required when using mysql as provider)
33
+
password=<password> (only required when using mysql as provider)
28
34
database=<databasename>
29
-
password=<password>
30
35
table=<tablename>
31
36
```
37
+
You can use `sqlite` as well as `mysql` as provider for the database. As you can see above, for mysql you need to provide a host, user and password for the database,
38
+
while sqlit only requires a database and table name.
32
39
Note that the table is automatically generated by PyExperimenter.
33
40
In the configuration file you should therefore only enter the desired name.
34
41
@@ -67,8 +74,6 @@ custom.setting1=<value>
67
74
custom.setting2=<value>
68
75
```
69
76
70
-
An example of a configuration file can be found in `config/example_config.cfg`.
71
-
72
77
## How should the function to be executed look like?
73
78
To use the PyExperimenter for your experiments, you need to create a function (again, we call this function `own_function`) with 3 parameters.
74
79
This function will be called by the PyExperimenter to process each instance of the experiment.
@@ -97,7 +102,7 @@ file to the experiment. Note that this parameter is needed even if you have not
97
102
## How to run the PyExperimenter
98
103
To run the PyExperimenter you need to initialize a `PyExperimenter` object:
99
104
```python
100
-
import PyExperimenter
105
+
from py_experimenter import PyExperimenter
101
106
102
107
# initialize the PyExperiementer
103
108
experimenter = PyExperimenter()
@@ -186,3 +191,8 @@ so the machine id is identical for each experiment. The status values for the `s
186
191
187
192
This is followed by the `creation_date`,`start_date` and `end_date` columns, which contain the creation, start and end times.
188
193
The last column contains the error message of the exercise. If no error occurred, this column contains the entry `NULL`.
194
+
195
+
196
+
###Examples
197
+
In the `examples` folder you can find examples for most of the functionality explained here. Note that `example1.py`, `example2.py` and `example4.py` are sqlite examples,
198
+
while `example3.py` is a mysql example, where you need to add your database credentials in the config file.
logging.error(f"Keyfield '{key}' is not defined in configuration file")
130
-
sys.exit()
131
-
132
-
_number_of_keys+=1
133
-
134
-
if_number_of_keys!=len(keyfield_names):
135
-
logging.error(f"{len(keyfield_names) -_number_of_keys} keyfield(s) missing! Please check passed parameters contain all keyfields defined in the configuration file.")
0 commit comments