Skip to content

Commit

Permalink
MAINT: changes to address test failures from python 3.9 update (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
lizgehret authored May 2, 2024
1 parent 93558f4 commit 32b01b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion q2_longitudinal/_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ def _maz_score(metadata, predicted, column, group_by, control):
# calculate maturity and MAZ scores in all samples
maturity_scores = []
maz_scores = []
for i, v in metadata[predicted].iteritems():
for i, v in metadata[predicted].items():
_median, _std = medians[metadata.loc[i][column]]
maturity = v - _median
maturity_scores.append(maturity)
Expand Down
9 changes: 6 additions & 3 deletions q2_longitudinal/tests/test_longitudinal.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,8 @@ def test_first_differences_nonnumeric_metric_error(self):
def test_first_differences_taxa(self):
exp = pd.read_csv(self.get_data_path(
'ecam-taxa-first-differences.tsv'),
sep='\t', squeeze=True, index_col=0)
sep='\t', index_col=0)
exp = exp.squeeze('columns')
obs = first_differences(
metadata=self.md_ecam_fp, state_column='month',
individual_id_column='studyid',
Expand Down Expand Up @@ -945,7 +946,8 @@ def test_first_distances_one_subject_many_times(self):

def test_first_distances_ecam(self):
exp = pd.read_csv(self.get_data_path(
'ecam-first-distances.tsv'), sep='\t', squeeze=True, index_col=0)
'ecam-first-distances.tsv'), sep='\t', index_col=0)
exp = exp.squeeze('columns')
obs = first_distances(
distance_matrix=self.md_ecam_dm, metadata=self.md_ecam_fp,
state_column='month', individual_id_column='studyid',
Expand Down Expand Up @@ -1030,8 +1032,9 @@ def test_maturity_index(self):
feature_count=10)
maz = pd.to_numeric(res[5].view(pd.Series))
exp_maz = pd.read_csv(
self.get_data_path('maz.tsv'), sep='\t', squeeze=True, index_col=0,
self.get_data_path('maz.tsv'), sep='\t', index_col=0,
header=0)
exp_maz = exp_maz.squeeze('columns')
pdt.assert_series_equal(
maz, exp_maz, check_dtype=False, check_index_type=False,
check_series_type=False, check_names=False)
Expand Down

0 comments on commit 32b01b7

Please sign in to comment.