Skip to content

Clean __contains__#3

Open
stsievert wants to merge 1 commit intoraamana:masterfrom
stsievert:patch-2
Open

Clean __contains__#3
stsievert wants to merge 1 commit intoraamana:masterfrom
stsievert:patch-2

Conversation

@stsievert
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread pyradigm/pyradigm.py
else:
return False
"""Boolean test of membership of a sample in the dataset."""
return item in self.keys
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Hey Scott, thanks for the PR. For a simple test, the suggested code is certainly more compact. However, I planned to add more functionality for [non-]membership, in case of multiple items or a more complex test (e.g. missing data). I should perhaps add a note or TODO here to reflect that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What more complex test would you add? Isn't missing data not contained in the dataset?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

For example, when the missing data is partial, or data is not of certain type across all subjects. I'm still thinking through other use cases, though. But thanks for the suggestion to compactify it.

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.

2 participants