-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add ports to db #104
add ports to db #104
Conversation
Il y a le docker-compose-load-data.yaml qu'il faudrait mettre a jour pour ajouter le load_ports_data.py |
Je veux bien jeter un œil (ce soir) avant de merger |
""" | ||
op.create_table( | ||
"ports", | ||
sa.Column("id", sa.Integer, primary_key=True), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sa.Column("id", sa.Integer, sa.Identity(), primary_key=True, index=True),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
à quoi servent le sa.Identity() ? et index=True ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ça permet d'indiquer à SqlAlchemy d'utiliser la syntaxe GENERATED ALWAYS AS IDENTITY
pour le type de la PK. Voir ici: https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-identity-column/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Index = True, effectivement pas utile pour une PK, c'est implicite
from shapely import wkt | ||
from shapely.geometry import Polygon | ||
|
||
radius_m = 3000 # Radius in kilometers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'est pas un peu beaucoup 3000km ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'est en metres je me suis trompé dans le commentaire. Le code est bon
Fix: radius_m = 3000 # Radius in meters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tu peux corriger ?
@njouanin @romainm13 |
Pour pas d’ambiguïté et risque de merge un peu rapide, je propose de passer la PR en draft le temps qu'on soit ok pour valider |
@rv2931 c'est bien moi qui suis responsable de la structure de la BDD. Ce qu'a fait @romainm13 est proche du modèle cible. La référence est en haut du miro, sachant que le modèle est encore en brouillon. |
from shapely import wkt | ||
from shapely.geometry import Polygon | ||
|
||
radius_m = 3000 # Radius in kilometers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tu peux corriger ?
Bon c'est du détail globalement mais il y a quelques exceptions ruff sur de la qualité de code |
oui, je pensais ouvrir une issue spécifique pour que l'on fasse une passe de correction ruff globale sur le code. |
@romainm13 j'ai créé une branche add_ports à partir de ta branche de ton fork J'imagine qu'il y a une divergence de 2 branches en Y de ce que je comprends. Si vous maitrisez alembic je vous laisse résoudre sinon j'imagine qu'il faut juste refaire la cohérence down_revision et depends_on ? |
Si tu lances |
Je vous propose de repartir de cette PR #111 |
J'ai modifié un down_revision et j'obtiens ça qui fonctionne
On a du intégrer des revisions pour marine traffic entre temps |
code repris dans le projet via la la PR #111 |
ports.csv
orports_rad3000_res10.csv
New alembic history is
To load data do
make load-ports-data
just aftermake launch-dev-db