Skip to content

Commit

Permalink
Add __slots__ to classes that subclass xr.DataArray
Browse files Browse the repository at this point in the history
The absence of __slots__ triggers a warning.

Test plan: travis alltest!
  • Loading branch information
Tony Tung committed Oct 10, 2019
1 parent 58eb7ac commit d804cd5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions starfish/core/codebook/codebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class Codebook(xr.DataArray):
"""

__slots__ = ()

@property
def code_length(self) -> int:
"""return the length of codes in this codebook"""
Expand Down
2 changes: 2 additions & 0 deletions starfish/core/expression_matrix/expression_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class ExpressionMatrix(xr.DataArray):
load an ExpressionMatrix from netCDF
"""

__slots__ = ()

def save(self, filename: str) -> None:
"""Save an ExpressionMatrix as a Netcdf File
Expand Down
2 changes: 2 additions & 0 deletions starfish/core/intensity_table/decoded_intensity_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ class DecodedIntensityTable(IntensityTable):
"""

__slots__ = ()

@classmethod
def from_intensity_table(
cls,
Expand Down
2 changes: 2 additions & 0 deletions starfish/core/intensity_table/intensity_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ class IntensityTable(xr.DataArray):
* c (c) int64 0 1 2
"""

__slots__ = ()

@staticmethod
def _build_xarray_coords(
spot_attributes: SpotAttributes,
Expand Down

0 comments on commit d804cd5

Please sign in to comment.