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

Bugfix/TCL_true_color #161

Merged
merged 1 commit into from
Oct 15, 2024
Merged

Bugfix/TCL_true_color #161

merged 1 commit into from
Oct 15, 2024

Conversation

manukala6
Copy link
Member

@manukala6 manukala6 commented Oct 10, 2024

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Make sure you are requesting to pull a topic/feature/bugfix branch (right side). Don't request your master!
  • Make sure you are making a pull request against the develop branch (left side). Also you should start your branch off our develop.
  • Check the commit's or even all commits' message styles matches our requested structure.
  • Check your code additions will fail neither code linting checks nor unit test.

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: GTC-2916

What is the new behavior?

  • Switches to using float values to calculate RGBA values for TCL

Does this introduce a breaking change?

  • Yes
  • No

Other information

@manukala6 manukala6 changed the base branch from production to dev October 10, 2024 18:35
@codecov-commenter
Copy link

⚠️ 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 79.76%. Comparing base (4fa29c0) to head (7938c11).

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

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #161      +/-   ##
==========================================
+ Coverage   79.73%   79.76%   +0.03%     
==========================================
  Files          57       57              
  Lines        1895     1898       +3     
==========================================
+ Hits         1511     1514       +3     
  Misses        384      384              
Flag Coverage Δ
unittests 79.76% <100.00%> (+0.03%) ⬆️

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.


return np.array([red, green, blue, alpha])
# Ensure GBA values are in [0, 255] range
green = np.clip(green, 0, 255).astype("uint8")
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you want to clip red to 255 as well? If not, can you put in a comment on why you don't need to clip it. (For instance, maybe intensity.shape is only a value between 0 and 1, so you know red is already between 0 and 228?)

@@ -99,20 +99,28 @@ def apply_annual_loss_filter(
year <= _end_year - 2000
)

red: ndarray = np.ones(intensity.shape).astype("uint8") * 228
# Construct RGBA bands with floating point values for precision
Copy link
Contributor

Choose a reason for hiding this comment

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

Any chance you can describe in a comment the type of intensity.shape, and what the possible range of its values are? That would also make it clearer why float32 is the right choice for maintaining accuracy (and for instance, why you don't need to use float64).

@manukala6 manukala6 merged commit 0c5026e into dev Oct 15, 2024
4 of 5 checks passed
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.

4 participants