Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
b2d3301
[CI] add CI pipeline as in github
lgourdin Jul 23, 2025
24c84bb
[CI] Update CI after reverting deploy method in 752b2ea17e
lgourdin Jul 28, 2025
0dd9ad6
[hotfix] add distincts scripts and change sqlalchemy events
Floriane-jandot Jul 31, 2025
905fa55
[CI] source env for CI
lgourdin Jul 31, 2025
b11143b
[fix] support updating TC when waypoint is modified and optimize navi…
lgourdin Sep 11, 2025
288e183
[scripts] make distinct navitia scripts executable
lgourdin Sep 11, 2025
1d0480f
[GHCI] source env file before launching pytest
lgourdin Sep 16, 2025
fbaf190
[chore] replace deprecated log.warn by log.warning
lgourdin Oct 10, 2025
b6caaa4
[fix] delete existing stopareas for waypoint if moved in an unserved …
lgourdin Oct 10, 2025
6a88e18
[fix] formatting error in log string that was triggering 500 errors w…
lgourdin Oct 10, 2025
3a540a1
[chore] fix linting issues
lgourdin Oct 10, 2025
8233f1d
[CI] run test script with set -e
lgourdin Oct 10, 2025
bb40e9e
[new feature] add reachable routes route
Nov 24, 2025
830581a
[new feature] add reachable waypoints route
Nov 24, 2025
ddb2f03
[new feature] add coverage table
Nov 24, 2025
bcb9a97
[new feature] add script to retrieve and insert coverages
Nov 24, 2025
e28025a
[fix] fixed a bug when trying to insert doc that is not a waypoint
Nov 28, 2025
94e05a3
[new feature] added routes to get journey/isochrone reachable doc
Nov 28, 2025
eb86874
[fix] add q=title filter in reachable doc routes
Nov 28, 2025
cfa6f73
[fix] make sure waypoints are not reachable if journeys departure day…
Nov 28, 2025
5f13610
[refactor] organization + documentation : factorization and helper fu…
Dec 1, 2025
479e003
[fix] fix issue when filtering with several areas
Dec 2, 2025
2a1a847
[new feature] added route to get coverage for area / area in isochrone
Dec 3, 2025
2bd8db5
[fix] fixed a bug where bbox applied to routes was not done on the ac…
Dec 3, 2025
72df94c
Merge branch 'gp/dev'
Dec 3, 2025
4950c16
[lint] flake8 linting
Dec 3, 2025
8a55a1a
[CI] don't create dir if exists
lgourdin Dec 3, 2025
9054d05
[CI] clean after test and debug comment
lgourdin Dec 3, 2025
971fea1
Merge branch 'main' of https://git.smart-origin.com/SmartOrigin/c2c_v…
Dec 3, 2025
c67b0b3
[fix] fix CI
Dec 3, 2025
e2b423e
[fix] Fix CI
Dec 3, 2025
10057e6
[cleanup] remove S/O files before merging with upstream
lgourdin Dec 10, 2025
3bb8456
[fix] fix #1834 : durations filter wasn't working
Dec 4, 2025
3b999d3
[improve] add range filter to reduce time of computation
Dec 4, 2025
0ba34c3
[fix] fix title query for waypoints in Iitnévert
Dec 5, 2025
3d6d24c
[fix] fix langs filter not working
Dec 8, 2025
7dd7b2b
[fix] fixed incorrect join with area association
Dec 8, 2025
90bb53d
[fix] fix title filter when no other filters
Dec 8, 2025
37e245d
[fix] fix lang filter
Dec 9, 2025
7af8240
[clean] remove debug log
Dec 10, 2025
499b96b
[new feature] add job handling for journey queries to monitor their p…
Dec 10, 2025
53ff11f
[lint] fix linter -> func names in lower case
Dec 10, 2025
2f5d6cb
[fix] fix search doc missing for coverage
Dec 10, 2025
c32e727
Merge branch 'master' into smart-origin/revue_parcours_3
lgourdin Dec 10, 2025
ae0b7ab
[refactor] Use of Elastic Search filters in reachable routes instead …
Dec 15, 2025
52e451e
[fix] fix sort + when no results found
Dec 17, 2025
02f362d
[lint] fix flake8 linter
Dec 18, 2025
3893e0f
[fix] fix too restrictive offset and limit for navitia reachable docs
Jan 6, 2026
7b381cc
[improve] return error id when 404 for navitia/journeys route
Jan 9, 2026
7eec110
[clean] fix noqa, translate french comms to english, remove use of f …
Jan 12, 2026
00438cb
[doc] update SO README
lgourdin Jan 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions SMART-ORIGIN-README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,35 @@ This documentation concerns the **"Public Transport Access"** box code, which ap
```sh
v6_api/.env.template #rename it into .env
```

Variables defined in the above file must be available at runtime for the scripts to execute correctly.
One can either source the env file, or update the compose configuration to include them in the api container runtime (this is the production approach).

If you haven't already, update the database with Alembic (this will create the missing tables and fields) :
```bash
docker-compose exec api .build/venv/bin/alembic upgrade head
```




## "Show Nearby Stops" section

This section is used to search for public transport stops around 'access' waypoints.
The public transport data comes from an external API called Navitia, which is stored in the CamptoCamp database.

**IF YOU DON'T HAVE ANY RESULT ON THE "Public Transports Access" section** : this means that your imported database does not contain Navitia data.
To have visible results, **you must launch the script "get_public_transports_from_France.sh" in the backend (see backend documentation)**
To have visible results, you must launch a `get_public_transports_*.sh` in the backend (see backend documentation).
There are different versions of these scripts:
- whose name is ending with "_France.sh", "_Rhone.sh", or "_Isere.sh": Navitia fetching scripts for France, Rhone, and Isere regions (resp.) that should be launched *outside containers* (from the host);
- whose name is ending with "_France.bm.sh", "_Rhone.bm.sh", or "_Isere.bm.sh": Same but those should be launched *within containers*;
- whose name is ending with "_distinct.sh": Navitia fetching scripts (there is also an Isere variant) that fetch **distincts** transport stops. Those make more requests than non-distinct scripts, but they avoid duplicated stops. Those scripts should be launched *outside containers* (from the host);
- whose name is ending with "_distinct.bm.sh": Same but those should be launched *within containers*;

On the production setup hosted by camptocamp, only scripts aimed at running within containers (ending with ".bm.sh") should be used.
The result will always be fetched for the whole France area, and preferably using the distinct script.

Warning ⚠️ : it takes a while (~3h, see other option below)
```
(on api_v6/ )
sh get_public_transports_from_France.sh
sh get_public_transports_from_France_distinct.bm.sh
```

If you just want to work with the Isère department for local dev, you can run this script instead (~18 minutes):
Expand Down Expand Up @@ -78,7 +87,9 @@ BACK-END :

This section is used to plan a trip by calling the Navitia API.
Unlike the previous section, we don't store the results in the database; we query Navitia directly by launching a query from the backend.
This section uses the calculated_duration attribute, **which is calculated with the calcul_duration_for_routes.sh script in the backend (see backend documentation)**
This section uses the calculated_duration attribute, **which is calculated with the `calcul_duration_for_routes.bm.sh` script in the backend (see backend documentation)**

Note that the `calcul_duration_for_routes.bm.sh` is intended to run from within the container. A variant named `calcul_duration_for_routes.sh` can be used to launch the script from the host.

If you need to update the calculated duration of itineraries, you can run this :

Expand All @@ -92,7 +103,7 @@ LIMIT_MAX = 100000
2) Run the script
```
(on api_v6/ )
sh calcul_duration_for_routes.sh
sh calcul_duration_for_routes.bm.sh
```
3) Put the limit back to 100
```python
Expand Down
39 changes: 39 additions & 0 deletions alembic_migration/versions/27bf1b7197a6_add_coverages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""Add coverages

Revision ID: 335e0bc4df28
Revises: 6b40cb9c7c3d
Create Date: 2025-11-18 14:15:26.377504

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '335e0bc4df28'
down_revision = '6b40cb9c7c3d'
branch_labels = None
depends_on = None

def upgrade():
coverage_type = sa.Enum('fr-idf', 'fr-ne', 'fr-nw', 'fr-se', 'fr-sw', name='coverage_type', schema='guidebook')
op.create_table('coverages',
sa.Column('coverage_type', coverage_type, nullable=True),
sa.Column('document_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['document_id'], ['guidebook.documents.document_id'], ),
sa.PrimaryKeyConstraint('document_id'),
schema='guidebook'
)
op.create_table('coverages_archives',
sa.Column('coverage_type', coverage_type, nullable=True),
sa.Column('id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['id'], ['guidebook.documents_archives.id'], ),
sa.PrimaryKeyConstraint('id'),
schema='guidebook'
)


def downgrade():
op.drop_table('coverages_archives', schema='guidebook')
op.drop_table('coverages', schema='guidebook')
sa.Enum('fr-idf', 'fr-ne', 'fr-nw', 'fr-se', 'fr-sw', name='coverage_type', schema='guidebook').drop(op.get_bind())
Loading
Loading