ositah 24.9.dev7__tar.gz → 24.12__tar.gz
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-24.9.dev7/ositah.egg-info → ositah-24.12}/PKG-INFO +1 -1
- {ositah-24.9.dev7 → ositah-24.12}/ositah/apps/export.py +28 -11
- {ositah-24.9.dev7 → ositah-24.12}/ositah/utils/projects.py +3 -0
- {ositah-24.9.dev7 → ositah-24.12/ositah.egg-info}/PKG-INFO +1 -1
- {ositah-24.9.dev7 → ositah-24.12}/pyproject.toml +1 -1
- {ositah-24.9.dev7 → ositah-24.12}/.gitignore +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/.gitlab-ci.yml +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/LICENSE +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/README.md +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/docker/Dockerfile +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/docker/docker-compose.yml +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/docker/pyproject-poetry.toml +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/gunicorn.config/README.md +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/gunicorn.config/gunicorn.ositah +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/gunicorn.config/gunicorn@.service +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/gunicorn.config/ositah.conf.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/noxfile.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/__init__.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/app.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/apps/__init__.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/apps/analysis.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/apps/configuration/__init__.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/apps/configuration/callbacks.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/apps/configuration/main.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/apps/configuration/parameters.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/apps/configuration/tools.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/apps/validation/__init__.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/apps/validation/callbacks.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/apps/validation/main.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/apps/validation/parameters.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/apps/validation/tables.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/apps/validation/tools.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/assets/arrow_down_up.svg +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/assets/ositah.css +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/assets/sort_ascending.svg +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/assets/sort_descending.svg +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/assets/sorttable.js +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/main.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/ositah.example.cfg +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/static/style.css +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/templates/base.html +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/templates/bootstrap_login.html +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/templates/login_form.html +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/utils/__init__.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/utils/agents.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/utils/authentication.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/utils/cache.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/utils/core.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/utils/exceptions.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/utils/hito_db.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/utils/hito_db_model.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/utils/menus.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/utils/period.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/utils/teams.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah/utils/utils.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah.egg-info/SOURCES.txt +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah.egg-info/dependency_links.txt +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah.egg-info/entry_points.txt +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah.egg-info/requires.txt +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/ositah.egg-info/top_level.txt +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/setup.cfg +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/setup.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/test-dash/README.md +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/test-dash/accordion.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/test-dash/authentication.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/test-dash/checkbox.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/test-dash/checklist.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/test-dash/file-selector.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/test-dash/file-upload.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/test-dash/long_running_callback.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/test-dash/pandas_split.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/test-dash/pandas_split_bug_report.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/test-dash/pattern-matching-callback.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/test-dash/progess_bar.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/test-dash/reset_table_checkboxes.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/test-dash/sortable_table.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/test-dash/sqlalchemy_test.py +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/test-dash/templates/base.html +0 -0
- {ositah-24.9.dev7 → ositah-24.12}/test-dash/templates/login_form.html +0 -0
|
@@ -164,8 +164,10 @@ def nsip_export_table(team, team_selection_date, period_date: str, declarations_
|
|
|
164
164
|
)
|
|
165
165
|
agent_list = get_agents(period_date, team)
|
|
166
166
|
if team is None or team == TEAM_LIST_ALL_AGENTS:
|
|
167
|
-
# If no team is selected, merge left to include declarations from agents
|
|
168
|
-
#
|
|
167
|
+
# If no team is selected, merge left to include declarations from agents whose
|
|
168
|
+
# email_auth don't match between Hito and NSIP. It is typically the case for agents
|
|
169
|
+
# who are no longer active in NSIP (e.g. agents who left the lab during the
|
|
170
|
+
# declaration period).
|
|
169
171
|
merge_how = "left"
|
|
170
172
|
else:
|
|
171
173
|
merge_how = "inner"
|
|
@@ -210,7 +212,8 @@ def nsip_export_table(team, team_selection_date, period_date: str, declarations_
|
|
|
210
212
|
# For OSITAH entries not found in NSIP, it may be that the agent left the lab during
|
|
211
213
|
# the declaration period: in this case there is an entry in NSIP where the RESEDA email
|
|
212
214
|
# has been replaced by a UUID allowing to update NSIP data. Check if such an entry
|
|
213
|
-
# exists in NSIP with a matching fullname and use it if it exists
|
|
215
|
+
# exists in NSIP with a matching fullname and use it if it exists. It also happens if the
|
|
216
|
+
# agent email_auth changed during the period.
|
|
214
217
|
# To make matching easier, index is temporarily set to fullname instead of an integer.
|
|
215
218
|
nsip_missing_agent_names = declaration_list.loc[
|
|
216
219
|
declaration_list["_merge"] == "left_only", columns["fullname"]
|
|
@@ -258,7 +261,7 @@ def nsip_export_table(team, team_selection_date, period_date: str, declarations_
|
|
|
258
261
|
declaration_list.drop(columns="_merge", inplace=True)
|
|
259
262
|
|
|
260
263
|
nsip_declarations = get_nsip_declarations(start_date, team)
|
|
261
|
-
if nsip_declarations
|
|
264
|
+
if nsip_declarations.empty:
|
|
262
265
|
# nsip_missing is True if the OSITAH declaration has no matching declaration in NSIP
|
|
263
266
|
declaration_list["nsip_missing"] = True
|
|
264
267
|
# time_unit_mismatch is True only if there is a matching declaration in NSIP and time
|
|
@@ -279,6 +282,16 @@ def nsip_export_table(team, team_selection_date, period_date: str, declarations_
|
|
|
279
282
|
declaration_list["nsip_reference_id"] = declaration_list["nsip_reference_id"].astype(
|
|
280
283
|
int
|
|
281
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
|
|
282
295
|
declaration_list = declaration_list.merge(
|
|
283
296
|
nsip_declarations,
|
|
284
297
|
how="outer",
|
|
@@ -350,7 +363,7 @@ def nsip_export_table(team, team_selection_date, period_date: str, declarations_
|
|
|
350
363
|
)
|
|
351
364
|
# nsip_missing is True if the OSITAH declaration has no matching declaration in NSIP
|
|
352
365
|
declaration_list["nsip_missing"] = declaration_list["_merge"] == "left_only"
|
|
353
|
-
# ositah_missing is True if a
|
|
366
|
+
# ositah_missing is True if a declaration is found in NSIP without a matching
|
|
354
367
|
# declaration in OSITAH
|
|
355
368
|
declaration_list["ositah_missing"] = declaration_list["_merge"] == "right_only"
|
|
356
369
|
for ositah_column, nsip_column in {
|
|
@@ -365,12 +378,6 @@ def nsip_export_table(team, team_selection_date, period_date: str, declarations_
|
|
|
365
378
|
declaration_list.loc[declaration_list["ositah_missing"], ositah_column] = (
|
|
366
379
|
declaration_list[nsip_column]
|
|
367
380
|
)
|
|
368
|
-
# Fix nsip_project if it was set to the project name when the activity is a reference
|
|
369
|
-
declaration_list.loc[
|
|
370
|
-
declaration_list["nsip_project"].isna()
|
|
371
|
-
& (declaration_list["nsip_reference_id"] != 0),
|
|
372
|
-
"nsip_project",
|
|
373
|
-
] = declaration_list["reference.name"]
|
|
374
381
|
declaration_list.loc[
|
|
375
382
|
declaration_list["nsip_agent_missing"].isna(), "nsip_agent_missing"
|
|
376
383
|
] = False
|
|
@@ -472,6 +479,16 @@ def nsip_export_table(team, team_selection_date, period_date: str, declarations_
|
|
|
472
479
|
)
|
|
473
480
|
),
|
|
474
481
|
]
|
|
482
|
+
if team and team != TEAM_LIST_ALL_AGENTS:
|
|
483
|
+
page_title.append(
|
|
484
|
+
html.Div(
|
|
485
|
+
(
|
|
486
|
+
"Certains agents peuvent apparaitre non synchronisés s'ils ont quitté"
|
|
487
|
+
f" le laboratoire: utiliser '{TEAM_LIST_ALL_AGENTS}' pour vérifier"
|
|
488
|
+
),
|
|
489
|
+
style={"fontStyle": "italic", "fontWeight": "bold"},
|
|
490
|
+
)
|
|
491
|
+
)
|
|
475
492
|
|
|
476
493
|
if declarations_set == NSIP_DECLARATIONS_SELECT_ALL:
|
|
477
494
|
selected_declarations = declaration_list
|
|
@@ -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.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|