B12-514_AkbulatovArtur#177
Conversation
| azimuth: np.ndarray, | ||
| inclination: np.ndarray, | ||
| ) -> tuple[np.ndarray, np.ndarray, np.ndarray]: ... | ||
| def convert_to_sphere( |
|
линт ругается на первый сем |
| if M != M2 or K != K2: | ||
| raise ShapeMismatchError | ||
|
|
||
| Imx = np.eye(M) |
There was a problem hiding this comment.
У меня нет террабайта оперативной памяти :(
| coeffs = dots / lengths_sq | ||
| projs = np.zeros_like(matrix) | ||
|
|
||
| for i in range(len(matrix)): |
There was a problem hiding this comment.
Можно же projs = coeffs * matrix
| vector: np.ndarray, | ||
| ) -> tuple[np.ndarray | None, np.ndarray | None]: ... | ||
| ) -> tuple[np.ndarray | None, np.ndarray | None]: | ||
| if matrix.shape[0] != matrix.shape[1] or matrix.shape[1] != len(vector): |
There was a problem hiding this comment.
Зачем где-то len? Сделали бы все через .shape
| if matrix.shape[0] != matrix.shape[1] or matrix.shape[1] != len(vector): | ||
| raise ShapeMismatchError | ||
|
|
||
| if abs(np.linalg.det(matrix)) < 1e-10: |
There was a problem hiding this comment.
Использование детерменанта для определения сингулярности матрицы - это ошибка, так как при вычислении детерменанта из-за компьютерных ошибок вы можете получить любое число.
| import matplotlib.pyplot as plt | ||
| import numpy as np | ||
|
|
||
| script_dir = os.path.dirname(__file__) |
There was a problem hiding this comment.
Лучше было бы писать код в функции
| # ваш код | ||
| return FuncAnimation() | ||
|
|
||
| fig, ax = plt.subplots(figsize=(10, 6)) |
There was a problem hiding this comment.
Нет названия графика, легенды
| "id": "d7b00711", | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "outputs": [ |
There was a problem hiding this comment.
Много уж слишком длинных строк, лучше все-таки ограничится 3-4 операциями в строку (ну или меньше)
No description provided.