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

DPL-954: colour code wells on arraying page #1580

Merged
merged 32 commits into from
Feb 27, 2024

Conversation

StephenHulme
Copy link
Contributor

@StephenHulme StephenHulme commented Feb 13, 2024

Closes #1427

Changes proposed in this pull request

Screenshots:

Screenshot 2024-02-13 at 14 27 31 Screenshot 2024-02-20 at 14 24 27

Deployment Notes

This should be tested against Integration Suite in UAT to confirm no breaking changes are introduced.

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

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.

Code looks good (although I'm far from a JS expert)
I asked if there were Vue component unit tests, and if you could maybe test the scenarios where they delete/change barcodes.

C1: { pool_index: 3 },
D1: { pool_index: 4 },
C1: { pool_index: 2 },
D1: { pool_index: 3 },
})
})
Copy link
Member

Choose a reason for hiding this comment

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

Wondered if there were tests for the individual Vue components.

Also wondered what happens when they remove the last instance of a barcode from the scan boxes, does it free up that colour index to be used for the next new unique barcode?

Copy link
Member

Choose a reason for hiding this comment

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

It probably shouldn't right, if that one they delete was in the middle of the colour list you don't want complications with latter ones being re-coloured.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Vue component testing is a little shaky right now, but that aside for the moment, the colours are calculated from the order that the barcodes are entered at any one moment. Deleting the last barcode will allow that colour to be reused on the subsequent barcode. Deleting the barcode will cause all other codes to be shifted up by one. This is currently a technical limitation, but could be altered if we decide it's worth the extra effort.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added tests in 9735757 to show the behaviour of changing barcodes

Copy link
Member

Choose a reason for hiding this comment

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

Deleting the barcode will cause all other codes to be shifted up by one.

As in it shifts them up into new rack locations? I think that would be bad if that's what you mean, as they are probably physically placing the tubes in a rack as they scan them.

Copy link
Member

Choose a reason for hiding this comment

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

If you mean just shifted in colour index then that's acceptable I think. The colours are just a visual aid to see where the replicates are.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah sorry, yes that comment was unclear...
Removing a barcode will cause all assigned colours to shift up by 1, the second explanation is correct.

Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed that functionality too, the colours changing when you remove a barcode. I thought it was ok.

Copy link

codecov bot commented Feb 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.65%. Comparing base (4a9a421) to head (826d23c).
Report is 4 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1580   +/-   ##
========================================
  Coverage    90.65%   90.65%           
========================================
  Files          354      354           
  Lines         7273     7276    +3     
========================================
+ Hits          6593     6596    +3     
  Misses         680      680           
Flag Coverage Δ
javascript 93.64% <100.00%> (+0.02%) ⬆️
pull_request 90.65% <100.00%> (+<0.01%) ⬆️
push 90.65% <100.00%> (+<0.01%) ⬆️
ruby 90.21% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@StephenHulme StephenHulme requested review from andrewsparkes, KatyTaylor, seenanair and BenTopping and removed request for KatyTaylor and seenanair February 21, 2024 11:37
Copy link
Contributor

@BenTopping BenTopping left a comment

Choose a reason for hiding this comment

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

Haven't tested locally but changes seem sensible.


const tube_machine_barcode = tube.labware.labware_barcode.machine_barcode
const tube_machine_barcodes = this.tubes
.filter((tube) => tube.state === 'valid')
Copy link
Contributor

Choose a reason for hiding this comment

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

TubeArraySummary checks against tube.labware.state === 'passed'. Without knowing the difference in the components I wanted to check that was correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I must admit, I'm a little fuzzy on which states mean what. As far as I can tell, tube.state refers to whether the scanned in tube exists and is "valid", and tube.labware.state refers to the processing of a certain purpose (can be pending or failed)

.map((tube) => tube.labware.labware_barcode.machine_barcode)

const barcode_index = findUniqueIndex(tube_machine_barcodes, tube_machine_barcode)
if (barcode_index !== -1) colour_index = barcode_index + 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Annoying that the css colours list doesn't start at 0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.

I'm strongly considering refactoring the colours logic at some point soon.

Copy link
Contributor

@KatyTaylor KatyTaylor left a comment

Choose a reason for hiding this comment

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

Seems to work well locally for me apart from the one bug I mentioned to you. I've left a few comments - mostly suggestions for adding docs. I find the existing component code quite hard to follow (not your fault). Thanks for doing all the tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

I've had some trouble working out the data structure we're expecting for inputs and outputs of certain functions. Could we add docs, for example the following above the validTransfers function?

    //  validTransfers returns an array with the following structure:
    //
    //  [
    //    { tubeObj: { index: 0, tube: {...} }, targetWell: 'A1' },
    //    { tubeObj: { index: 1, tube: {...} }, targetWell: 'A2' },
    //    ...etc...
    //  ]
    //

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, started addressing in b4746cc, but more to come

Copy link
Contributor Author

Choose a reason for hiding this comment

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

More added in 4ded3e7

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And in 826d23c

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitely helps with understanding what is going on in the component!

Copy link

codeclimate bot commented Feb 23, 2024

Code Climate has analyzed commit 826d23c and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 90.2% (0.0% change).

View more on Code Climate.

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.

Looks good. Helpful comments and better tests now! Thx.

Copy link
Contributor

@KatyTaylor KatyTaylor left a comment

Choose a reason for hiding this comment

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

Great, thanks for adding those extra comments.

@StephenHulme StephenHulme merged commit 16b58cd into develop Feb 27, 2024
12 checks passed
@StephenHulme StephenHulme deleted the dpl-954-colour-code-wells-on-arraying-page branch February 27, 2024 13:21
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.

DPL-954 Colour code wells on arraying page
4 participants