Skip to content

Issue 131 - #132

Open
Athanaseus wants to merge 4 commits into
masterfrom
issue-131
Open

Issue 131#132
Athanaseus wants to merge 4 commits into
masterfrom
issue-131

Conversation

@Athanaseus

Copy link
Copy Markdown
Member

resolves #131

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 treat FLAG as discrete.
  • Convert boolean coldata to integer (0/1) to avoid downstream failures when plotting FLAG.
  • 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 coldata via astype(int) will upcast to platform int (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 thread .github/workflows/ci.yml
Comment on lines 3 to 8
on:
push:
branches:
- master
- '*'
tags:
- "*"
Comment thread shade_ms/data_mappers.py
Comment on lines +376 to +377
# Adding to treat flag as 0/1
if coldata.dtype == bool:
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.

Plotting FLAG column fails

2 participants