-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from kymata-atlas/final-adjustments-to-plot_ex…
…pression_plot-ylim Automatically adjust y-limits and y-ticks of expression plots
- Loading branch information
Showing
3 changed files
with
105 additions
and
26 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from numpy import log10 | ||
|
||
from kymata.plot.plotting import _get_best_ylim, _MAJOR_TICK_SIZE | ||
|
||
|
||
def test_best_best_ylim_returns_supplied_ylim(): | ||
supplied_ylim = 1e-172 | ||
data_y_min = 1e-250 | ||
assert _get_best_ylim(ylim=supplied_ylim, data_y_min=data_y_min) == supplied_ylim | ||
|
||
|
||
def test_best_data_ylim_is_multiple_of_major_tick_size(): | ||
data_y_min = 1e-51 | ||
best_ylim = _get_best_ylim(ylim=None, data_y_min=data_y_min) | ||
assert -1 * log10(best_ylim) % _MAJOR_TICK_SIZE == 0 |