Skip to content

Conversation

@Thierry56511
Copy link

First pull request: add generate_random_grids script.

creation of the fil "random_grid_generator". The file is still empty.
impoving on the strucure of the code with Flake8
Added save_graph
improving the structure of the code
save_graph saves in npz format
The graphs are now saved as .npz (might not work).
delete unecessary
Copy link
Contributor

@CHrlS98 CHrlS98 left a comment

Choose a reason for hiding this comment

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

Première review. Pourras tu aussi ajouter des exemples de résultats dans la description de ta PR pour comprendre ce qu'on est supposé obtenir?


np.savez(output_file, nodes=nodes_array, edges=edges_array)

print(f"Copie {i+1}/{copies} saved as '{output_file}'.")
Copy link
Contributor

Choose a reason for hiding this comment

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

En anglais: copy

import random
import networkx as nx

def generer_grille(size, obstacle_mode="ratio", obstacle_ratio=0.2, obstacle_number=20):
Copy link
Contributor

Choose a reason for hiding this comment

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

Anglais

"""

import argparse
from my_research.utils.grid_dijkstra import generer_grille, save_graph
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see any module named "my_research" in your PR. Are you sure it's the right path?


obstacles = set()

if obstacle_mode == "ratio":
Copy link
Contributor

Choose a reason for hiding this comment

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

Tu pourrais détecter automatiquement ton mode en fonction de la valeur de obstacle num. Si 0<=num<1 c'est ratio, si num >= 1 c'est le count.


if not args.save_only:
print(f"{number} graphs saved as '{file}_X.npz'.")
print("Grille générée :")
Copy link
Contributor

Choose a reason for hiding this comment

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

Mets en anglais.

@@ -0,0 +1,15 @@
import numpy as np

def save_graph(G, output_base, copies=1):
Copy link
Member

Choose a reason for hiding this comment

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

Chaque fonction devrait avoir une documentation qui décrit ce que fait la fonction, les paramètres et les retours

help="Size of the grid (grid will be of shape size x size)."
)

parser.add_argument(
Copy link
Member

Choose a reason for hiding this comment

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

Va voir dans scilpy pour trouver un mutually exclusive arguments.

Tu pourrais mettre un --number OU un --number avec un float pour obstacle et int pour number et c'est argparse qui empêche de mettre les deux à la fois

)

parser.add_argument(
'--output', type=str, required=True,
Copy link
Member

Choose a reason for hiding this comment

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

Le type par défaut c'est str, tu peux retirer le type si c'est str

CHrlS98 pushed a commit to CHrlS98/quactography that referenced this pull request Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants