diff --git a/README.md b/README.md index 79d9331..f710191 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # decp.info -> v2.5.0 +> v2.5.1 > Outil d'exploration et de téléchargement des données essentielles de la commande publique. => [decp.info](https://decp.info) diff --git a/pyproject.toml b/pyproject.toml index d08f07a..a75f5fd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "decp.info" description = "Interface d'exploration et d'analyse des marchés publics français." -version = "2.5.0" +version = "2.5.1" requires-python = ">= 3.10" authors = [ { name = "Colin Maudry", email = "colin@colmo.tech" } diff --git a/src/utils.py b/src/utils.py index bb79977..0e7a96b 100644 --- a/src/utils.py +++ b/src/utils.py @@ -551,7 +551,6 @@ def search_org(dff: pl.DataFrame, query: str, org_type: str) -> pl.DataFrame: dff = ( dff.with_columns(token_matches + [match_score]) .filter(pl.col("match_score") == len(tokens)) - .sort("Marchés", descending=True) .drop([f"token_{token}" for token in tokens]) ) @@ -567,6 +566,8 @@ def search_org(dff: pl.DataFrame, query: str, org_type: str) -> pl.DataFrame: ) dff = dff.select(f"{org_type}_id", f"{org_type}_nom", "Département", "Marchés") + dff = dff.group_by(f"{org_type}_id", f"{org_type}_nom", "Département").sum() + dff = dff.sort("Marchés", descending=True) return dff