ositah 24.9.dev8__py3-none-any.whl → 24.12.dev1__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.

Potentially problematic release.


This version of ositah might be problematic. Click here for more details.

ositah/apps/export.py CHANGED
@@ -261,7 +261,7 @@ def nsip_export_table(team, team_selection_date, period_date: str, declarations_
261
261
  declaration_list.drop(columns="_merge", inplace=True)
262
262
 
263
263
  nsip_declarations = get_nsip_declarations(start_date, team)
264
- if nsip_declarations is None or len(nsip_declarations) == 0:
264
+ if nsip_declarations.empty:
265
265
  # nsip_missing is True if the OSITAH declaration has no matching declaration in NSIP
266
266
  declaration_list["nsip_missing"] = True
267
267
  # time_unit_mismatch is True only if there is a matching declaration in NSIP and time
@@ -282,6 +282,16 @@ def nsip_export_table(team, team_selection_date, period_date: str, declarations_
282
282
  declaration_list["nsip_reference_id"] = declaration_list["nsip_reference_id"].astype(
283
283
  int
284
284
  )
285
+ # In case nsip_declarations contains only references (no project), create the
286
+ # project.name column required later as it is used both for references and projects.
287
+ # Also copy reference.name into project.name if it is a reference.
288
+ if "project.name" not in nsip_declarations:
289
+ nsip_declarations["project.name"] = np.NaN
290
+ nsip_declarations.loc[
291
+ nsip_declarations["project.name"].isna(),
292
+ "nsip_project",
293
+ ] = nsip_declarations["reference.name"]
294
+ # Merge OSITAH declarations with those possibly present in NSIP
285
295
  declaration_list = declaration_list.merge(
286
296
  nsip_declarations,
287
297
  how="outer",
@@ -353,7 +363,7 @@ def nsip_export_table(team, team_selection_date, period_date: str, declarations_
353
363
  )
354
364
  # nsip_missing is True if the OSITAH declaration has no matching declaration in NSIP
355
365
  declaration_list["nsip_missing"] = declaration_list["_merge"] == "left_only"
356
- # ositah_missing is True if a declaratipn is found in NSIP without a matching
366
+ # ositah_missing is True if a declaration is found in NSIP without a matching
357
367
  # declaration in OSITAH
358
368
  declaration_list["ositah_missing"] = declaration_list["_merge"] == "right_only"
359
369
  for ositah_column, nsip_column in {
@@ -368,12 +378,6 @@ def nsip_export_table(team, team_selection_date, period_date: str, declarations_
368
378
  declaration_list.loc[declaration_list["ositah_missing"], ositah_column] = (
369
379
  declaration_list[nsip_column]
370
380
  )
371
- # Fix nsip_project if it was set to the project name when the activity is a reference
372
- declaration_list.loc[
373
- declaration_list["nsip_project"].isna()
374
- & (declaration_list["nsip_reference_id"] != 0),
375
- "nsip_project",
376
- ] = declaration_list["reference.name"]
377
381
  declaration_list.loc[
378
382
  declaration_list["nsip_agent_missing"].isna(), "nsip_agent_missing"
379
383
  ] = False
ositah/utils/projects.py CHANGED
@@ -734,6 +734,9 @@ def get_nsip_declarations(period_date: str, team: str):
734
734
 
735
735
  if global_params.nsip:
736
736
  declarations = pd.json_normalize(global_params.nsip.get_declarations(period_date))
737
+ if declarations.empty:
738
+ return declarations
739
+
737
740
  declarations.rename(columns={"id": "id_declaration"}, inplace=True)
738
741
  # Set NaN to 0 in reference as np.NaN is a float and prevent casting to int. As it will
739
742
  # be used in a merge better to have a 0 than a NaN.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ositah
3
- Version: 24.9.dev8
3
+ Version: 24.12.dev1
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
@@ -13,19 +13,19 @@ Requires-Python: >=3.9
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
15
  Requires-Dist: blinker
16
- Requires-Dist: dash >=2.17
16
+ Requires-Dist: dash>=2.17
17
17
  Requires-Dist: dash-bootstrap-components
18
18
  Requires-Dist: flask
19
19
  Requires-Dist: flask-multipass
20
- Requires-Dist: flask-sqlalchemy ~=3.0
20
+ Requires-Dist: flask-sqlalchemy~=3.0
21
21
  Requires-Dist: flask-wtf
22
- Requires-Dist: hito-tools >=24.8.1
23
- Requires-Dist: pandas >=2.2
22
+ Requires-Dist: hito-tools>=24.8.1
23
+ Requires-Dist: pandas>=2.2
24
24
  Requires-Dist: pymysql
25
25
  Requires-Dist: python-ldap
26
26
  Requires-Dist: pyyaml
27
27
  Requires-Dist: simplejson
28
- Requires-Dist: sqlalchemy ~=2.0
28
+ Requires-Dist: sqlalchemy~=2.0
29
29
 
30
30
  # OSITAH : Outil de Suivi de Temps et d'Activités basé sur Hito
31
31
 
@@ -4,7 +4,7 @@ ositah/main.py,sha256=97IhSMIqIVWC6GdXWievxE-tu30-UboivbW9_NTNzww,15644
4
4
  ositah/ositah.example.cfg,sha256=4zQOL3ynGN9bO6j-bekJeJWUe7Xq-c0eySNOHKMr2K8,8000
5
5
  ositah/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  ositah/apps/analysis.py,sha256=J9oE93g6wIvKh9TnT4TudmUdW75wzArx1CaB_1yuRB8,28634
7
- ositah/apps/export.py,sha256=lOQWSF0A06kXp5cPshY30J9vjRltmPzASvHYCmek3Qw,48146
7
+ ositah/apps/export.py,sha256=KCz1b8u2IIG_LCpVXXJ9MMqIG7lHB8hrHnAY2npJ_3g,48416
8
8
  ositah/apps/configuration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  ositah/apps/configuration/callbacks.py,sha256=HbsyE0WeCTmPl14SAs-mDglvMywxA4qSeVN72jSv-bM,33455
10
10
  ositah/apps/configuration/main.py,sha256=LbyupMqFUPDJCZBuRzoGREuHNxbinj3Ooj1HTJCeYUM,20349
@@ -35,12 +35,12 @@ ositah/utils/hito_db.py,sha256=awVGrd1DAyj6BaEkLjTVN1l9A5SjZUJ1-fQ5PAik7bI,1510
35
35
  ositah/utils/hito_db_model.py,sha256=GvCHp5u-mPQinbZPvF6ONJAWIc2no1KN_VNJv6NCaPk,9356
36
36
  ositah/utils/menus.py,sha256=Xoyo2ySX0MD7phzyO5WjEcR0PCXwsX1TSrzONXnX4yI,12005
37
37
  ositah/utils/period.py,sha256=ZuaiZ2gvSIjd23isvygEVoAvonH4ehbexjrS4EwSGyI,4258
38
- ositah/utils/projects.py,sha256=LuyUVtKqTb3qUWbsgwrE-9DqyW1bkV9y-n_n0oRaotQ,43476
38
+ ositah/utils/projects.py,sha256=hdbjXa0pGg1KLm---TgyxPOI0qcNaW64QBWSVbrgjeY,43543
39
39
  ositah/utils/teams.py,sha256=K8Z6kqs-kFpNiIg6wgmmZ3_tmfUPaB7wp0OAGmmZPG4,1234
40
40
  ositah/utils/utils.py,sha256=NQq0roHDvIkKj1gl88yu3bvloH0dPnBE1rKXVP_hdK4,17082
41
- ositah-24.9.dev8.dist-info/LICENSE,sha256=2C86YWCx1fvz92WySupcb6_t4NhHCVPE_ucy0YMTuoc,1550
42
- ositah-24.9.dev8.dist-info/METADATA,sha256=4UDKlnEf21czK8POzIlacouIZ3WHB7bxMqrzandzjW8,8106
43
- ositah-24.9.dev8.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
44
- ositah-24.9.dev8.dist-info/entry_points.txt,sha256=t9oDDLUO1LwHJewlE862LbJMHpDTEyqbeUAPw_F7Q3I,44
45
- ositah-24.9.dev8.dist-info/top_level.txt,sha256=3kfj_oK4xoZFt0nsw6KKT_aoqshELBu0ryLXECbcqNI,7
46
- ositah-24.9.dev8.dist-info/RECORD,,
41
+ ositah-24.12.dev1.dist-info/LICENSE,sha256=2C86YWCx1fvz92WySupcb6_t4NhHCVPE_ucy0YMTuoc,1550
42
+ ositah-24.12.dev1.dist-info/METADATA,sha256=XvSHRKs4jevkgYMdlYpqh9xTRidxZ74bH4sPUA82r28,8102
43
+ ositah-24.12.dev1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
44
+ ositah-24.12.dev1.dist-info/entry_points.txt,sha256=t9oDDLUO1LwHJewlE862LbJMHpDTEyqbeUAPw_F7Q3I,44
45
+ ositah-24.12.dev1.dist-info/top_level.txt,sha256=3kfj_oK4xoZFt0nsw6KKT_aoqshELBu0ryLXECbcqNI,7
46
+ ositah-24.12.dev1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.0.0)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5