Skip to content

New version with english comments #12762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update time_algo_exec.py
  • Loading branch information
robohie authored May 21, 2025
commit b0ada1106d5fa85cd6b9e49e8728f3871b9545b6
12 changes: 5 additions & 7 deletions other/time_algo_exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
def calc(operations: dict) -> float:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As there is no test file in this pull request nor any test function or class in the file other/time_algo_exec.py, please provide doctest for the function calc

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As there is no test file in this pull request nor any test function or class in the file other/time_algo_exec.py, please provide doctest for the function calc

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As there is no test file in this pull request nor any test function or class in the file other/time_algo_exec.py, please provide doctest for the function calc

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As there is no test file in this pull request nor any test function or class in the file other/time_algo_exec.py, please provide doctest for the function calc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What doctest for calc function are you talking about?

"""
calc(operation: dict) -> float:
Ce programme sert à calculer le temps d'éxecution des algorithmes en fonction
des opérations primitives traitées
:param operations: dictionnaire des couples (nombre de fois, temps d'exécution)
avec comme clé, l'opération primitive(de préférence)
:return: le temps d'exécution de l'algorithme si le format de "operations" est bon,
0 sinon

This function aims to calculate how long an algorithm take, knowing only primary operations

Check failure on line 8 in other/time_algo_exec.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E501)

other/time_algo_exec.py:8:89: E501 Line too long (95 > 88)
:param operations: A dictionary where the values are tuples, consisting of the number of times

Check failure on line 9 in other/time_algo_exec.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E501)

other/time_algo_exec.py:9:89: E501 Line too long (98 > 88)
an operation is performed and its execution time, and the key should

Check failure on line 10 in other/time_algo_exec.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E501)

other/time_algo_exec.py:10:89: E501 Line too long (91 > 88)
preferably be the name of the operation for better clarity and usability.

Check failure on line 11 in other/time_algo_exec.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E501)

other/time_algo_exec.py:11:89: E501 Line too long (96 > 88)
:return: the time needed for the execution of this algorithm(if format is okey for "operations") or 0

Check failure on line 12 in other/time_algo_exec.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E501)

other/time_algo_exec.py:12:89: E501 Line too long (105 > 88)
#>>> operations1 = {"addition":(2, 0.1), "subtraction":(1, 0.2)}
#>>> operations2 = {"addition":(2, 0.1), "subtraction":(1, 0.2, 1)}
#>>> calc(operations1)
Expand Down
Loading