Skip to content

Conversation

@fbacquelot
Copy link

headers, docstring et commentaires rédigés tout en anglais + couverture globale des tests unitaires et d'intégration à 94%

…Théo => implémenter les attributs, constructeurs, propriétés et méthodes précisées comme dans le ticket
…e fichiers d'entrée vecteur contenus dans le dossier "tests/fixtures"
…nt à revoir car de nouvelles fonctions ont été rajoutées suite à la revue de code PR du 22-09-2025 par Théo
… globalité suite ajout de nouvelles fonctions
…s en entrée du programme avec "ogr.UseExceptions()" à la ligne 42
… la fonction serializable + revue de from_file comme dans test.py
…r_calls_put_data_str()' et 'test_vector_from_file_raises_storageerror_on_none_datasource()'
…ises_from_formaterror_on_jsondecodeerror()' + tester que la sortie de la property de srs est bien une liste
…es tests passent avec une couverture globale à 94%
@fbacquelot fbacquelot requested a review from Dolite October 10, 2025 13:52
@fbacquelot fbacquelot self-assigned this Oct 10, 2025
@github-actions github-actions bot added enhancement New feature or request quality labels Oct 10, 2025
- passage du CHANGELOG au format keepachangelog
- déplacement des fichiers de tests dans les dossiers fixtures
- migration de fix-encoding-pragma vers pyupgrade dans le pre commit
@Dolite Dolite force-pushed the feature/vectorset branch from d2fac70 to 13e09b9 Compare January 5, 2026 13:43
Copy link
Member

@Dolite Dolite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retours généraux :

  • La documentation doit être faite en docstring google pour être homogène avec les autres modules
  • Les autres modules ne loggent rien, pour laisser aux projets appelant la main sur la quantité d'information à afficher. Il ne faut pas faire de print

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retours généraux :

  • La documentation doit être faite en docstring google pour être homogène avec les autres modules
  • Il faudrait documenter les exceptions possibles dans les fonctions, au moins les plus importantes
  • Les autres modules ne loggent rien, pour laisser aux projets appelant la main sur la quantité d'information à afficher. Il ne faut pas faire de print.
  • L'initialisation des attributs peut se faire directement dans le init, sans passer par des attributs de classe (__path et __tables dans Vector par exemple)
  • Si tu veux mettre des exemples d'usage d'une fonction, mets le dans la doc de cette fonction, dans une section Example (comme dans list_generator de la classe Pyramid par exemple)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done !

else:
dataSource = ogr.Open(get_osgeo_path(path), 0)
if datasource is None:
raise StorageError("FILE", f"Cannot open vector file/object {working_path}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mieux vaut mettre dans l'erreur le chemin d'origine, pas celui osgeo (sinon l'utlisateurice risque de ne pas comprendre d'où vient cette valeur qui n'est pas celle de son côté)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done !


layer = datasource.GetLayer(i)
name = layer.GetName()
count = layer.GetFeatureCount()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ne pas forcer le calcul du nombre de features pour éviter des délais trop long sur les gros fichiers (mettre le premier paramètre à 0 a priori)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done !

path (str): path to the file/object
bbox (Tuple[float, float, float, float]): bounding rectange in the data projection
layers (List[Tuple[str, int, List[Tuple[str, str]]]]) : Vector layers with their name, their number of objects and their attributes
def from_parameters(cls, path: str, tables: Dict[str, "Table"]) -> "Vector":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Le paramètre tables est un simple dictionnaire, chargé depuis le descripteur JSON. Il faut faire dans cette fonction la boucle d'appel au constructeur Table pour créer les instances à partir des informations dans le dictionnaire.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

making a loop for calling the Table constructor has been done !

print(self.tables)
# for each table in the vector data, we get its serializable version
for table in self.tables:
serialization["tables"].append(Table.serializable.fget(self.tables[table]))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

serializable doit être une priopriété de l'instance Table (pas de fget du coup)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok !

return serialization


if __name__ == "__main__":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pas besoin de ça dans une lib.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok ! done !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request quality tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants