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

Use pandas.DataFrame.at instead of .loc for single values #979

Merged
merged 2 commits into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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