Skip to content

Commit

Permalink
Remove use of "is" to compare with literals. (#28)
Browse files Browse the repository at this point in the history
This idiom (formerly ok?) now causes a SyntaxWarning.
  • Loading branch information
rpgoldman authored Jan 23, 2021
1 parent 0930574 commit 8d39411
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions FlowCytometryTools/core/bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,9 +582,9 @@ def get_measurement_metadata(self, fields, ids=None, noneval=nan,
func = lambda x: x.get_meta_fields(fields)
meta_d = self.apply(func, ids=ids, applyto='measurement',
noneval=noneval, output_format='dict')
if output_format is 'dict':
if output_format == 'dict':
return meta_d
elif output_format is 'DataFrame':
elif output_format == 'DataFrame':
from pandas import DataFrame as DF
meta_df = DF(meta_d, index=fields)
return meta_df
Expand Down Expand Up @@ -1001,11 +1001,11 @@ def apply(self, func, ids=None, applyto='measurement',

# Note: result should be of type dict or collection for the code
# below to work
if output_format is 'dict':
if output_format == 'dict':
return result
elif output_format is 'DataFrame':
elif output_format == 'DataFrame':
return self._dict2DF(result, noneval, dropna)
elif output_format is 'collection':
elif output_format == 'collection':
return result
else:
msg = ("output_format must be either 'dict' or 'DataFrame'. " +
Expand Down
8 changes: 4 additions & 4 deletions FlowCytometryTools/core/graph.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -540,10 +540,10 @@ def plot_heat_map(z, include_values=False,
# to the annotation.
auto_col_name, auto_col_labels, auto_row_name, auto_row_labels = extract_annotation(z)

if xtick_labels is 'auto': xtick_labels = auto_col_labels
if ytick_labels is 'auto': ytick_labels = auto_row_labels
if xlabel is 'auto': xlabel = auto_col_name
if ylabel is 'auto': ylabel = auto_row_name
if xtick_labels == 'auto': xtick_labels = auto_col_labels
if ytick_labels == 'auto': ytick_labels = auto_row_labels
if xlabel == 'auto': xlabel = auto_col_name
if ylabel == 'auto': ylabel = auto_row_name

if isinstance(z, pandas.DataFrame):
values = z.values
Expand Down

0 comments on commit 8d39411

Please sign in to comment.