Skip to content

Conversation

Michael-T-McCann
Copy link
Contributor

Addresses #576. Is there a better place to put the text about world coordinates?

Copy link

codecov bot commented Feb 11, 2025

Codecov Report

Attention: Patch coverage is 42.85714% with 4 lines in your changes missing coverage. Please review.

Project coverage is 93.49%. Comparing base (4d04018) to head (0dfdf10).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
scico/linop/xray/astra.py 42.86% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #578      +/-   ##
==========================================
- Coverage   93.55%   93.49%   -0.06%     
==========================================
  Files          92       92              
  Lines        6182     6186       +4     
==========================================
  Hits         5783     5783              
- Misses        399      403       +4     
Flag Coverage Δ
unittests 93.49% <42.86%> (-0.06%) ⬇️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@@ -604,12 +620,15 @@ def __init__(

if not isinstance(det_count, (list, tuple)) or len(det_count) != 2:
raise ValueError("Expected det_count to be a tuple with 2 elements.")
if angles is not None and vectors is not None:
raise ValueError("`angles` and `vectors` are mutually exclusive.")
Copy link
Collaborator

@bwohlberg bwohlberg Feb 11, 2025

Choose a reason for hiding this comment

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

Perhaps "Parameters angles and vectors ..."? Also, exceptions typically go to a text console, so no point in adding markup. (Also applies to other exceptions in this PR.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Understood about error messages going to the console, but I do think it's useful to have some marker that we are talking about a parameter name. E.g., numpy uses single quotes.

 sum() missing 1 required positional argument: 'a'

Copy link
Collaborator

Choose a reason for hiding this comment

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

Fair point. But for consistency we should make a note (perhaps a new issue) to also apply that principle elsewhere in the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Issue #583 created.

@@ -65,13 +65,18 @@ def _project_coords(
x_volume: np.ndarray, vol_geom: VolumeGeometry, proj_geom: ProjectionGeometry
) -> np.ndarray:
"""
Transform volume (logical) coordinates into world coordinates based
Project volume (logical) coordinates into detector coordinates based
Copy link
Collaborator

@bwohlberg bwohlberg Feb 11, 2025

Choose a reason for hiding this comment

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

Is this a change of terminology from "world coordinates" to "detector coordinates"? If so, corresponding changes are required elsewhere for consistency.

Why are volume coordinates "logical"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not a change in terminology, the previous docstring was incorrect.

Re volume vs logical: I hoped "logical" communicates that they are like integer indexes, but I'm removing it because I do not think it helps.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks as if "logical" is still present.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It would also be good to mention somewhere what "world" coordinates mean.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added to the module docstring after all.

@@ -95,7 +100,10 @@ def project_world_coordinates(
"""Project world coordinates along ray into the specified basis.

Project world coordinates along `ray` into the basis described by `u`
and `v` with center `d`.
and `v` with center `d`. The term ""world"" emphasizes that the
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why double quotes on either side of "world"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want that to print as

The term "world" emphasizes...

using the quotes to indicate I'm talking about a word as word. I think the double double quotes escapes the double quotes to achieve that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I couldn't confirm this since the function in question isn't included in the rendered API docs, but it would be worth checking that this syntax usage is correct in case this function ever does get included in the docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is no longer an issue given that I moved the discussion to the module docstring and rephrased.

@bwohlberg
Copy link
Collaborator

... Is there a better place to put the text about world coordinates?

The discussion might work better in the module docstring at the beginning of the file.

@bwohlberg
Copy link
Collaborator

... Is there a better place to put the text about world coordinates?

The discussion might work better in the module docstring at the beginning of the file.

No comment?

@Michael-T-McCann
Copy link
Contributor Author

... Is there a better place to put the text about world coordinates?

The discussion might work better in the module docstring at the beginning of the file.

No comment?

Added a discussion of this to the module docstring.

@Michael-T-McCann Michael-T-McCann merged commit 58ecaa4 into main Apr 4, 2025
17 of 19 checks passed
@bwohlberg bwohlberg linked an issue Apr 6, 2025 that may be closed by this pull request
@Michael-T-McCann Michael-T-McCann deleted the mike/576 branch May 20, 2025 22:02
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.

Omissions in xray.astra docs
2 participants