DmitryRyumin commited on
Commit
5907fd7
β€’
1 Parent(s): 7acc2de
app/event_handlers/calculate_practical_tasks.py CHANGED
@@ -576,8 +576,12 @@ def event_handler_calculate_practical_task_blocks(
576
  elif practical_subtasks.lower() == "professional skills":
577
  df_professional_skills = read_csv_file(config_data.Links_PROFESSIONAL_SKILLS)
578
 
 
 
 
 
579
  b5._priority_skill_calculation(
580
- df_files=pt_scores.iloc[:, 1:],
581
  correlation_coefficients=df_professional_skills,
582
  threshold=threshold_professional_skills,
583
  out=False,
@@ -607,13 +611,13 @@ def event_handler_calculate_practical_task_blocks(
607
  df_hidden = df_hidden.sort_values(
608
  by=[dropdown_professional_skills], ascending=False
609
  )
 
610
  elif type_modes == config_data.Settings_TYPE_MODES[1]:
611
  df_hidden = df_hidden.melt(
612
  var_name="Professional Skill", value_name="Summary Score"
613
  )
614
  df_hidden = df_hidden.sort_values(by=["Summary Score"], ascending=False)
615
-
616
- df_hidden.reset_index(drop=True, inplace=True)
617
 
618
  df_hidden.to_csv(config_data.Filenames_PT_SKILLS_SCORES)
619
 
@@ -726,25 +730,19 @@ def event_handler_calculate_practical_task_blocks(
726
 
727
  df_hidden.reset_index(inplace=True)
728
 
729
- if (
730
- practical_subtasks.lower()
731
- != "finding a suitable colleague by personality types"
732
- ):
733
- person_id = (
734
- int(
735
- df_hidden.iloc[
736
- (
737
- 0
738
- if practical_subtasks.lower()
739
- != "finding a suitable colleague by personality types"
740
- else 1
741
- )
742
- ][config_data.Dataframes_PT_SCORES[0][0]]
743
- )
744
- - 1
745
  )
746
- else:
747
- person_id = 0
748
 
749
  person_metadata = create_person_metadata(person_id, files, video_metadata)
750
 
@@ -840,7 +838,7 @@ def event_handler_calculate_practical_task_blocks(
840
 
841
  df_hidden = df_hidden.reset_index()
842
 
843
- df_hidden.columns = ["Category", "Priority"]
844
 
845
  df_hidden.to_csv(consumer_preferences(practical_subtasks))
846
 
 
576
  elif practical_subtasks.lower() == "professional skills":
577
  df_professional_skills = read_csv_file(config_data.Links_PROFESSIONAL_SKILLS)
578
 
579
+ pt_scores_copy = pt_scores.iloc[:, 1:].copy()
580
+
581
+ preprocess_scores_df(pt_scores_copy, config_data.Dataframes_PT_SCORES[0][0])
582
+
583
  b5._priority_skill_calculation(
584
+ df_files=pt_scores_copy,
585
  correlation_coefficients=df_professional_skills,
586
  threshold=threshold_professional_skills,
587
  out=False,
 
611
  df_hidden = df_hidden.sort_values(
612
  by=[dropdown_professional_skills], ascending=False
613
  )
614
+ df_hidden.reset_index(inplace=True)
615
  elif type_modes == config_data.Settings_TYPE_MODES[1]:
616
  df_hidden = df_hidden.melt(
617
  var_name="Professional Skill", value_name="Summary Score"
618
  )
619
  df_hidden = df_hidden.sort_values(by=["Summary Score"], ascending=False)
620
+ df_hidden.reset_index(drop=True, inplace=True)
 
621
 
622
  df_hidden.to_csv(config_data.Filenames_PT_SKILLS_SCORES)
623
 
 
730
 
731
  df_hidden.reset_index(inplace=True)
732
 
733
+ person_id = (
734
+ int(
735
+ df_hidden.iloc[
736
+ (
737
+ 0
738
+ if practical_subtasks.lower()
739
+ != "finding a suitable colleague by personality types"
740
+ else 1
741
+ )
742
+ ][config_data.Dataframes_PT_SCORES[0][0]]
 
 
 
 
 
 
743
  )
744
+ - 1
745
+ )
746
 
747
  person_metadata = create_person_metadata(person_id, files, video_metadata)
748
 
 
838
 
839
  df_hidden = df_hidden.reset_index()
840
 
841
+ df_hidden.columns = ["Priority", "Category"]
842
 
843
  df_hidden.to_csv(consumer_preferences(practical_subtasks))
844
 
app/event_handlers/practical_task_sorted.py CHANGED
@@ -37,7 +37,13 @@ def event_handler_practical_task_sorted(
37
  label = ""
38
  label += " " + config_data.Dataframes_PT_SCORES[0][0]
39
 
40
- if Path(files[person_id]).name in video_metadata:
 
 
 
 
 
 
41
  person_metadata_list = video_metadata[Path(files[person_id]).name]
42
 
43
  person_metadata = (
 
37
  label = ""
38
  label += " " + config_data.Dataframes_PT_SCORES[0][0]
39
 
40
+ try:
41
+ is_filename = Path(files[person_id]).name in video_metadata
42
+ except IndexError:
43
+ is_filename = False
44
+ person_id = 0
45
+
46
+ if is_filename:
47
  person_metadata_list = video_metadata[Path(files[person_id]).name]
48
 
49
  person_metadata = (
config.toml CHANGED
@@ -1,5 +1,5 @@
1
  [AppSettings]
2
- APP_VERSION = "0.10.10"
3
  SERVER_NAME = "127.0.0.1"
4
  PORT = 7860
5
  CSS_PATH = "app.css"
 
1
  [AppSettings]
2
+ APP_VERSION = "0.11.0"
3
  SERVER_NAME = "127.0.0.1"
4
  PORT = 7860
5
  CSS_PATH = "app.css"