From a5e996528996165e7c600a2a42c4b3ad2b2747c6 Mon Sep 17 00:00:00 2001
From: Fontrodona Nicolas <nicolas.fontrodona@ens-lyon.fr>
Date: Fri, 3 Jul 2020 16:08:21 +0200
Subject: [PATCH] src/nt_composition/config.py: modification of
 get_density_file by adding a new parameter king to distinguish between
 density and distance figure

---
 src/nt_composition/config.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/nt_composition/config.py b/src/nt_composition/config.py
index c4a674bf..70feec36 100644
--- a/src/nt_composition/config.py
+++ b/src/nt_composition/config.py
@@ -36,7 +36,8 @@ def get_weight_folder(weight: int, global_weight: int, ft_type: str):
 
 
 def get_density_file(weight: int, global_weight: int, project: str,
-                     ft_type: str, ft: str, fig: bool = False):
+                     ft_type: str, ft: str, fig: bool = False,
+                     kind: str = 'density'):
     """
     Get the filename that will contain the density data or figure.
 
@@ -49,6 +50,7 @@ def get_density_file(weight: int, global_weight: int, project: str,
     :param ft_type: A feature type
     :param ft: A feature
     :param fig: Say if the result file is a figure or not
+    :param kind: The kind of the figure
     :return: The filename that will contain the density data or figure.
     """
     if fig:
@@ -57,7 +59,7 @@ def get_density_file(weight: int, global_weight: int, project: str,
         ext = "txt"
     res_folder = get_weight_folder(weight, global_weight, ft_type) / project
     res_folder.mkdir(exist_ok=True, parents=True)
-    return res_folder / f"{project}_{ft_type}_{ft}_density.{ext}"
+    return res_folder / f"{project}_{ft_type}_{ft}_{kind}.{ext}"
 
 
 def get_density_recap(weight: int, global_weight: int,
@@ -135,7 +137,7 @@ class ConfigNt:
     """
     A class containing every parameters used in the submodule nt_composition
     """
-    cpu = 7 # Config.cpu
+    cpu = Config.cpu
     data = Config.data
     result = Config.results
     db_file = Config.db_file
-- 
GitLab