Skip to content

Commit

Permalink
Merge pull request #979: Use pandas.DataFrame.at instead of .loc for …
Browse files Browse the repository at this point in the history
…single values
  • Loading branch information
victorlin authored Aug 15, 2022
2 parents f148234 + 740fc85 commit f97b1cb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

* Upgrade treetime from 0.8.6 to >= 0.9.2 which enables a speedup of timetree inference in marginal mode due to the use of Fast Fourier Transforms [#1018][]. (@rneher and @anna-parker)

### Bug Fixes

* refine, export v1: Use pandas.DataFrame.at instead of .loc for single values [#979][]. (@victorlin)

[#979]: https://github.com/nextstrain/augur/pull/979

## 17.0.0 (9 August 2022)

### Major Changes
Expand Down
4 changes: 2 additions & 2 deletions augur/export_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ def add_tsv_metadata_to_nodes(nodes, meta_tsv, meta_json, extra_fields=['authors
continue
for field in fields:
# Allow fields to have value of 0! - but prevent from having value of "" (breaks auspice v1)
if field not in node and field in meta_tsv.columns and (meta_tsv.loc[strain, field] or meta_tsv.loc[strain, field]==0):
node[field] = meta_tsv.loc[strain, field]
if field not in node and field in meta_tsv.columns and (meta_tsv.at[strain, field] or meta_tsv.at[strain, field]==0):
node[field] = meta_tsv.at[strain, field]


def get_root_sequence(root_node, ref=None, translations=None):
Expand Down
2 changes: 1 addition & 1 deletion augur/refine.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def run(args):
# save input state string for later export
for n in T.get_terminals():
if n.name in metadata.index and 'date' in metadata.columns:
n.raw_date = metadata.loc[n.name, 'date']
n.raw_date = metadata.at[n.name, 'date']

if args.date_confidence:
time_inference_mode = 'always' if args.date_inference=='marginal' else 'only-final'
Expand Down

0 comments on commit f97b1cb

Please sign in to comment.