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-1031 - File name improvements #1752

Merged
merged 8 commits into from
Jul 4, 2024

Conversation

BenTopping
Copy link
Contributor

@BenTopping BenTopping commented Jun 28, 2024

Closes #1521

Changes proposed in this pull request

  • Extends exports.yml documentation
  • Adds ability to specify independent filename for exports
  • Adds ability to prepend barcodes in exports filename
  • Adds ability to include parent labware barcode in exports filename

Instructions for Reviewers

There are no independent unit tests, mainly because the exports_controller tests it by proxy and it is has a different style of testing. But I have tested manually with a few variations and it is working.

Copy link

codecov bot commented Jun 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.36%. Comparing base (cfe817e) to head (f3c55a7).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1752      +/-   ##
===========================================
+ Coverage    91.35%   91.36%   +0.01%     
===========================================
  Files          372      373       +1     
  Lines         7660     7669       +9     
===========================================
+ Hits          6998     7007       +9     
  Misses         662      662              
Flag Coverage Δ
javascript 93.65% <ø> (ø)
pull_request 91.36% <100.00%> (?)
push 91.36% <100.00%> (+0.01%) ⬆️
ruby 91.05% <100.00%> (+0.01%) ⬆️

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.

app/controllers/tubes/tubes_exports_controller.rb Outdated Show resolved Hide resolved
app/controllers/exports_controller.rb Outdated Show resolved Hide resolved
app/controllers/tubes/tubes_exports_controller.rb Outdated Show resolved Hide resolved
app/controllers/exports_controller.rb Outdated Show resolved Hide resolved
@BenTopping BenTopping marked this pull request as ready for review July 2, 2024 10:18
app/controllers/exports_controller.rb Outdated Show resolved Hide resolved
def handle_filename_barcode(filename, labware, options)
return filename if options.blank? || labware.blank?

barcode = labware.barcode.human
Copy link
Contributor

Choose a reason for hiding this comment

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

Interested to see labware.barcode.human here, as @StephenHulme found recently that the human attribute wasn't present - see discussion here #1746 (comment)

Perhaps it's because Stephen was working with tubes and you're working with plates - maybe the API returns different things. Wonder if it would be worth doing something like

 barcode = labware.barcode.human || labware.barcode.machine

in case human is blank? Although in that case, not sure if labware.barcode.human would return nil or blow up.

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 point, the reason I did this was because labware.human_barcode didnt exist on some of my tests but labware.barcode.human did. I haven't run into a nil case for it yet but happy to add some handling for it. Would a machine barcode be more useful than just showing nil? They can manually edit it if it there are any issues.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure! I guess if the machine barcode is a 13-digit ean13 barcode it's not that useful. But in Stephen's case, he had a FluidX ('foreign') tube barcode, and that didn't have a 'human' attribute but had the human readable barcode in 'machine'. So in that case I it would be handy to have that in the download. Not a massive deal here as it's just naming a file 🤷‍♀️

Copy link
Member

Choose a reason for hiding this comment

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

I guess from the users point of view the aim is to match the export file with the physical plate using it's barcode label, so unless what's in the filename matches what's displayed on the plate label (human readable) it is not useful. Important for driver files where they are loading a plate on the robot and using the file to drive transfers for it.
And they (mostly) don't transfer to/from tubes on robots.
Odd there is no human attribute on tube labware barcodes. Maybe we should fix that.

app/controllers/tubes/tubes_exports_controller.rb Outdated Show resolved Hide resolved
Copy link

codeclimate bot commented Jul 3, 2024

Code Climate has analyzed commit f3c55a7 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 91.0% (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 to me, useful enhancements, thx!

@KatyTaylor KatyTaylor merged commit d347ec1 into develop Jul 4, 2024
12 checks passed
@KatyTaylor KatyTaylor deleted the DPL-1031-file-name-improvements branch July 4, 2024 12:33
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-1031 File name improvements
4 participants