Skip to content

Commit

Permalink
change inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
andycasey committed Oct 11, 2023
1 parent 3e15d24 commit 6aa92c8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 19 deletions.
21 changes: 12 additions & 9 deletions docs/sphinx/api.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@

.. _api:

semaphore Reference
=========================
API
===

.. _api-main:

Main
----
Targeting Flags
---------------

.. automodule:: semaphore.flags
.. automodule:: sdss_semaphore.targeting
:members:
:undoc-members:
:exclude-members: mapping, dtype
:inherited-members:
:show-inheritance:

.. automodule:: semaphore.reference
Base Flags
----------

.. automodule:: sdss_semaphore
:members:
:undoc-members:
:show-inheritance:
:show-inheritance:
2 changes: 1 addition & 1 deletion docs/sphinx/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The current version is |semaphore_version|. You can install the package by doing
Notebooks
---------

[Targeting flags](https://github.com/sdss/semaphore/blob/main/notebooks/20231011_sdss5_targeting.ipynb)
- `Targeting flags <https://github.com/sdss/semaphore/blob/main/notebooks/20231011_sdss5_targeting.ipynb>`_


Reference
Expand Down
4 changes: 2 additions & 2 deletions python/sdss_semaphore/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.2.0"
__version__ = "0.2.1"

import numpy as np
import warnings
Expand Down Expand Up @@ -89,7 +89,7 @@ def _count(self, bits_per_attribute, skip_empty: bool = False) -> dict:
counts[attribute] = count
return counts

def as_boolean_array(self):
def as_boolean_array(self) -> np.ndarray:
"""
Return a (N, F) shaped big-endian boolean array indicating whether each bit is set for
each item, where the input data array has shape (N, B) and `F = B * n_bits` is the maximum
Expand Down
9 changes: 2 additions & 7 deletions python/sdss_semaphore/targeting.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
from typing import Tuple
from sdss_semaphore import BaseFlags

class TargetingFlags(BaseFlags):

class BaseTargetingFlags(BaseFlags):

"""A base class for communicating SDSS-V targeting information with flags."""
"""Communicating SDSS-V targeting information with flags."""

@property
def all_mappers(self) -> Tuple[str]:
Expand Down Expand Up @@ -104,10 +103,6 @@ def count(self, skip_empty: bool = False) -> dict:
)


class TargetingFlags(BaseTargetingFlags):

"""Communicating with SDSS-V targeting flags."""

dtype, n_bits = (np.uint8, 8)
meta = { "SDSSC2BV": 1.0 }
mapping = {
Expand Down

0 comments on commit 6aa92c8

Please sign in to comment.