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 PacBio Data Transfer service #3477

Merged
merged 6 commits into from
Jul 29, 2024

Conversation

diitaz93
Copy link
Contributor

@diitaz93 diitaz93 commented Jul 29, 2024

Description

Closes https://github.com/Clinical-Genomics/add-new-tech/issues/69
Add PacBio data transfer service

Added

Changed

Fixed

How to prepare for test

  • Ssh to relevant server (depending on type of change)
  • Use stage: us
  • Paxa the environment: paxa
  • Install on stage (example for Hasta):
    bash /home/proj/production/servers/resources/hasta.scilifelab.se/update-tool-stage.sh -e S_cg -t cg -b [THIS-BRANCH-NAME] -a

How to test

  • Do ...

Expected test outcome

  • Check that ...
  • Take a screenshot and attach or copy/paste the output.

Review

  • Tests executed by
  • "Merge and deploy" approved by
    Thanks for filling in who performed the code review and the test!

This version is a

  • MAJOR - when you make incompatible API changes
  • MINOR - when you add functionality in a backwards compatible manner
  • PATCH - when you make backwards compatible bug fixes or documentation/instructions

Implementation Plan

  • Document in ...
  • Deploy this branch on ...
  • Inform to ...

@diitaz93 diitaz93 marked this pull request as ready for review July 29, 2024 10:15
@diitaz93 diitaz93 requested a review from a team as a code owner July 29, 2024 10:15
class PacBioDataTransferService(PostProcessingDataTransferService):

def __init__(self, metrics_service: PacBioMetricsParser):
super().__init__(metrics_service=metrics_service)
Copy link
Contributor

@seallard seallard Jul 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you calling the parent constructor like this? Seems wonky! 😄
I'd expect the constructor to look like

def __init__(self, metrics_service: PacBioMetricsParser):
    self.metrics_service = metrics_service

Also, is not the parent class abstract? It does not make sense to call the constructor of an abstract class!

Copy link
Contributor

@seallard seallard Jul 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read some more and it might make sense to call the parent constructor if there is shared logic in the constructor, I'll leave it to you! I guess you want to enforce a strict design of the components. But maybe you can think about this a bit more.

I'm more used to interfaces which work a bit differently, only specifying the expected methods to be available on the class implementing the interface. A single class can also implement multiple interfaces

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are fixing this later on.

super().__init__(metrics_service=metrics_service)

def get_post_processing_dtos(self, run_data: PacBioRunData) -> PacBioDTOs:
metrics: PacBioMetrics = self.metrics_service.parse_metrics(run_data)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing exceptions can be thrown from the metrics parsing, should they be caught here or just bubble up?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are fixing error handling in a later step

Copy link

Copy link
Contributor

@ChrOertlin ChrOertlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, we can change the constructors for all the other classes in one go later on.

Copy link
Contributor

@seallard seallard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Some concerns about how you intend to dump the DTO directly into the database model, creating a tight coupling between the two. I'd keep some nestling in the DTO because it is easier to understand what it contains that way.

Might need some error handling for the metrics parsing, unless that is done elsewhere.

Let me know if you have questions, ping me in slack or here 😄

@diitaz93 diitaz93 merged commit 7a5df2b into dev-pacbio-flow Jul 29, 2024
8 checks passed
@diitaz93 diitaz93 deleted the add-pacbio-data-transfer-service branch July 29, 2024 11:42
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

Successfully merging this pull request may close these issues.

4 participants