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

Address some docs build warnings #157

Merged
merged 4 commits into from
Jan 6, 2022
Merged

Address some docs build warnings #157

merged 4 commits into from
Jan 6, 2022

Conversation

bwohlberg
Copy link
Collaborator

Address some docs build warnings.

@bwohlberg bwohlberg added the documentation Improvements or additions to documentation label Jan 5, 2022
@bwohlberg bwohlberg added this to the Release 0.0.2 milestone Jan 5, 2022
@@ -169,7 +169,7 @@ class Diagonal(LinearOperator):

def __init__(
self,
diagonal: Union[Array, BlockArray],
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@Michael-T-McCann: I think this was originally added by you. Please conform that the change from Array to JaxArray (which silences the warning) is indeed correct.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think in this case, changing Array to JaxArray means that the developer using the linop has to create the jax array beforehand. If we leave it as Array, it can take a numpy array or anything and convert it inside it using the ensure_on_device method.

Essentially, the warning means that there is a conversion to JaxArray from np.array and I'm not sure if we want to allow the linop to be created using anything other than device/block arrays. To my knowledge, it doesn't affect anything code-wise due to the ensure_on_device but it brings attention to if we want to restrict it to that type.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's a reasonable argument, but it seems that all the other LinOps use JaxArray rather than Array. In fact, although Array is indeed defined in scico.typing, from a quick scan I couldn't find a single instance of it actually being used.

Copy link
Contributor

Choose a reason for hiding this comment

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

Given that other code uses JaxArray, let's go with JaxArray here.

As a general principle, I believe we are not going out of our way to be interoperable with numpy.

@codecov
Copy link

codecov bot commented Jan 5, 2022

Codecov Report

Merging #157 (46ac305) into main (305b744) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #157   +/-   ##
=======================================
  Coverage   92.13%   92.13%           
=======================================
  Files          48       48           
  Lines        3294     3294           
=======================================
  Hits         3035     3035           
  Misses        259      259           
Flag Coverage Δ
unittests 92.13% <ø> (ø)

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

Impacted Files Coverage Δ
scico/linop/_linop.py 97.77% <ø> (ø)

Continue to review full report at Codecov.

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

@bwohlberg bwohlberg merged commit f5fe2e7 into main Jan 6, 2022
@bwohlberg bwohlberg deleted the brendt/docs branch January 6, 2022 17:09
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants