Skip to content
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

fix: fix linting issues in main,benchmark, and generate #33

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions bosco/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import os
import sys
from timeit import repeat
from typing import List, Tuple
from typing import Any, List, Tuple


def run_sorting_algorithm(
file_path: str, algorithm: str, array: List[int]
file_path: str, algorithm: str, array: List[Any]
) -> Tuple[float, float, float]:
"""Run a sorting algorithm and profile it with the timeit package."""
directory, file_name = os.path.split(file_path)
Expand Down
6 changes: 5 additions & 1 deletion bosco/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ def generate_random_container(
type_: str = "int",
) -> List[Union[int, float, str]]:
"""Generate a random list defined by the size and element type."""
random_list: List[Union[int, float, str]] = []

if type_ == "int":
# Generate a list of random integers within the range [1, size*size]
random_list = [random.randint(1, size * size) for _ in range(size)]
elif type_ == "float":
# Generate a list of random floating-point numbers within the range [1, size*size]
random_list = [random.uniform(1, size * size) for _ in range(size)]
random_list = [
float(random.uniform(1, size * size)) for _ in range(size)
]
elif type_ == "str":
# Generate a list of random strings of length 10 composed of letters and digits
random_list = [
Expand Down
6 changes: 3 additions & 3 deletions bosco/main.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Bosco runs benchmarks to assess the performance of Python functions."""

import plotly.graph_objs as go
import plotly.graph_objs as go # type: ignore
import typer
from plotly.subplots import make_subplots
from plotly.subplots import make_subplots # type: ignore
from rich.console import Console
from tabulate import tabulate
from tabulate import tabulate # type: ignore

from bosco import benchmark, generate

Expand Down
12 changes: 6 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions poetry.toml

This file was deleted.

Loading