Skip to content

Commit 594c1b4

Browse files
authored
Merge branch 'master' into fix/issue-484-pydantic-validate-call
2 parents 0113cb6 + 4595147 commit 594c1b4

26 files changed

Lines changed: 625 additions & 513 deletions

malariagen_data/anoph/aim_data.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,4 @@ def plot_aim_heatmap(
341341

342342
if show: # pragma: no cover
343343
fig.show(renderer=renderer)
344-
return None
345-
else:
346-
return fig
344+
return fig

malariagen_data/anoph/cnv_data.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -810,9 +810,7 @@ def plot_cnv_hmm_coverage_track(
810810

811811
if show:
812812
bkplt.show(fig)
813-
return None
814-
else:
815-
return fig
813+
return fig
816814

817815
@_check_types
818816
@doc(
@@ -884,9 +882,7 @@ def plot_cnv_hmm_coverage(
884882

885883
if show:
886884
bkplt.show(fig)
887-
return None
888-
else:
889-
return fig
885+
return fig
890886

891887
@_check_types
892888
@doc(
@@ -1028,9 +1024,7 @@ def plot_cnv_hmm_heatmap_track(
10281024

10291025
if show:
10301026
bkplt.show(fig)
1031-
return None
1032-
else:
1033-
return fig
1027+
return fig
10341028

10351029
@_check_types
10361030
@doc(
@@ -1100,6 +1094,4 @@ def plot_cnv_hmm_heatmap(
11001094

11011095
if show:
11021096
bkplt.show(fig)
1103-
return None
1104-
else:
1105-
return fig
1097+
return fig

malariagen_data/anoph/dipclust.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,11 @@ def plot_diplotype_clustering(
189189

190190
if show: # pragma: no cover
191191
fig.show(renderer=renderer)
192-
return None
193-
else:
194-
return {
195-
"figure": fig,
196-
"dendro_sample_id_order": np.asarray(leaf_data["sample_id"].to_list()),
197-
"n_snps": n_snps_used,
198-
}
192+
return {
193+
"figure": fig,
194+
"dendro_sample_id_order": np.asarray(leaf_data["sample_id"].to_list()),
195+
"n_snps": n_snps_used,
196+
}
199197

200198
def diplotype_pairwise_distances(
201199
self,
@@ -800,6 +798,4 @@ def plot_diplotype_clustering_advanced(
800798

801799
if show:
802800
fig.show(renderer=renderer)
803-
return None
804-
else:
805-
return fig
801+
return fig

malariagen_data/anoph/distance.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,4 @@ def plot_njt(
614614

615615
if show: # pragma: no cover
616616
fig.show(renderer=renderer)
617-
return None
618-
else:
619-
return fig
617+
return fig

malariagen_data/anoph/frq_base.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,7 @@ def plot_frequencies_heatmap(
401401

402402
if show: # pragma: no cover
403403
fig.show(renderer=renderer)
404-
return None
405-
else:
406-
return fig
404+
return fig
407405

408406
@_check_types
409407
@doc(
@@ -553,9 +551,7 @@ def plot_frequencies_time_series(
553551

554552
if show: # pragma: no cover
555553
fig.show(renderer=renderer)
556-
return None
557-
else:
558-
return fig
554+
return fig
559555

560556
@_check_types
561557
@doc(

malariagen_data/anoph/fst.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,7 @@ def plot_fst_gwss_track(
257257

258258
if show: # pragma: no cover
259259
bokeh.plotting.show(fig)
260-
return None
261-
else:
262-
return fig
260+
return fig
263261

264262
@_check_types
265263
@doc(
@@ -345,9 +343,7 @@ def plot_fst_gwss(
345343

346344
if show: # pragma: no cover
347345
bokeh.plotting.show(fig)
348-
return None
349-
else:
350-
return fig
346+
return fig
351347

352348
@_check_types
353349
@doc(
@@ -590,6 +586,4 @@ def plot_pairwise_average_fst(
590586

591587
if show: # pragma: no cover
592588
fig.show(renderer=renderer)
593-
return None
594-
else:
595-
return fig
589+
return fig

malariagen_data/anoph/g123.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,7 @@ def plot_g123_gwss_track(
421421

422422
if show: # pragma: no cover
423423
bokeh.plotting.show(fig)
424-
return None
425-
else:
426-
return fig
424+
return fig
427425

428426
@_check_types
429427
@doc(
@@ -506,9 +504,7 @@ def plot_g123_gwss(
506504

507505
if show: # pragma: no cover
508506
bokeh.plotting.show(fig)
509-
return None
510-
else:
511-
return fig
507+
return fig
512508

513509
@_check_types
514510
@doc(
@@ -607,9 +603,7 @@ def plot_g123_calibration(
607603

608604
if show: # pragma: no cover
609605
bokeh.plotting.show(fig)
610-
return None
611-
else:
612-
return fig
606+
return fig
613607

614608

615609
def _diplotype_frequencies(gt):

malariagen_data/anoph/genome_features.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,7 @@ def plot_transcript(
312312

313313
if show: # pragma: no cover
314314
bokeh.plotting.show(fig)
315-
return None
316-
else:
317-
return fig
315+
return fig
318316

319317
@_check_types
320318
@doc(
@@ -514,9 +512,7 @@ def plot_genes(
514512

515513
if show: # pragma: no cover
516514
bokeh.plotting.show(fig)
517-
return None
518-
else:
519-
return fig
515+
return fig
520516

521517
def _plot_genes_setup_data(self, *, region):
522518
attributes = [a for a in self._gff_default_attributes if a != "Parent"]

malariagen_data/anoph/genome_sequence.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,13 @@ def genome_sequence(
117117

118118
# Deal with region start and stop.
119119
slice_start = slice_stop = None
120-
if resolved_region.start:
120+
if resolved_region.start is not None:
121+
if resolved_region.start < 1:
122+
raise ValueError("Region start must be >= 1 or None.")
121123
slice_start = resolved_region.start - 1
122-
if resolved_region.end:
124+
if resolved_region.end is not None:
125+
if resolved_region.end < 1:
126+
raise ValueError("Region end must be >= 1 or None.")
123127
slice_stop = resolved_region.end
124128
loc_region = slice(slice_start, slice_stop)
125129

malariagen_data/anoph/h12.py

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,7 @@ def plot_h12_calibration(
221221
fig.xaxis.ticker = window_sizes
222222
if show: # pragma: no cover
223223
bokeh.plotting.show(fig)
224-
return None
225-
else:
226-
return fig
224+
return fig
227225

228226
def _h12_gwss(
229227
self,
@@ -438,9 +436,7 @@ def plot_h12_gwss_track(
438436

439437
if show: # pragma: no cover
440438
bokeh.plotting.show(fig)
441-
return None
442-
else:
443-
return fig
439+
return fig
444440

445441
@_check_types
446442
@doc(
@@ -525,9 +521,7 @@ def plot_h12_gwss(
525521

526522
if show: # pragma: no cover
527523
bokeh.plotting.show(fig)
528-
return None
529-
else:
530-
return fig
524+
return fig
531525

532526
@_check_types
533527
@doc(
@@ -649,9 +643,7 @@ def plot_h12_gwss_multi_overlay_track(
649643

650644
if show: # pragma: no cover
651645
bokeh.plotting.show(fig)
652-
return None
653-
else:
654-
return fig
646+
return fig
655647

656648
@_check_types
657649
@doc(
@@ -740,9 +732,7 @@ def plot_h12_gwss_multi_overlay(
740732

741733
if show: # pragma: no cover
742734
bokeh.plotting.show(fig)
743-
return None
744-
else:
745-
return fig
735+
return fig
746736

747737
@_check_types
748738
@doc(
@@ -848,9 +838,7 @@ def plot_h12_gwss_multi_panel(
848838

849839
if show: # pragma: no cover
850840
bokeh.plotting.show(fig)
851-
return None
852-
else:
853-
return fig
841+
return fig
854842

855843

856844
def _garud_h12(ht):

0 commit comments

Comments
 (0)