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

ma order repair #67

Merged
merged 17 commits into from
Nov 23, 2024
Prev Previous commit
Next Next commit
Improve performance
goruha committed Nov 18, 2024
commit 68a0855c2a84a53f41617d24d896ec33eef0ebd0
3 changes: 1 addition & 2 deletions src/foapy/ma/order.py
Original file line number Diff line number Diff line change
@@ -118,7 +118,6 @@ def order(X, return_alphabet=False) -> np.ma.MaskedArray:

alphabet_values = alphabet(X)
order = general_order(ma.getdata(X))
mask = ma.getmaskarray(X)

power = len(alphabet_values)
length = len(X)
@@ -127,7 +126,7 @@ def order(X, return_alphabet=False) -> np.ma.MaskedArray:
alphabet_indecies = np.arange(power).reshape(power, 1)
result_mask = result_data != alphabet_indecies

indecies_selector = np.any(~np.logical_or(result_mask, mask), axis=1)
indecies_selector = np.any(~np.logical_or(result_mask, ma.getmaskarray(X)), axis=1)

if np.any(indecies_selector):
result_data = result_data[indecies_selector]