Skip to content

Conversation

@Eleven1Liu
Copy link
Contributor

@Eleven1Liu Eleven1Liu commented Jul 17, 2025

What does this PR do?

Upgrade minimum python version from 3.8 to 3.10 (related PR: #19). Code changes includes:

Test CLI & API (bash tests/autotest.sh)

Test APIs used by main.py.

  • Test Pass
    • (Copy and paste the last outputted line here.)
  • Not Applicable (i.e., the PR does not include API changes.)

Check API Document

If any new APIs are added, please check if the description of the APIs is added to API document.

  • API document is updated (linear, nn)
  • Not Applicable (i.e., the PR does not include API changes.)

Test quickstart & API (bash tests/docs/test_changed_document.sh)

If any APIs in quickstarts or tutorials are modified, please run this test to check if the current examples can run correctly after the modified APIs are released.

@Eleven1Liu Eleven1Liu requested review from a team and cjlin1 as code owners July 17, 2025 09:06
@Eleven1Liu Eleven1Liu added package versions Versions for related packages release PyPI release tag is in this PR documentation Improvements or additions to documentation labels Jul 17, 2025
@Eleven1Liu Eleven1Liu changed the title Upgrade minimum python version from 3.8 to 3.10 [WIP] Upgrade minimum python version from 3.8 to 3.10 Jul 17, 2025
@Eleven1Liu
Copy link
Contributor Author

merge before #19

@zhi-bao
Copy link
Contributor

zhi-bao commented Jul 18, 2025

Since the .A function is removed in SciPy 1.14+, we can define a to_dense(matrix) function to convert both NumPy matrix and SciPy sparse matrices into dense Numpy arrays, as shown in the following

def to_dense(matrix) -> np.ndarray:
    if scipy.sparse.issparse(matrix):
           return matrix.toarray()
   elif isinstance(matrix, numpy.matrix ):
          return matrix.A

Or, we can directly convert the result based on the type of x@self.weights in

return (x * self.weights).A + self.thresholds

@Eleven1Liu Eleven1Liu requested a review from zhi-bao July 19, 2025 09:52
@Eleven1Liu Eleven1Liu changed the title [WIP] Upgrade minimum python version from 3.8 to 3.10 Upgrade minimum python version from 3.8 to 3.10 Jul 19, 2025
@Eleven1Liu Eleven1Liu merged commit 8756b64 into master Jul 21, 2025
1 check passed
@Eleven1Liu Eleven1Liu deleted the python310 branch July 21, 2025 12:20
@Eleven1Liu Eleven1Liu mentioned this pull request Jul 25, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation package versions Versions for related packages release PyPI release tag is in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scipy 1.13.1 does not support Python 3.13 Deprecated functions are removed in scipy 1.14.0+

3 participants