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

Fix bug #1931: when creating a new subset, use ReplaceMode #2090

Merged
merged 2 commits into from
Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ v0.16.0 (unreleased)

* Python 2.7 and 3.5 are no longer supported. [#2075]

* Always use replace mode when creating a new subset. [#2090]

* Fixed bugs in the profile viewer that occurred when using the profile viewer and
setting reference_data to a different value than the default one. [#2078]

Expand Down
7 changes: 7 additions & 0 deletions glue/core/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from glue.utils import CallbackMixin
from glue.core.data_factories import load_data
from glue.core.edit_subset_mode import ReplaceMode

MAX_UNDO = 50
"""
Expand Down Expand Up @@ -298,6 +299,12 @@ def do(self, session):

mode = session.edit_subset_mode
override_mode = self.extra.get('override_mode')
# when creating a new subset the creation mode is replace mode
# fix bug #1931
if override_mode is None:
if len(mode._edit_subset) == 0:
override_mode = ReplaceMode

mode.update(self.data_collection, self.subset_state, override_mode=override_mode)

def undo(self, session):
Expand Down