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

Add ruff linting for docstrings #161

Open
FloLimebit opened this issue Aug 12, 2024 · 1 comment
Open

Add ruff linting for docstrings #161

FloLimebit opened this issue Aug 12, 2024 · 1 comment
Assignees
Labels
docs Related to documentation epic-task Tasks under an epic p-medium Priority: Medium python Related to the python medmodels refactor Related to refactoring

Comments

@FloLimebit
Copy link
Member

📝 Describe the issue with the documentation

We need proper linting for google style docstrings

💡 Suggest what to add or change

Follow the Ruff guide for docstrings linting - the "D" Family of linting rules: https://docs.astral.sh/ruff/faq/#does-ruff-support-numpy-or-google-style-docstrings

Adjust each errornous docstring

📎 Additional context

No response

@FloLimebit FloLimebit added python Related to the python medmodels docs Related to documentation p-medium Priority: Medium refactor Related to refactoring labels Aug 12, 2024
@FloLimebit FloLimebit self-assigned this Aug 12, 2024
@JabobKrauskopf
Copy link
Member

from typing import Callable, List, Union


class EdgeOperation: ...


class EdgeIndex: ...


class EdgeOperandValue:
    def less_than(
        self, other: Union["EdgeOperandValues", "EdgeOperandValue"]
    ) -> None: ...
    def add(self, value: int) -> "EdgeOperandValue": ...


class EdgeOperandValues:
    def less_than(self, other: "EdgeOperandValues") -> None: ...
    def max(self) -> "EdgeOperandValue": ...


class EdgeOperand:
    def in_group(self, group: str) -> None: ...
    def attribute(self, attribute: str) -> EdgeOperandValues: ...
    def connects_to(self, query: Callable[["NodeOperand"], None]) -> "EdgeOperand": ...


class NodeOperation: ...


class NodeIndex: ...


class NodeOperand:
    def outgoing_edges(self) -> EdgeOperand: ...
    def in_group(self, group: str) -> None: ...


class MedRecord:
    def select_nodes(self, query: Callable[[NodeOperand], None]) -> List[NodeIndex]: ...


medrecord = MedRecord()


def query(node: NodeOperand):
    edges_to_treatment = node.outgoing_edges().connects_to(
        lambda node2: node2.in_group("treatment")
    )

    edges_to_outcome = node.outgoing_edges().connects_to(
        lambda node2: node2.in_group("outcome")
    )

    max_time_edge = edges_to_treatment.attribute("time").max().add(5)

    max_time_edge.less_than(edges_to_outcome.attribute("time"))


medrecord.select_nodes(query)

@FloLimebit FloLimebit added the epic-task Tasks under an epic label Aug 20, 2024
FloLimebit added a commit that referenced this issue Aug 27, 2024
FloLimebit added a commit that referenced this issue Sep 26, 2024
FloLimebit added a commit that referenced this issue Sep 26, 2024
FloLimebit added a commit that referenced this issue Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Related to documentation epic-task Tasks under an epic p-medium Priority: Medium python Related to the python medmodels refactor Related to refactoring
Projects
None yet
Development

No branches or pull requests

2 participants