Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patient interface missing observation, state and t #74

Open
drozzy opened this issue Oct 30, 2023 · 2 comments
Open

Patient interface missing observation, state and t #74

drozzy opened this issue Oct 30, 2023 · 2 comments

Comments

@drozzy
Copy link
Contributor

drozzy commented Oct 30, 2023

Patient interface is defined as :

"""Base class for patient"""


class Patient(object):
    def step(self, action):
        """
        Run one time step of the patient dynamiBodySimiFace_setPatisetPatient
        Input
            action: a namedtuple
        ------
        Outputs
            t: current time
            state: updated state
            observation: the observable states
        """
        raise NotImplementedError

    @staticmethod
    def model(t, state, action, params):
        """
        ordinary differential equations
        """
        raise NotImplementedError

    def reset(self):
        """
        Reset to the initial state
        Return observation
        """
        raise NotImplementedError

However, the code uses patient.observation, patient.state and patient.t.

Should those properties be part of the interface or not?
Additionally, it seems like the static method model is not really part of required interface, so could be removed.

@drozzy drozzy changed the title Patient interface missing observation and t Patient interface missing observation, state and t Oct 30, 2023
@drozzy
Copy link
Contributor Author

drozzy commented Oct 30, 2023

Something like this:

from abc import ABC, abstractmethod


class Patient(ABC):
    """
    Actual proper base class for patient, 
    that includes the parts missing from simglucose definition
    """
    @abstractmethod
    def step(self, action):
        """
        Run one time step of the patient dynamiBodySimiFace_setPatisetPatient
        Input
            action: a namedtuple
        ------
        Outputs
            t: current time
            state: updated state
            observation: the observable states
        """
        ...

    @abstractmethod
    def reset(self):
        """
        Reset to the initial state
        Return observation
        """
        ...

    @property
    @abstractmethod
    def t(self):
        ...

    @property
    @abstractmethod
    def state(self):
        ...

    @property
    @abstractmethod
    def observation(self):
        ...

@jxx123
Copy link
Owner

jxx123 commented Mar 16, 2024

The patient interface is a premature design choice. There is only one class T1DPatient is inheriting the interface. Any design on the base interface is redundant.

I think we should delete the Patient interface, and if we have plan to add say T2DPatient etc. in the future, we will add the base back with a design that meets the actual needs.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants