Skip to content

Commit

Permalink
Make BaseFeature an abstract class
Browse files Browse the repository at this point in the history
  • Loading branch information
rhiannonlynne committed Oct 1, 2024
1 parent dafbd95 commit b8f1807
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rubin_scheduler/scheduler/features/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
)

import warnings
from abc import ABC, abstractmethod

import healpy as hp
import numpy as np
Expand All @@ -35,7 +36,7 @@ def send_unused_deprecation_warning(name):
warnings.warn(message, FutureWarning)


class BaseFeature:
class BaseFeature(ABC):
"""The base class for features.
This defines the standard API: a Feature should include
a `self.feature` attribute, which could be a float, bool,
Expand Down Expand Up @@ -63,6 +64,7 @@ class BaseSurveyFeature(BaseFeature):
`add_observation_array`.
"""

@abstractmethod
def add_observations_array(self, observations_array, observations_hpid):
"""Update self.feature based on information in `observations_array`
and `observations_hpid`.
Expand All @@ -86,6 +88,7 @@ def add_observations_array(self, observations_array, observations_hpid):
print(self)
raise NotImplementedError

@abstractmethod
def add_observation(self, observation, indx=None, **kwargs):
"""Update self.feature based on information in `observation`.
Observations should be ordered in monotonically increasing time.
Expand Down

0 comments on commit b8f1807

Please sign in to comment.