Skip to content

Commit

Permalink
Allow testing of graphics.karyotype
Browse files Browse the repository at this point in the history
  • Loading branch information
tanghaibao committed May 8, 2024
1 parent 21b8708 commit 6cc398a
Show file tree
Hide file tree
Showing 5 changed files with 73,454 additions and 6 deletions.
10 changes: 6 additions & 4 deletions jcvi/graphics/karyotype.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import sys

from typing import Optional
from typing import List, Optional

from ..apps.base import OptionParser, logger
from ..compara.synteny import SimpleFile
Expand Down Expand Up @@ -408,7 +408,7 @@ def __init__(
self.layout = layout


def main():
def main(args: List[str]):
p = OptionParser(__doc__)
p.add_argument(
"--basepair",
Expand Down Expand Up @@ -441,7 +441,7 @@ def main():
help="Style of chromosome labels",
)
p.set_outfile("karyotype.pdf")
opts, args, iopts = p.set_image_options(figsize="8x7")
opts, args, iopts = p.set_image_options(args, figsize="8x7")

if len(args) != 2:
sys.exit(not p.print_help())
Expand All @@ -467,6 +467,8 @@ def main():
image_name = update_figname(opts.outfile, iopts.format)
savefig(image_name, dpi=iopts.dpi, iopts=iopts)

return image_name


if __name__ == "__main__":
main()
main(sys.argv[1:])
1 change: 1 addition & 0 deletions tests/graphics/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading

0 comments on commit 6cc398a

Please sign in to comment.