Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
add additional change requests

Co-authored-by: FR-SON <93994888+FR-SON@users.noreply.github.com>
  • Loading branch information
nils-schmitt and FR-SON committed May 24, 2024
1 parent d03b91d commit c227dfb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __extract_activities(patient_journey_numbered: str, condition: Optional[str]
column_name = "activity"
messages = Prompt.objects.get(name="TEXT_TO_ACTIVITY_MESSAGES").text

user_message = patient_journey_numbered
user_message: List[str] = patient_journey_numbered
if condition is not None:
user_message = f"Focus on those events that are related to the course of the disease of {condition}.\n\n\
{user_message}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def fill_missing_values(df: pd.DataFrame, column: pd.Series):

return df

def fix_end_dates(row):
def fix_end_dates(row: pd.Series) -> pd.Series:
if (
row["time:end_timestamp"] is pd.NaT
and row["time:timestamp"] is not pd.NaT
Expand Down
2 changes: 1 addition & 1 deletion tracex_project/extraction/logic/orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def save_results_to_db(self) -> None:
events_with_metric_list.append(event)
metric_list.append(metric)

events: list[Event] = Event.manager.bulk_create(events_with_metric_list)
events: List[Event] = Event.manager.bulk_create(events_with_metric_list)
for event, metric in zip(events, metric_list):
metric.event = event
Metric.manager.bulk_create(metric_list)
Expand Down
4 changes: 2 additions & 2 deletions tracex_project/extraction/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def get_context_data(self, **kwargs):

context = super().get_context_data(**kwargs)
orchestrator = Orchestrator.get_instance()
activity_key = orchestrator.get_configuration().activity_key
activity_key: str = orchestrator.get_configuration().activity_key
filter_dict = {
"event_type": orchestrator.get_configuration().event_types,
"attribute_location": orchestrator.get_configuration().locations,
Expand Down Expand Up @@ -276,7 +276,7 @@ def get_context_data(self, **kwargs):
@staticmethod
def build_trace_df(filter_dict: Dict[str, List[str]]) -> pd.DataFrame:
"""Build the trace dataframe based on the filter settings."""
trace_df = Orchestrator.get_instance().get_data()
trace_df: pd.DataFrame = Orchestrator.get_instance().get_data()
trace_df_filtered = utils.DataFrameUtilities.filter_dataframe(
trace_df, filter_dict
)
Expand Down

0 comments on commit c227dfb

Please sign in to comment.