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

Y24-402 - Specify 'no. pools' rather than 'no. samples per pool' in submission #4467

Open
wants to merge 42 commits into
base: migrating-to-number-of-pools-epic
Choose a base branch
from

Conversation

dasunpubudumal
Copy link
Contributor

Closes #4423

Changes proposed in this pull request

Instructions for Reviewers

[All PRs] - Confirm PR template filled
[Feature Branches] - Review code
[Production Merges to main]
    - Check story numbers included
    - Check for debug code
    - Check version

@dasunpubudumal dasunpubudumal marked this pull request as draft October 28, 2024 14:09
Copy link

codecov bot commented Oct 30, 2024

Codecov Report

Attention: Patch coverage is 96.92308% with 2 lines in your changes missing coverage. Please review.

Project coverage is 89.21%. Comparing base (2f7cdbe) to head (9ef7c10).

Files with missing lines Patch % Lines
.../models/submission/validations_by_template_name.rb 96.87% 2 Missing ⚠️
Additional details and impacted files
@@                          Coverage Diff                          @@
##           migrating-to-number-of-pools-epic    #4467      +/-   ##
=====================================================================
- Coverage                              89.22%   89.21%   -0.02%     
=====================================================================
  Files                                   1392     1392              
  Lines                                  29830    29887      +57     
=====================================================================
+ Hits                                   26616    26663      +47     
- Misses                                  3214     3224      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dasunpubudumal dasunpubudumal marked this pull request as ready for review November 6, 2024 17:13
Copy link
Member

@andrewsparkes andrewsparkes left a comment

Choose a reason for hiding this comment

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

Minor comments. Just check that conditional formatting one where its still 5 and 25 and I can approve

app/models/submission/validations_by_template_name.rb Outdated Show resolved Hide resolved
app/models/submission/validations_by_template_name.rb Outdated Show resolved Hide resolved
app/models/submission/validations_by_template_name.rb Outdated Show resolved Hide resolved
config/bulk_submission_excel/conditional_formattings.yml Outdated Show resolved Hide resolved
promptTitle: "Samples per Pool"
prompt: "The requested number of samples per pool (between 5 and 25 inclusive)"
promptTitle: "Number of pools"
prompt: "The requested number pools (between 2 and 8 inclusive)"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be 1 and 8.
Was wrong in the story originally - my bad!

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for updating! conditional_formattings.yml still has the old range.

@dasunpubudumal dasunpubudumal changed the base branch from develop to migrating-to-number-of-pools-epic November 15, 2024 12:12
Copy link
Member

@andrewsparkes andrewsparkes left a comment

Choose a reason for hiding this comment

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

I left some comments and questions.
Think it needs better test coverage too.
Can discuss!

end
end

def apply_number_of_samples_per_pool_validation
# Creates groups of rows based on the study and project name (pool_number.e., study-project combinations)
Copy link
Member

Choose a reason for hiding this comment

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

what's pool_number.e. ?

@@ -45,13 +62,11 @@ def apply_additional_validations_by_template_name
#
# @param column_header [String] The header of the column to validate.
# @return [void]
# rubocop:disable Metrics/MethodLength,Metrics/AbcSize
# rubocop:disable Metrics/MethodLength
Copy link
Member

Choose a reason for hiding this comment

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

I keep running fowl of this rubocop, I wonder if we should increase the allowed length? it's too short

# rubocop:enable Metrics/MethodLength,Metrics/AbcSize
# rubocop:enable Metrics/MethodLength

def validate_samples_per_pool_for_labware
Copy link
Member

Choose a reason for hiding this comment

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

add method comments for new methods.
codepilot is pretty good at doing most of it if you highlight the method and ask it to 'add a method comment'

barcodes = rows.pluck(headers.index(HEADER_BARCODE))
well_locations = rows.pluck(headers.index(HEADER_PLATE_WELLS))

if plate?(barcodes, well_locations)
Copy link
Member

Choose a reason for hiding this comment

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

if it's not a plate or tube? e.g. we have tube racks now.
raise exception maybe

Copy link
Member

Choose a reason for hiding this comment

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

plus add test for tube


# rubocop:disable Metrics/AbcSize
# rubocop:disable Metrics/MethodLength
def validate_for_tubes(barcodes, rows)
Copy link
Member

Choose a reason for hiding this comment

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

refactor this? rubocop clearly not happy
ask codepilot for ideas?
plus add more test coverage

end

# Checks if the asset is either a tube or a plate.
def valid_labware?(barcodes, well_locations)
Copy link
Member

Choose a reason for hiding this comment

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

I don't like the look of this as a way to validate a labware. Where's this used in the code (search doesn't find it in your PR changes)? and why is there no test?
e.g. a TubeRack is a labware but won't have wells but is not a tube.
Maybe look for a valid sti_type? plate or tube if that's the only 2 types you want to allow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was probably something I had in a previous iteration and forgot to remove.

samples_per_pool += 1 if pool_number < remainder
next unless samples_per_pool > SAMPLES_PER_POOL[:max] || samples_per_pool < SAMPLES_PER_POOL[:min]

errors.add(
Copy link
Member

Choose a reason for hiding this comment

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

add test

unlocked: true
type: :integer
validation:
options:
type: :whole
operator: :between
formula1: "5"
formula2: "25"
formula1: "1"
Copy link
Member

Choose a reason for hiding this comment

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

just checking 1 is the minimum, I thought it was 2

Copy link
Member

Choose a reason for hiding this comment

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

you have 2-8 in the ranges below

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.

Y24-402 - Specify 'no. pools' rather than 'no. samples per pool' in submission
3 participants