Skip to content

Б12-514 Беляев Кирилл#171

Open
qwerty-0s wants to merge 11 commits into
EvgrafovMichail:mainfrom
qwerty-0s:main
Open

Б12-514 Беляев Кирилл#171
qwerty-0s wants to merge 11 commits into
EvgrafovMichail:mainfrom
qwerty-0s:main

Conversation

@qwerty-0s
Copy link
Copy Markdown

No description provided.

@Avshugan Avshugan added the 514 label Mar 9, 2026
lhs: np.ndarray,
rhs: np.ndarray,
) -> np.ndarray: ...
) -> np.ndarray:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Не проходит ruff format

azimuth: np.ndarray,
inclination: np.ndarray,
) -> tuple[np.ndarray, np.ndarray, np.ndarray]: ...
) -> tuple[np.ndarray, np.ndarray, np.ndarray]:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Не проходит ruff format

def get_extremum_indices(
ordinates: np.ndarray,
) -> tuple[np.ndarray, np.ndarray]: ...
) -> tuple[np.ndarray, np.ndarray]:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Не проходит ruff format

) -> np.ndarray:
# ваш код
return image

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Есть решение быстрее

blurred_image = np.zeros_like(image)
image = pad_image(image, kernel_size // 2)

if len(image.shape) == 3:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Можно было использовать .ndim

blurred_image[i, j] = np.mean(
image[i : i + kernel_size, j : j + kernel_size], axis=(0, 1)
)
else:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Можно было без if, так код был бы проще

# ваш код

return 0, 0
if threshold < 1:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Есть решение быстрее

if threshold < 1:
raise ValueError("threshold must be positive")

colors = [0] * 256
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Лучше было бы 256 вынести в константу, чтобы было сразу понятно, что вы имеете ввиду количество цветов, и еще вы несколько раз используетее это число

)

elif diagram_type == "violin":
ax_diag_x.violinplot(abscissa, vert=False)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

А почему не настроили?

before_sum = {}
after_sum = {}
for cl in classes:
mask = before == cl
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Почему бы не использовать classes.count?

return before_sum, after_sum


classes = ["I", "II", "III", "IV"]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Лучше было бы писать код в фукнции

def modulated_signal_math(modulation, fc, t):
if modulation is None:
return np.sin(2 * np.pi * fc * t)
else:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

else не нужен

from matplotlib.animation import FuncAnimation


def run_wave(maze: np.ndarray, start: tuple[int, int], end: tuple[int, int]):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Не работает с большим лабиринтом (я запускал код, который был на момент дедлайна)

from matplotlib.animation import FuncAnimation


def modulated_signal_math(modulation, fc, t):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Нет легенды

"id": "d7b00711",
"metadata": {},
"outputs": [],
"outputs": [
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

В части 3, как будто можно было сделать циклом и код был бы проще и не было столько повторений одного и того же кода

"id": "d7b00711",
"metadata": {},
"outputs": [],
"outputs": [
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

В части 10 titanic_data["alone"] == True не имеет смысла, так как равносильно просто titanic_data["alone"] . Вообще если вы пишете == True, то скорее всего вы делаете что-то неправильно

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants