Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mikrise2 committed Mar 1, 2024
1 parent 85ba0dc commit 65838c9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions jba/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ docker run hyperstyle-analysis-prod:<VERSION> poetry run tasktracker_content_col
- `course_sources_path` — Path to course sources to extract course structure.
- `destination_path` — Path to directory where yaml file will be created.

4.[tasktracker_task_filter.py](src/processing/tasktracker_task_filter.py) filtering data by the start research date.
4. [tasktracker_task_filter.py](src/processing/tasktracker_task_filter.py) filtering data by the start research date.
Grouping by package name.

### Usage
Expand All @@ -140,7 +140,7 @@ docker run hyperstyle-analysis-prod:<VERSION> poetry run tasktracker_task_filter
- `destination_path` — Path of the file to save filtered data.
- `start_date` — Start of the research in the DD.MM.YYYY format.

5.[tasktracker_edu_validation.py](src/processing/tasktracker_edu_validation.py) Divide filtered tasktracker file to 2
5. [tasktracker_edu_validation.py](src/processing/tasktracker_edu_validation.py) Divide filtered tasktracker file to 2
files - the first with emails that have been presented in the edu csv file, and the second file without them.

### Usage
Expand Down Expand Up @@ -192,7 +192,7 @@ docker run hyperstyle-analysis-prod:<VERSION> poetry run tasktracker_edu_validat
Optional arguments:

| Argument | Description |
|-------------------------------------|---------------------------------------------|
|-------------------------------------|---------------------------------------------|
| **&#8209;&#8209;course&#8209;name** | Name of the course to display on the chart. |


Expand All @@ -218,7 +218,7 @@ docker run hyperstyle-analysis-prod:<VERSION> poetry run tasktracker_edu_validat
**Optional arguments**:

| Argument | Description |
|-------------------------------------|---------------------------------------------|
|-------------------------------------|---------------------------------------------|
| **&#8209;&#8209;course&#8209;name** | Name of the course to display on the chart. |

3. [task_duplicates.py](src/plots/task_duplicates.py) allows you to plot line charts how many duplicate submissions
Expand All @@ -243,7 +243,7 @@ docker run hyperstyle-analysis-prod:<VERSION> poetry run tasktracker_edu_validat
**Optional arguments**:

| Argument | Description |
|-------------------------------------|---------------------------------------------|
|-------------------------------------|---------------------------------------------|
| **&#8209;&#8209;course&#8209;name** | Name of the course to display on the chart. |

Charts plotted with this module can be found in [this section](#visualization).
Expand Down Expand Up @@ -280,7 +280,7 @@ then your module should be named `Introduction-LastPush-CompleteTheProject`
**Optional arguments**:

| Argument | Description |
|--------------------------------------------------|-----------------------------------------------------------------------------|
|--------------------------------------------------|-----------------------------------------------------------------------------|
| **&#8209;&#8209;timeout** | Timeout in seconds for subprocess to be executed. |
| **&#8209;&#8209;n&#8209;cpu** | Number of CPUs to use for parallel execution. |
| **&#8209;&#8209;force&#8209;ignore&#8209;tests** | Force to ignore substitution of test files if they are visible to the user. |
Expand Down Expand Up @@ -328,7 +328,7 @@ then your module should be named `Introduction-LastPush-CompleteTheProject`
**Optional arguments**:

| Argument | Description |
|-------------------------|------------------------------|
|-------------------------|------------------------------|
| **&#8209;&#8209;debug** | Run the script in debug mode |

Charts plotted with this module can be found in [this section](#visualization).
Expand Down
8 changes: 4 additions & 4 deletions jba/src/processing/tasktracker_edu_validation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import argparse
from pathlib import Path
from typing import Dict
from typing import Dict, Tuple

import pandas as pd

Expand Down Expand Up @@ -54,16 +54,16 @@ def research_to_email(users_path: Path, researches_path: Path) -> Dict[str, str]
EMAIL_COLUMN].to_dict()


def split_dataframe(filtered_df: pd.DataFrame, edu_df: pd.DataFrame, res_to_email: Dict[str, str]) -> ( # noqa: WPS320
pd.DataFrame, pd.DataFrame):
def split_dataframe(filtered_df: pd.DataFrame, edu_df: pd.DataFrame, res_to_email: Dict[str, str]) \
-> Tuple[pd.DataFrame, pd.DataFrame]:
filtered_df[EMAIL_COLUMN] = filtered_df[RESEARCH_ID_COLUMN].map(res_to_email)
edu_emails = edu_df[EMAIL_COLUMN].unique()
df_in_edu = filtered_df[filtered_df[EMAIL_COLUMN].isin(edu_emails)]
df_not_in_edu = filtered_df[~filtered_df[EMAIL_COLUMN].isin(edu_emails)]
return df_in_edu, df_not_in_edu


def validate(filtered_data: Path, edu_file: Path, destination_path: Path, res_to_email: Dict[str, str]) -> None:
def validate(filtered_data: Path, edu_file: Path, destination_path: Path, res_to_email: Dict[str, str]):
filtered_df = read_df(filtered_data)
edu_df = read_df(edu_file)
df_in_edu, df_not_in_edu = split_dataframe(filtered_df, edu_df, res_to_email)
Expand Down

0 comments on commit 65838c9

Please sign in to comment.