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

Anopheles refactor #366

Open
16 of 24 tasks
alimanfoo opened this issue Mar 18, 2023 · 2 comments
Open
16 of 24 tasks

Anopheles refactor #366

alimanfoo opened this issue Mar 18, 2023 · 2 comments
Assignees

Comments

@alimanfoo
Copy link
Member

alimanfoo commented Mar 18, 2023

The AnophelesDataResource class is becoming a God class, there are a large number of methods covering different areas of functionality, and it is becoming unwieldy and hard to navigate and maintain.

Propose to refactor this somehow, compartmentalising different areas of functionality into separate classes.

This could be addressed in stages, breaking out different areas of functionality in different PRs:

@alimanfoo
Copy link
Member Author

We could do this using something along the lines of the mixin pattern (e.g., here).

E.g., we could have classes like AnophelesBase, AnophelesMetadata, AnophelesSnpData, AnophelesCnvData, AnophelesHaplotypeData, AnophelesPca, AnophelesH12, etc., each in their own module. The AnophelesDataResource class could then end up with the same API as now, but would be constructed like:

class AnophelesDataResource(
    AnophelesPca,
    AnophelesH12,
    AnophelesHaplotypeData,
    AnophelesSnpData,
    AnophelesCnvData,
    AnophelesMetadata,
    AnophelesBase):
    ....

Potential complexity here is that some of these mixin-style classes would depend on others. E.g., the AnophelesH12 class would depend on the AnophelesHaplotypeData class. But should be able to handle that if careful about order of superclasses.

@alimanfoo
Copy link
Member Author

Current slowest tests, to aid prioritisation:

image

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

No branches or pull requests

1 participant