Open open-risk opened 3 years ago
I think the depreciation is an opportunity to revisit the structure of the classes - they are so overloaded now with IO operations, matrix validation, manipulation, etc.
Can anything simple as below work?
from typing import List
import numpy as np
TM = np.ndarray
TMSet = List[TM]
def empty(dimensions: int) -> TM:
return np.identity(dimension)
Another idea is to hide ndarray
behind a dataclass, but leave non-essential methods out:
from dataclasses import dataclass
@dataclass
class TransitionMatrix:
matrix: np.ndarray
def matrix(values) -> TransitionMatrix:
pass
def read_csv(filename) -> TransitionMatrix:
pass
numpy.matrix is on a deprecation path, given than a transitionMatrix object derives from it, some alternative should be developed