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

reduced state fix #395

Merged
merged 4 commits into from
Jul 9, 2024
Merged

reduced state fix #395

merged 4 commits into from
Jul 9, 2024

Conversation

RyosukeNORO
Copy link
Collaborator

Context:
There was a code that compare the value in numpy.ndarray and list in reduced_state (numpy.ndarray == list). This comparison was allowed in the previous version of numpy but prohibited in the latest one. Therefore, an error is raised.

Description of the Change:
Codes to convert the type from numpy.ndarray to list was added.

Benefits:
The error is fixed.

Possible Drawbacks:
This change may break other parts because codes to restore the type after the comparison have not been implemented.

Related GitHub Issues:

Copy link

codecov bot commented Jul 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (0e51518) to head (06df1f4).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #395   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           28        28           
  Lines         1912      1914    +2     
=========================================
+ Hits          1912      1914    +2     
Files with missing lines Coverage Δ
thewalrus/symplectic.py 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0e51518...06df1f4. Read the comment docs.

@@ -171,6 +171,9 @@ def reduced_state(mu, cov, modes):
"""
N = len(mu) // 2

if type(modes) == np.ndarray:
Copy link
Collaborator

Choose a reason for hiding this comment

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

You probably need to add a test to trigger this line.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you. I added the test!

@RyosukeNORO RyosukeNORO merged commit 087743d into master Jul 9, 2024
5 checks passed
@RyosukeNORO RyosukeNORO deleted the reduced-state-fix branch July 9, 2024 15:29
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.

2 participants