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

Add "ago" #2991

Merged
merged 1 commit into from
Sep 24, 2024
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
2 changes: 1 addition & 1 deletion python/tests/data/svg/tree_both_axes.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion python/tests/data/svg/ts_max_trees.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion python/tests/data/svg/ts_max_trees_treewise.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion python/tests/data/svg/ts_multiroot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion python/tests/data/svg/ts_plain_y.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion python/tests/data/svg/ts_y_axis.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion python/tests/data/svg/ts_y_axis_regular.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions python/tests/test_drawing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License
#
# Copyright (c) 2018-2023 Tskit Developers
# Copyright (c) 2018-2024 Tskit Developers
# Copyright (C) 2017 University of Oxford
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -2697,7 +2697,7 @@ def test_known_svg_ts_y_axis(self, overwrite_viz, draw_plotbox):
tables.time_units = "generations"
ts = tables.tree_sequence()
svg = ts.draw_svg(y_axis=True, debug_box=draw_plotbox)
assert "Time (generations)" in svg
assert "Time ago (generations)" in svg
self.verify_known_svg(
svg, "ts_y_axis.svg", overwrite_viz, width=200 * ts.num_trees
)
Expand Down Expand Up @@ -2799,7 +2799,7 @@ def test_known_svg_ts_multiroot(self, overwrite_viz, draw_plotbox, caplog):
self.verify_known_svg(
svg, "ts_multiroot.svg", overwrite_viz, width=200 * ts.num_trees
)
assert "Time (generations)" in svg
assert "Time ago (generations)" in svg

def test_known_svg_ts_xlim(self, overwrite_viz, draw_plotbox, caplog):
ts = self.get_simple_ts()
Expand Down
2 changes: 1 addition & 1 deletion python/tskit/drawing.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ def __init__(
if time_scale == "rank":
y_label = "Node time"
else:
y_label = "Time"
y_label = "Time ago"
if ts.time_units != tskit.TIME_UNITS_UNKNOWN:
y_label += f" ({ts.time_units})"
self.x_label = x_label
Expand Down
Loading