Skip to content

Implement Raster.astype - #423

Merged
b-j-karl merged 3 commits into
developfrom
copilot/implement-raster-astype
Mar 3, 2026
Merged

Implement Raster.astype#423
b-j-karl merged 3 commits into
developfrom
copilot/implement-raster-astype

Conversation

Copilot AI commented Feb 23, 2026

Copy link
Copy Markdown
Contributor
  • Add DTypeLike to TYPE_CHECKING imports in raster.py
  • Implement Raster.astype(dtype) method in raster.py
  • Add TestAstype test class in test_raster.py
  • Document Raster.astype in README under Cell-wise Operations
Original prompt

This section details on the original issue you should resolve

<issue_title>Implement Raster.astype</issue_title>
<issue_description>So we can do

slope_raster = slope_raster.astype("float32")

Instead of

slope_raster.arr = slope_raster.arr.astype("float32")

Useful for method chaining. Similar to to_crs and other cleanup methods</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement Raster.astype for method chaining Implement Raster.astype Feb 23, 2026
@nathanjmcdougall
nathanjmcdougall marked this pull request as ready for review March 2, 2026 22:28
@nathanjmcdougall
nathanjmcdougall marked this pull request as draft March 2, 2026 23:10
@nathanjmcdougall

Copy link
Copy Markdown
Contributor

@copilot please document this new function in the README

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>

Copilot AI commented Mar 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please document this new function in the README

Added Raster.astype(dtype) to the Cell-wise Operations section of the README in commit 4c3cb01.

@nathanjmcdougall
nathanjmcdougall marked this pull request as ready for review March 2, 2026 23:52
@t-t-sonarqube

t-t-sonarqube Bot commented Mar 2, 2026

Copy link
Copy Markdown

Comment thread src/rastr/raster.py
@b-j-karl
b-j-karl merged commit 6f85358 into develop Mar 3, 2026
15 checks passed
@b-j-karl
b-j-karl deleted the copilot/implement-raster-astype branch March 3, 2026 02:12
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.

Implement Raster.astype

3 participants