Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sir-sigurd committed Apr 6, 2023
1 parent 345cf15 commit ab5c024
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
7 changes: 3 additions & 4 deletions api/python/quilt3/formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def all_supported_formats(cls):
]:
try:
mod = importlib.import_module(mod_name)
except ImportError: # pragma: no cover
except ImportError:
pass
else:
cls.search(getattr(mod, cls_name))
Expand Down Expand Up @@ -1036,7 +1036,6 @@ def deserialize(self, bytes_obj, meta=None, ext=None, **format_opts):
ParquetFormatHandler().register() # latest is preferred


# noinspection PyPackageRequirements
class AnnDataFormatHandler(BaseFormatHandler):
"""Format for AnnData <--> .h5ad
Expand All @@ -1055,7 +1054,7 @@ class AnnDataFormatHandler(BaseFormatHandler):

def handles_type(self, typ: type) -> bool:
# don't load module unless we actually have to use it.
if 'anndata' not in sys.modules: # pragma: no cover
if 'anndata' not in sys.modules:
return False
import anndata as ad
self.handled_types.add(ad.AnnData)
Expand All @@ -1076,7 +1075,7 @@ def serialize(self, obj, meta=None, ext=None, **format_opts):
def deserialize(self, bytes_obj, meta=None, ext=None, **format_opts):
try:
import anndata as ad
except ImportError: # pragma: no cover
except ImportError:
raise QuiltException("Please install quilt3[anndata]")

buf = io.BytesIO(bytes_obj)
Expand Down
1 change: 0 additions & 1 deletion api/python/tests/test_formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from quilt3.util import QuiltException

# Constants

data_dir = pathlib.Path(__file__).parent / 'data'


Expand Down

0 comments on commit ab5c024

Please sign in to comment.