Skip to content

Conversation

@neal-ak
Copy link
Contributor

@neal-ak neal-ak commented Feb 5, 2025

Patches:

  • The change in Numpy v1.25.0 that depreciated the ambiguity of boolean operations on arrays with other types
  • The depreciation of Distutils in PEP 632 (Python10 and above)
  • Erroneous printing of an empty error message when the try-except block catches a clean early exit in the probe operation

I've cherry-picked the commits on top of the revert-9-fixes branch so master can be fast forwarded once #10 is merged.

@neal-ak neal-ak requested a review from patscott February 5, 2025 04:00
Comment on lines +46 to +48
clean_exit = False
if isinstance(err, SystemExit):
clean_exit = True if err.code == 0 else clean_exit
Copy link
Member

Choose a reason for hiding this comment

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

I find this construction kind of convoluted and therefore a bit difficult to follow. How about something like just

clean_exit = isinstance(err, SystemExit) and err.code == 0

?

Comment on lines +68 to +70
clean_exit = False
if isinstance(err, SystemExit):
clean_exit = True if err.code == 0 else clean_exit
Copy link
Member

Choose a reason for hiding this comment

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

same comment

lookup_key[index] = index_count
index_count += 1
non_functional_cols = [i for i, elem in enumerate(data) if data[i] != 'functional']
non_functional_cols = [i for i, elem in enumerate(data) if np.all(data[i] != 'functional')] # Numpy now requires the user cast to a scalar when performing boolean checks on arrays
Copy link
Member

Choose a reason for hiding this comment

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

This seems confusing, or at least not the optimal way to check. What's being checked for here is just whether data[i] is a string with value 'functional', or a numpy array. Better would probably be to just check if data[i] is a numpy array. Same for the following changes using np.all.

1. Make sure you have the following already installed:
* Either Python v2.7 or later or Python v3
* NumPy and SciPy libraries for python (NumPy v0.9.0 or
* Either Python v2.7 or later or Python v3.8 or later
Copy link
Member

Choose a reason for hiding this comment

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

Does the use of packaging for versioning break compatibility with Python 2.7? If so, we should just remove 2.7 here, there's no real need to support it any longer.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants