ositah 24.4.dev1__py3-none-any.whl → 24.7.dev2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -55,7 +55,11 @@ def declaration_periods_layout():
55
55
 
56
56
  # Disable creation of a new (next) period if the period matching the current already exists
57
57
  today = date.today().isoformat()
58
- if today >= declaration_periods[-1].start_date and today <= declaration_periods[-1].end_date:
58
+ if (
59
+ len(declaration_periods) > 0
60
+ and today >= declaration_periods[-1].start_date
61
+ and today <= declaration_periods[-1].end_date
62
+ ):
59
63
  current_period_exists = True
60
64
  else:
61
65
  current_period_exists = False
ositah/utils/menus.py CHANGED
@@ -324,7 +324,7 @@ def ositah_jumbotron(title: str, main_text: str, details: str = None, title_clas
324
324
  return html.Div(
325
325
  dbc.Container(
326
326
  [
327
- html.H1(title, className=f"display-3 {title_class if ( title_class ) else ''}"),
327
+ html.H1(title, className=f"display-3 {title_class if (title_class) else ''}"),
328
328
  html.P(
329
329
  main_text,
330
330
  className="lead",
ositah/utils/teams.py CHANGED
@@ -1,42 +1,42 @@
1
- import re
2
- from typing import Dict, List
3
-
4
- import pandas as pd
5
-
6
-
7
- def get_hito_teams():
8
- """
9
- Return Hito teams as a Dataframe
10
-
11
- :return: Hito teams
12
- """
13
-
14
- from .hito_db import Team, db
15
-
16
- team_query = Team.query
17
-
18
- teams = pd.read_sql(team_query.statement, con=db.session.bind)
19
-
20
- return teams
21
-
22
-
23
- def get_project_team_ids(team_config: Dict[str, str], project: str) -> List[str]:
24
- """
25
- Return the list of team ID associated with the project based on the configuration passed.
26
- The configuration is a dict where the key is a pattern applied to the project name and
27
- the value is the list of team names.
28
-
29
- :param team_config: dict describing the teams associated with a project
30
- :param project: project name
31
- :return: list of team ids or None if no match is found
32
- """
33
-
34
- for pattern, team_list in team_config.items():
35
- if re.match(pattern, project):
36
- hito_teams = get_hito_teams()
37
- hito_teams["selected"] = False
38
- for team_pattern in team_list:
39
- hito_teams.loc[hito_teams.nom.str.match(f"{team_pattern}$"), "selected"] = True
40
- return hito_teams["id"].to_list()
41
-
42
- return None
1
+ import re
2
+ from typing import Dict, List
3
+
4
+ import pandas as pd
5
+
6
+
7
+ def get_hito_teams():
8
+ """
9
+ Return Hito teams as a Dataframe
10
+
11
+ :return: Hito teams
12
+ """
13
+
14
+ from .hito_db_model import Team, db
15
+
16
+ team_query = Team.query
17
+
18
+ teams = pd.read_sql(team_query.statement, con=db.session.bind)
19
+
20
+ return teams
21
+
22
+
23
+ def get_project_team_ids(team_config: Dict[str, str], project: str) -> List[str]:
24
+ """
25
+ Return the list of team ID associated with the project based on the configuration passed.
26
+ The configuration is a dict where the key is a pattern applied to the project name and
27
+ the value is the list of team names.
28
+
29
+ :param team_config: dict describing the teams associated with a project
30
+ :param project: project name
31
+ :return: list of team ids or None if no match is found
32
+ """
33
+
34
+ for pattern, team_list in team_config.items():
35
+ if re.match(pattern, project):
36
+ hito_teams = get_hito_teams()
37
+ hito_teams["selected"] = False
38
+ for team_pattern in team_list:
39
+ hito_teams.loc[hito_teams.nom.str.match(f"{team_pattern}$"), "selected"] = True
40
+ return hito_teams["id"].to_list()
41
+
42
+ return None
ositah/utils/utils.py CHANGED
@@ -5,7 +5,6 @@ from typing import List
5
5
 
6
6
  import dash_bootstrap_components as dbc
7
7
  from dash import html
8
- from dateutil.relativedelta import relativedelta
9
8
  from flask import session
10
9
  from flask_sqlalchemy import SQLAlchemy
11
10
  from hito_tools.exceptions import ConfigFileEmpty, ConfigMissingParam
@@ -389,7 +388,7 @@ def define_config_params(file):
389
388
  config["declaration"]["thresholds"] = {"low": 50, "suspect": 75, "good": 100}
390
389
  # Default declaration period date defaults to current day if not explicitly defined
391
390
  if "default_date" not in config["declaration"]:
392
- config["declaration"]["default_date"] = datetime.now() - relativedelta(months=10)
391
+ config["declaration"]["default_date"] = datetime.now()
393
392
  global_params.declaration_options = config["declaration"]
394
393
 
395
394
  if "validation" not in config:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ositah
3
- Version: 24.4.dev1
3
+ Version: 24.7.dev2
4
4
  Summary: Outils de Suivi d'Activités basé sur Hito
5
5
  Author-email: Michel Jouvin <michel.jouvin@ijclab.in2p3.fr>
6
6
  License: BSD 3-Clause License
@@ -7,7 +7,7 @@ ositah/apps/analysis.py,sha256=8bmP5m4nmfMODu1_YpzqCiFR2U2TMOOxAHbujY8od8g,28259
7
7
  ositah/apps/export.py,sha256=4h9_nk9uKopwfxgzqKyFk5u4qVQ9mtgGvk3zmxbhTV0,47532
8
8
  ositah/apps/configuration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  ositah/apps/configuration/callbacks.py,sha256=J1bWwxQF2JRX6vvkTF22XXr4R2HEEXyK3ht75hbFgAM,33477
10
- ositah/apps/configuration/main.py,sha256=K0pQePovp88r5RRJiBwXi7RNK2P7S6iTN1a-TUYUU6I,20299
10
+ ositah/apps/configuration/main.py,sha256=Kc0HU74bq2vV5RY5izYWlYAkkVfNyB2MxC20XquLDCc,20368
11
11
  ositah/apps/configuration/parameters.py,sha256=KmEVdC--IJRC3yzCN97FY1SooOKFy3bMneFBo1sGa54,3862
12
12
  ositah/apps/configuration/tools.py,sha256=e4CYt3F_2NY34vILwxHBWtvFntq082gwpKNsZZVexHE,3982
13
13
  ositah/apps/validation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -33,14 +33,14 @@ ositah/utils/core.py,sha256=OFML9h5JNmXXeMo7n90FSBDHtivWOY7ff2SJcG4uYEM,295
33
33
  ositah/utils/exceptions.py,sha256=ZVngkr28pBxO-kZAeKW9FWAFyhzuWL98-S92mieHMSk,1911
34
34
  ositah/utils/hito_db.py,sha256=awVGrd1DAyj6BaEkLjTVN1l9A5SjZUJ1-fQ5PAik7bI,1510
35
35
  ositah/utils/hito_db_model.py,sha256=gtj0URvmxg0Ms7xcEXhkf84Blb3RZl4F8nWmsqrqwXk,8988
36
- ositah/utils/menus.py,sha256=Ypb4nXVBuW3eA2iIBR4T_s3N4PAKHA5_udiCSLKcgII,12007
36
+ ositah/utils/menus.py,sha256=Xoyo2ySX0MD7phzyO5WjEcR0PCXwsX1TSrzONXnX4yI,12005
37
37
  ositah/utils/period.py,sha256=CxT77mAQasD59BmecXRUwme-_76hOr2kotOwTy6ZKfk,4058
38
38
  ositah/utils/projects.py,sha256=xLQ0RpJzMmCpx9Xdy8sHPQ-tijeWvSFPVSgOl5D6aSk,43479
39
- ositah/utils/teams.py,sha256=q8oRriecvM19whPWnIlScS2oqWIhGIdJHP0T1pK12W8,1186
40
- ositah/utils/utils.py,sha256=bAldpoDOCZhV2nNjelK2ByV3A77nXbS6t3DeCI2jgUY,16449
41
- ositah-24.4.dev1.dist-info/LICENSE,sha256=2C86YWCx1fvz92WySupcb6_t4NhHCVPE_ucy0YMTuoc,1550
42
- ositah-24.4.dev1.dist-info/METADATA,sha256=gY6583ihXmyZYRATx5HYbFAcEPGBdhKJTTYJgL5CkFE,8103
43
- ositah-24.4.dev1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
44
- ositah-24.4.dev1.dist-info/entry_points.txt,sha256=t9oDDLUO1LwHJewlE862LbJMHpDTEyqbeUAPw_F7Q3I,44
45
- ositah-24.4.dev1.dist-info/top_level.txt,sha256=3kfj_oK4xoZFt0nsw6KKT_aoqshELBu0ryLXECbcqNI,7
46
- ositah-24.4.dev1.dist-info/RECORD,,
39
+ ositah/utils/teams.py,sha256=K8Z6kqs-kFpNiIg6wgmmZ3_tmfUPaB7wp0OAGmmZPG4,1234
40
+ ositah/utils/utils.py,sha256=rUp366CNWLX3GMMHcJsau_y6kp52uCs1Hels2ESatGY,16372
41
+ ositah-24.7.dev2.dist-info/LICENSE,sha256=2C86YWCx1fvz92WySupcb6_t4NhHCVPE_ucy0YMTuoc,1550
42
+ ositah-24.7.dev2.dist-info/METADATA,sha256=VLD0aBgQB916Lcr1xxGCftGnQ3tBQBheQ-bTSd7uD_A,8103
43
+ ositah-24.7.dev2.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
44
+ ositah-24.7.dev2.dist-info/entry_points.txt,sha256=t9oDDLUO1LwHJewlE862LbJMHpDTEyqbeUAPw_F7Q3I,44
45
+ ositah-24.7.dev2.dist-info/top_level.txt,sha256=3kfj_oK4xoZFt0nsw6KKT_aoqshELBu0ryLXECbcqNI,7
46
+ ositah-24.7.dev2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (70.2.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5