generate.py: log after action

I saw some advice once that we should log after the action completes
instead of before. Let's at least be consistent.
This commit is contained in:
Alan Orth 2024-02-26 09:28:32 +03:00
parent ef3dcd432f
commit 00ab133921
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -155,8 +155,8 @@ if __name__ == "__main__":
# Get a random list of animal IDs. We will build a square grid using the # Get a random list of animal IDs. We will build a square grid using the
# "across" parameter passed by the user. # "across" parameter passed by the user.
logger.info(f"Generating random sample of {animals_df.shape[0]} animals...")
animal_ids = animals_df["id"].sample(args.across * args.across) animal_ids = animals_df["id"].sample(args.across * args.across)
logger.info(f"Generated random sample of {animals_df.shape[0]} animals...")
# Slice those random animals from the dataframe # Slice those random animals from the dataframe
animals_df_random = animals_df[animals_df["id"].isin(animal_ids)] animals_df_random = animals_df[animals_df["id"].isin(animal_ids)]