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

Fix using .A instead of .toarray() #61

Merged
merged 30 commits into from
Dec 2, 2024
Merged

Fix using .A instead of .toarray() #61

merged 30 commits into from
Dec 2, 2024

Conversation

michalk8
Copy link
Collaborator

@michalk8 michalk8 commented Aug 5, 2024

No description provided.

@michalk8 michalk8 added the bug Something isn't working label Aug 5, 2024
@michalk8 michalk8 self-assigned this Aug 5, 2024
@michalk8 michalk8 requested a review from msmdev August 5, 2024 23:28
Copy link
Owner

@msmdev msmdev left a comment

Choose a reason for hiding this comment

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

I'm not really getting the motivation/justification for your changes here. Could you please explain the reasoning behind them to me? Thank you!

@@ -524,6 +525,7 @@ def test_gpcca_brandts_sparse_is_not_densified(self, P: np.ndarray, sd: np.ndarr
with pytest.raises(ValueError, match=r"Sparse implementation is only available for `method='krylov'`."):
GPCCA(csr_matrix(P), eta=sd, method="brandts").optimize(3)

@pytest.mark.skipif(Version(np.__version__) >= Version("2"), reason="Eigenvalue mismatch.")
Copy link
Owner

Choose a reason for hiding this comment

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

So you skip this test if numpy version is >=2? Why is it ok for newer numpy versions to fail this test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've been trying to figure out why new numpy version causes this test to fail, but was unable to figure it out. I will try later do a bisect on the commits, see exactly why, but was thinking in the meantime we could just skip it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've reverted this, will leave this for a future PR to investigate.

tests/conftest.py Show resolved Hide resolved
@michalk8
Copy link
Collaborator Author

I'm not really getting the motivation/justification for your changes here. Could you please explain the reasoning behind them to me? Thank you!

Regarding the changes in the docs, sphinx was throwing some warning, so I corrected the template and conf.py - no warnings now!

@msmdev
Copy link
Owner

msmdev commented Nov 9, 2024

There are currently a lot of strange issues:

  • failing sphinx during lint: "TypeError: can only concatenate str (not "_StrPath") to str")
  • strange errors for py3.10-noslepc and py3.9-slepc: "ERROR: InvocationError for command /home/runner/work/pyGPCCA/pyGPCCA/.tox/py3.10-noslepc/bin/python -m pytest --cov --cov-append --cov-report=term-missing --cov-config=/home/runner/work/pyGPCCA/pyGPCCA/tox.ini --ignore docs/ -vv (exited with code 1)"
  • the tests py3.11-noslepc and py3.12-noslepc still fail because of the known issues with test_sort_real_schur() and new numpy versions
  • the macos-latest-test pretends to succeed but actually fails with "ERROR: Cannot locate the conda executable."

Honestly, I don't understand what is going on here...

@michalk8 maybe you have an idea?

@michalk8
Copy link
Collaborator Author

Fixed:

  • failing sphinx during lint: "TypeError: can only concatenate str (not "_StrPath") to str")
  • strange errors for py3.10-noslepc and py3.9-slepc: "ERROR: InvocationError for command /home/runner/work/pyGPCCA/pyGPCCA/.tox/py3.10-noslepc/bin/python -m pytest --cov --cov-append --cov-report=term-missing --cov-config=/home/runner/work/pyGPCCA/pyGPCCA/tox.ini --ignore docs/ -vv (exited with code 1)"
  • the macos-latest-test pretends to succeed but actually fails with "ERROR: Cannot locate the conda executable."

As for the failing tests with numpy>=2.0, I unfortunately have no idea; will try to go over the changelog and see what might've broken the tests.

In the future, I plan refactor/modernize the installation and building of docs.

name: ${{ matrix.os }}-${{ matrix.python }}-${{ matrix.slepc }}
env_vars: OS,PYTHON
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@msmdev could you please create and add this token to the repo secrets?

Copy link
Owner

Choose a reason for hiding this comment

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

Seems that it was already there in the repo secrets...

@codecov-commenter
Copy link

codecov-commenter commented Nov 18, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.21%. Comparing base (ec4b04e) to head (8df37dc).
Report is 16 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

❗ There is a different number of reports uploaded between BASE (ec4b04e) and HEAD (8df37dc). Click for more details.

HEAD has 60 uploads less than BASE
Flag BASE (ec4b04e) HEAD (8df37dc)
unittests 60 0
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #61      +/-   ##
==========================================
- Coverage   77.80%   70.21%   -7.59%     
==========================================
  Files           7        8       +1     
  Lines         973      997      +24     
  Branches      172      173       +1     
==========================================
- Hits          757      700      -57     
- Misses        135      219      +84     
+ Partials       81       78       -3     
Flag Coverage Δ
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@msmdev
Copy link
Owner

msmdev commented Dec 2, 2024

Interestingly, now we are getting a different picture regarding the failing test, which was hidden by the seemingly passing MacOS tests:
while for Liunx test_gpcca.py::TestGPCCAMatlabUnit::test_sort_real_schur[X] (for X=M_2, ..., M_5) is failing in all cases (slepc & noslepc), for MacOS test_gpcca.py::TestGPCCAMatlabUnit::test_sort_real_schur[X] isn't failing but instead the following tests fail:

  • test_gpcca.py::TestCustom::test_P_2_LM[brandts],
  • test_gpcca.py::TestCustom::test_split_warning_LM,
  • test_gpcca.py::TestCustom::test_split_raise_LM,
  • test_gpcca.py::TestCustom::test_P_2_LR[brandts],
  • test_gpcca.py::TestCustom::test_P_2_LR[brandts],
  • test_gpcca.py::TestCustom::test_split_raise_LR

@msmdev
Copy link
Owner

msmdev commented Dec 2, 2024

This difference is quite interesting. Maybe it is a result of differences in system architecture? Do you know, on what type of processors the MacOS tests are running: Intel (as Linux) or ARM?

@msmdev
Copy link
Owner

msmdev commented Dec 2, 2024

@michalk8, thank you very much for solving the issues related to outdated runners, dependencies and several other legacy issues!
I will merge the PR now to get those improvements upstream.
We should look into the failing tests in a new PR as you suggested.

@msmdev msmdev merged commit 773c463 into main Dec 2, 2024
4 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants