Skip to content

Commit 465e425

Browse files
Merge branch 'dev' of github.com:mapswipe/python-mapswipe-workers into dev
2 parents e501ac8 + b188cad commit 465e425

File tree

74 files changed

+662
-3431
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+662
-3431
lines changed
File renamed without changes.

docs/source/cli.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,15 @@ Options:
6464
remove credentials.
6565
--help Show this message and exit.
6666
```
67+
68+
69+
## Create Tutorial from json file (e.g. provided in sample data)
70+
71+
```
72+
Usage: mapswipe_workers create-tutorial [OPTIONS]
73+
74+
Options:
75+
--input_file TEXT The json file with your tutorial information. [required]
76+
--help Show this message and exit.
77+
78+
```

docs/source/for_mapswipe_managers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ docker run --name mapswipe_workers_local -it pythonmapswipeworkers_mapswipe_work
4141
mapswipe_workers --verbose user-management [email protected] --manager=true
4242
exit
4343
docker rm mapswipe_workers_local
44-
44+
```

docs/source/index.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,27 @@ Welcome to MapSwipe Back-End's documentation!
1414
readme_link
1515
overview
1616

17+
.. toctree::
18+
:maxdepth: 2
19+
:caption: Using:
20+
21+
for_mapswipe_managers
22+
cli
23+
1724

1825
.. toctree::
1926
:maxdepth: 2
2027
:caption: Deployment:
2128

2229
configuration
2330
installation
31+
tutorials
2432
updating
33+
testing
2534
debugging
2635
backup
2736

2837

29-
.. toctree::
30-
:maxdepth: 2
31-
:caption: Using:
32-
33-
for_mapswipe_managers
34-
cli
35-
36-
3738
.. toctree::
3839
:maxdepth: 2
3940
:caption: Project Types and Data Model:
Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,17 @@ To run all tests you can simply run `bash test_00_main.sh`. There are still some
2424
* get firebase projects, groups and results before mapping and save to disk
2525
* for each user and project set random results for X groups in firebase through REST api, authenticated as normal user
2626
* get firebase projects, groups and results after mapping and save to disk
27-
28-
**TODO**:
29-
* compare firebase before and after data, there are already some functions in `test_mock_results.py`
27+
* compare firebase before and after data
3028

3129
## Test Firebase to Postgres
3230
* `test_03_firebase_to_postgres.py`
3331
* copy new users from firebase to postgres
3432
* copy all results from firebase to postgres
3533

36-
**TODO**:
37-
* how can we make sure that we only update users created during testing?
38-
* how can we make sure that we only transfer results for projects created during testing
39-
4034
## Generate Stats
4135
* `test_04_generate_stats.py`
4236
* generate csv files for all projects and users for which we got results since a timestamp defined in `last_update.txt`
4337

44-
**TODO**:
45-
* check logic: what happens if `last_update.txt` is not there, but `--only_new_results` flag is set? --> stats for all projects and users should be created
46-
* how can we make sure that we only generate stats for projects and users created during testing
47-
4838
## Other
4939
* we don't have broader checks of firebase database rules
5040
* some database rules are checked indirectly, e.g. firebase read, write rules through REST api get, set requests during `test_02_mapping.py`

mapswipe_workers/scripts/tutorials/readme.md renamed to docs/source/tutorials.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
# Tutorials
22
For each project type there should be at least one tutorial. Tutorials are similar to actual projects. To display the tutorial we will use the same design and screens as if a user would map for real.
33

4+
## Deploy tutorials to Firebase Database from Docker
5+
You can upload tutorial data to Firebase like this:
6+
7+
```bash
8+
docker run --name mapswipe_workers_local -it pythonmapswipeworkers_mapswipe_workers bash`
9+
mapswipe_workers --verbose create-tutorial --input_file=sample_data/build_area_tutorial.json
10+
exit
11+
docker rm mapswipe_workers_local
12+
```
13+
14+
If you want to use a customized tutorial make sure to adjust the `.json` file in the sample data folder and also add the file for the tasks.
15+
416
## Data Perspective
517
Tutorials and projects have the following in common:
618
* both have groups with the same structure (there can also be several groups per tutorial)
@@ -28,4 +40,4 @@ Tutorials will **not**:
2840
Tutorials will:
2941
* show the expected results after your first swipe or interaction
3042
* show the next tasks after swiping again (after the expected results have been shown)
31-
* once all tasks have been displayed, there could be two options: 1. `show more examples`, 2. `finish tutorial and start mapping`
43+
* once all tasks have been displayed you start to map for real projects

mapswipe_workers/.gitignore

Lines changed: 0 additions & 131 deletions
This file was deleted.

mapswipe_workers/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ RUN mkdir -p /var/lib/mapswipe_workers/api-data/agg_res_by_user_id_and_date/
2020
# copy mapswipe workers repo from local repo
2121
WORKDIR /usr/local/mapswipe_workers/
2222
COPY mapswipe_workers/ mapswipe_workers/
23+
COPY sample_data/ sample_data/
24+
COPY tests/ tests/
2325
COPY requirements.txt .
2426
COPY setup.py .
2527
COPY config /usr/share/config/mapswipe_workers

0 commit comments

Comments
 (0)