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

Provide documentation for key methods #142

Open
pnrobinson opened this issue Mar 7, 2024 · 0 comments
Open

Provide documentation for key methods #142

pnrobinson opened this issue Mar 7, 2024 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@pnrobinson
Copy link
Member

Hi @lnrekerle @ielis

It would be really helpful to have documentation for all non-trivial methods. I am trying to hunt down the cause of the probable bug noted here, and I am getting to this and it would be helpful to have some explanation of what the two grouping predicates are and why the method returns None if both are false (why not have a third grouping predicate? How is other code expected to use this). Not having this kind of documentation makes it hard for others to work on the code, and it will make it hard for us to go back to it after a year or two. Please @lnrekerle add documentation for methods like this as you go through. If it is unclear then ask @ielis.

 def test(self, patient: Patient) -> typing.Optional[PatientCategory]:
        self._check_patient(patient)

        if len(patient.variants) == 0:
            return None
        
        results = [False, False]
        for variant in patient.variants:
            for ann in variant.tx_annotations:
                if ann.transcript_id == self._tx_id:
                    for var_eff in ann.variant_effects:
                        if var_eff == self._effect1:
                            results[0] = True
                        if var_eff == self._effect2:
                            results[1] = True
        if results == [True, False]:
            return GroupingPredicate.FIRST
        elif results == [False, True]:
            return GroupingPredicate.SECOND
        else:
            return None
@ielis ielis added the documentation Improvements or additions to documentation label Mar 12, 2024
@ielis ielis added this to the Manuscript milestone Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants