Skip to content

Commit

Permalink
Adding some required-matching-length exceptions to EITransitionSolver
Browse files Browse the repository at this point in the history
  • Loading branch information
dmnapolitano committed Oct 9, 2023
1 parent 9ebe5c5 commit 9f49d83
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/elexsolver/EITransitionSolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ def fit_predict(self, X, Y):
X = np.transpose(X)
Y = np.transpose(Y)

if X.shape[1] != Y.shape[1]:
raise ValueError(f"Number of units in X ({X.shape[1]}) != number of units in Y ({Y.shape[1]}).")
if Y.shape[1] != len(self._n):
raise ValueError(f"Number of units in Y ({Y.shape[1]}) != number of units in n ({len(self._n)}).")

num_units = len(self._n) # should be the same as the number of units in Y
num_rows = X.shape[0] # number of things in X that are being transitioned "from"
num_cols = Y.shape[0] # number of things in Y that are being transitioned "to"
Expand Down

0 comments on commit 9f49d83

Please sign in to comment.