Issue 131 - #132
Open
Athanaseus wants to merge 4 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes Issue #131 where plotting the MS FLAG column fails due to boolean dtype detection and downstream handling, and updates CI to exercise the FLAG plotting path.
Changes:
- Fix boolean dtype detection for discrete columns in
DataAxis.get_value()to correctly treatFLAGas discrete. - Convert boolean
coldatato integer (0/1) to avoid downstream failures when plottingFLAG. - Bump package version and expand CI to run an end-to-end command that plots
FLAG.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
shade_ms/data_mappers.py |
Fixes boolean dtype handling for discrete axes and coerces boolean data to numeric for plotting. |
pyproject.toml |
Bumps package version to 0.5.5. |
.github/workflows/ci.yml |
Broadens push trigger and adds an end-to-end CI run that plots with -a FLAG. |
Comments suppressed due to low confidence (2)
shade_ms/data_mappers.py:378
- Casting boolean
coldataviaastype(int)will upcast to platformint(typically int64), which can be a big memory/perf hit for large MS datasets. Since this is just to represent FLAG as 0/1, consider casting to a small integer type (e.g.np.uint8/np.int8) instead.
# Adding to treat flag as 0/1
if coldata.dtype == bool:
coldata = coldata.astype(int)
shade_ms/data_mappers.py:382
- Typo in error message: "chnaged" → "changed". Since this exception is user-facing (and referenced in issue #131), correcting it will make debugging clearer.
if self._is_discrete is True:
raise TypeError(f"{self.label}: column chnaged from discrete to continuous-valued. This is a bug, or a very weird MS.")
self._is_discrete = False
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
3
to
8
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| - '*' | ||
| tags: | ||
| - "*" |
Comment on lines
+376
to
+377
| # Adding to treat flag as 0/1 | ||
| if coldata.dtype == bool: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolves #131