Parcourir la source

Change experience to experiment

Jérôme BUISINE il y a 4 ans
Parent
commit
56429dfa93

+ 27 - 27
DOCUMENTATION.md

@@ -2,24 +2,24 @@
 
 ## Description
 
-This website can let you create and manage your own experiences 
+This website can let you create and manage your own experimentss 
 
 ## Explanations
 
-The `expe` module is the django app created for managing experiences.
+The `expe` module is the django app created for managing experimentss.
 
-- `expe/config.py`: contains the main variables used by website, save experiences content and experiences configuration.
+- `expe/config.py`: contains the main variables used by website, save experimentss content and experimentss configuration.
 - `expe/views.py`: is django app file used for enable routes of website.
-- `expe/expes/run.py`: contains **run** functions in order to launch step of experience.
-- `expe/expes/classes`: is folder which contains all the necessary Python classes for experiences.
+- `expe/expes/run.py`: contains **run** functions in order to launch step of experiments.
+- `expe/expes/classes`: is folder which contains all the necessary Python classes for experimentss.
 
-## Create your own experience
+## Create your own experiments
 
 ### 1. Experience configuration
 
-Let's start with the `expe/config.py` python file. As explained earlier, this file contains experiences configuration. The variable `expes_configuration` is the dictionnary which declares all information of experiences.
+Let's start with the `expe/config.py` python file. As explained earlier, this file contains experimentss configuration. The variable `expes_configuration` is the dictionnary which declares all information of experimentss.
 
-An example for the `quest_one_image` key experience:
+An example for the `quest_one_image` key experiments:
 
 ```python
 'quest_one_image':{
@@ -32,7 +32,7 @@ An example for the `quest_one_image` key experience:
         'iterations': 10
     },
 
-    # if others custom session param are directly set for experience
+    # if others custom session param are directly set for experiments
     'session_params': [
         'expe_data',
     ],
@@ -49,38 +49,38 @@ An example for the `quest_one_image` key experience:
 }
 ```
 
-The `params` section is where you put all your necessary information for your experience.
+The `params` section is where you put all your necessary information for your experiments.
 
-### 2. The experience `expe` route
+### 2. The experiments `expe` route
 
-The `expe/` route define by the `expe` function in `expe/views.py` is used to launch experience. This route uses few parameters pass using GET method:
-- `expe`: the experience name to use
-- `scene`: the scene name to use for this experience
-- `iteration`: step of this experience
+The `expe/` route define by the `expe` function in `expe/views.py` is used to launch experiments. This route uses few parameters pass using GET method:
+- `expe`: the experiments name to use
+- `scene`: the scene name to use for this experiments
+- `iteration`: step of this experiments
 - `answer`: the answer of the user
 
-Using this parameter, the route know which experience to launch with specific scene and manage experience steps.
+Using this parameter, the route know which experiments to launch with specific scene and manage experiments steps.
 
-**Note:** `answer` and `iteration` parameters are used into `js/keyEvents.js` file. This means the `answer` and `iteration` values are sent depending of user interactions. You can implement your own interaction by creating your own `js` file and add it into your experience configuration declaration (see `expe/config.py`).
+**Note:** `answer` and `iteration` parameters are used into `js/keyEvents.js` file. This means the `answer` and `iteration` values are sent depending of user interactions. You can implement your own interaction by creating your own `js` file and add it into your experiments configuration declaration (see `expe/config.py`).
 
-### 3. The `run` experience function
+### 3. The `run` experiments function
 
-Into the `expe` function in `expe/views.py`, the `run` method your experience is dynamically call. Hence you need to implement into the `expe/expes/run.py` a function which follow this naming convention:
+Into the `expe` function in `expe/views.py`, the `run` method your experiments is dynamically call. Hence you need to implement into the `expe/expes/run.py` a function which follow this naming convention:
 
-- `run_{{you_experience_name}}`
+- `run_{{you_experiments_name}}`
 
-As you have communication exchanges between the django server and the client side, it's necessary to store the experience process at each step.
+As you have communication exchanges between the django server and the client side, it's necessary to store the experiments process at each step.
 
 Hence, this function need to follow this prototype:
 
 ```python
-def run_experience_name(request, model_filepath, output_file):
+def run_experiments_name(request, model_filepath, output_file):
 ```
 
 Information about parameters:
 - `request`: contains all information into GET, POST and session storages
-- `model_filepath`: filename where you need to store information about experience model into a binary file (can be just data information or object instanciated from file of `expe/expes/classes`)
-- `output_file`: buffer where you can add information about your experience (following your `output_header` declared into your experience configuration)
+- `model_filepath`: filename where you need to store information about experiments model into a binary file (can be just data information or object instanciated from file of `expe/expes/classes`)
+- `output_file`: buffer where you can add information about your experiments (following your `output_header` declared into your experiments configuration)
 
 
 Example of accessing request variables:
@@ -124,14 +124,14 @@ output_file.write(line)
 output_file.flush()
 ```
 
-### 5. Display experience data into custom template
+### 5. Display experiments data into custom template
 
 Finally your `run` function need to return python dictionnary of data your need to use into your `expe/` django template. 
 
 If you want to create your own template, specify your template path into configuration:
 
 ```python
-'experience_name':{
+'experiments_name':{
     ...
     # template file used in django `expe` route
     'template': 'expe/my_expe_template.html',
@@ -139,7 +139,7 @@ If you want to create your own template, specify your template path into configu
 }
 ```
 
-Example of way to use your experience data into template:
+Example of way to use your experiments data into template:
 ```python
 {{request.session.expe_data|get_value_from_dict:'image_path'}}
 ```

+ 8 - 8
README.md

@@ -2,7 +2,7 @@
 
 ## Description
 
-Web site which contains experiences on synthesis images (perception of noise). 
+Web site which contains experimentss on synthesis images (perception of noise). 
 
 ## Installation
 
@@ -68,20 +68,20 @@ Create your own admin user:
 python manage.py createsuperuser
 ```
 
-You can now access `/admin/results` route with your credentials in order to download experience results.
+You can now access `/admin/results` route with your credentials in order to download experiments results.
 
 <hr />
 
 Configure your own URL prefix using `WEBEXPE_PREFIX_URL`:
 
 ```
-WEBEXPE_PREFIX_URL=experience python manage.py runserver
+WEBEXPE_PREFIX_URL=experiments python manage.py runserver
 ```
 
 or using docker:
 
 ```
-WEBEXPE_PREFIX_URL=experience make deploy
+WEBEXPE_PREFIX_URL=experiments make deploy
 ```
 
 <hr />
@@ -89,18 +89,18 @@ WEBEXPE_PREFIX_URL=experience make deploy
 Using custom API base URL using `WEB_API_PREFIX_URL`:
 
 ```
-WEBEXPE_PREFIX_URL=experience/ WEB_API_PREFIX_URL=expe/api python manage.py runserver
+WEBEXPE_PREFIX_URL=experiments/ WEB_API_PREFIX_URL=expe/api python manage.py runserver
 ```
 
 or using docker:
 
 ```
-WEBEXPE_PREFIX_URL=experience/ WEB_API_PREFIX_URL=expe/api make deploy
+WEBEXPE_PREFIX_URL=experiments/ WEB_API_PREFIX_URL=expe/api make deploy
 ```
 
-## Create your experiences
+## Create your experimentss
 
-See [DOCUMENTATION.md](DOCUMENTATION.md). This documentation explains how to create your own experience.
+See [DOCUMENTATION.md](DOCUMENTATION.md). This documentation explains how to create your own experiments.
 
 ## How to contribute ?
 

+ 3 - 3
expe/config.py

@@ -21,10 +21,10 @@ output_tmp_folder            = "tmp"
 # expes list
 expe_name_list              = ["quest_one_image"]
 
-# configure experiences labels
+# configure experimentss labels
 expes_configuration         = {
 
-    # First experience configuration
+    # First experiments configuration
     'quest_one_image':{
         'text':{
             'question': "Do you see one image or a composition of more than one?",
@@ -35,7 +35,7 @@ expes_configuration         = {
             'iterations': 10
         },
        
-        # if others custom session param are directly set for experience
+        # if others custom session param are directly set for experiments
         'session_params': [
             'expe_data',
         ],

+ 5 - 5
expe/expes/run.py

@@ -36,7 +36,7 @@ def run_quest_one_image(request, model_filepath, output_file):
 
     # 2. Get expe information if started
     # first time only init `quest`
-    # if experience is started we can save data
+    # if experiments is started we can save data
     if request.session.get('expe_started'):
 
          # does not change expe parameters
@@ -68,8 +68,8 @@ def run_quest_one_image(request, model_filepath, output_file):
         filehandler = open(model_filepath, 'rb') 
         qp = pickle.load(filehandler)
     
-    # 4. If expe started update and save experience information and model
-    # if experience is already began
+    # 4. If expe started update and save experiments information and model
+    # if experiments is already began
     if request.session.get('expe_started'):
 
         # TODO : check `i` variable 
@@ -126,9 +126,9 @@ def run_quest_one_image(request, model_filepath, output_file):
     if img_merge is not None:
         img_merge.save(filepath_img)
 
-    # 6. Prepare experience data for current iteration and data for view
+    # 6. Prepare experiments data for current iteration and data for view
     
-    # here you can save whatever you need for you experience
+    # here you can save whatever you need for you experiments
     data_expe = {
         'image_path': filepath_img,
         'expe_percentage': percentage,

+ 2 - 2
expe/templates/base.html

@@ -44,12 +44,12 @@
         var END_EXPE   = "{{request.session.expe_finished}}" === 'True'
     </script>
 
-    <!-- Custom Javascript file for experience template is placed here -->
+    <!-- Custom Javascript file for experiments template is placed here -->
     {% block javascripts %}
         
     {% endblock %}
 
-    <!-- Dynamically load JS file of experience -->
+    <!-- Dynamically load JS file of experiments -->
     {% for file in javascript %}
         {% with 'js/'|add:file as js_static %}
             <script src="{% static js_static %}"></script>

+ 1 - 1
expe/templates/expe/expe_indications.html

@@ -12,7 +12,7 @@
     <br />
     <h5>{{indication}}</h5>
 
-    <p id="expeIndication"><strong>Press enter to begin experience</strong></p>
+    <p id="expeIndication"><strong>Press enter to begin experiments</strong></p>
 
 {% endblock %}
 

+ 2 - 2
expe/templates/expe/expe_list.html

@@ -7,7 +7,7 @@
 {% endblock %}
 
 {% block content %}
-    <h2>Choose your experience and dataset</h2>
+    <h2>Choose your experiments and dataset</h2>
 
     <div class="row">
         <div class="col-md-4 offset-md-4">
@@ -24,7 +24,7 @@
                 </div>
 
                 <div class="form-group">
-                    <label for="expe" style="position:static">Select experience:</label>
+                    <label for="expe" style="position:static">Select experiments:</label>
                     <select class="form-control " name="expe">
                         {% for expe in expes %}
                             <option value="{{expe}}">{{expe}}</option>

+ 1 - 1
expe/templates/expe/expe_results.html

@@ -9,7 +9,7 @@
 {% block content %}
     
     {% if not expe %}
-        <h3>Results files of experiences</h3>
+        <h3>Results files of experimentss</h3>
         <br />
     {% endif %}
 

+ 6 - 6
expe/views.py

@@ -46,7 +46,7 @@ def get_base_data(expe_name=None):
 
     # if expe name is used
     if expe_name is not None:
-        data['js'] = cfg.expes_configuration[expe_name]['js']
+        data['javascript'] = cfg.expes_configuration[expe_name]['javascript']
 
     return data
 
@@ -56,7 +56,7 @@ def expe_list(request):
     # get all scenes from dataset
     scenes = api.get_scenes()
 
-    # get list of experiences
+    # get list of experimentss
     expes = cfg.expe_name_list
 
     # by default user restart expe
@@ -153,14 +153,14 @@ def expe(request):
         for key in cfg.expes_configuration[expe_name]['session_params']:
             del request.session[key]
 
-    # set expe current data into session (replace only if experience data changed)
+    # set expe current data into session (replace only if experiments data changed)
     if expe_data is not None:
         request.session['expe_data'] = expe_data
 
         # get base data
     data = get_base_data(expe_name)
 
-    # other experiences information
+    # other experimentss information
     data['expe_name']            = expe_name
     data['end_text']             = cfg.expes_configuration[expe_name]['text']['end_text']
 
@@ -170,7 +170,7 @@ def expe(request):
 @login_required(login_url="login/")
 def list_results(request, expe=None):
     """
-    Return all results obtained from experiences
+    Return all results obtained from experimentss
     """
 
     if expe is None:
@@ -283,7 +283,7 @@ def refresh_data(request, expe_name, scene_name):
     request.session['expe_finished'] = False
 
     request.session['qualities'] = api.get_scene_qualities(scene_name)
-    # update unique timestamp each time new experience is launched
+    # update unique timestamp each time new experiments is launched
     request.session['timestamp'] = datetime.strftime(datetime.utcnow(), "%Y-%m-%d_%Hh%Mm%Ss")
 
     # TODO : add in cache ref_image

+ 3 - 3
static/js/keyEvents.js

@@ -16,14 +16,14 @@ const checkKey = e => {
       window.location = baseUrl
    }
    else if (e.keyCode === KEYCODE_ENTER) {
-      // check if experience is begin
+      // check if experiments is begin
       if (!BEGIN_EXPE) {
          // right arrow
          window.location = window.location.href + '&begin=true'
       } 
    }
    else if (e.keyCode === KEYCODE_LEFT_ARROW || e.keyCode === KEYCODE_RIGHT_ARROW) {
-      // only do something is experience has begun
+      // only do something is experiments has begun
       if (BEGIN_EXPE) {
          let answer
 
@@ -49,7 +49,7 @@ const checkKey = e => {
             iteration++
          }
          
-         // construct url with params for experience
+         // construct url with params for experiments
          const params = `?scene=${scene}&expe=${expe}&iteration=${iteration}&answer=${answer}`
          window.location = expeUrl + params
       }