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

Experiment.subset doesn't support a single Str condition #337

Open
jeffhussmann opened this issue May 16, 2022 · 0 comments
Open

Experiment.subset doesn't support a single Str condition #337

jeffhussmann opened this issue May 16, 2022 · 0 comments

Comments

@jeffhussmann
Copy link

jeffhussmann commented May 16, 2022

The docstring for Experiment.subset describes support for providing a single condition as a string, but commit b71b1f8 added code to immediately cast the conditions argument into a list so that the code branch for handling a string can never be hit:

conditions = list(conditions)
if isinstance(conditions, str):
c = conditions
v = values
if c not in self.conditions:
raise util.CytoflowError("{} is not a condition".format(c))
if v not in list(self.conditions[c]):
raise util.CytoflowError("{} is not a value of condition {}".format(v, c))
else:
for c, v in zip(conditions, values):
if c not in self.conditions:
raise util.CytoflowError("{} is not a condition".format(c))
if v not in list(self.conditions[c]):
raise util.CytoflowError("{} is not a value of condition {}".format(v, c))

If you could clarify the intended behavior here (and what b71b1f8 was fixing), I would be happy to submit a pull request restoring string support.

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

No branches or pull requests

1 participant