Skip to content

Commit

Permalink
Merge branch '3936-dpl-969-support-for-chromium-chip-labware-1' into …
Browse files Browse the repository at this point in the history
…uat-26th-jan-24
  • Loading branch information
yoldas committed Jan 26, 2024
2 parents 81ce5dd + 23a8aac commit 5ee8084
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
5 changes: 5 additions & 0 deletions app/sequencescape/sequencescape/api/v2/plate_purpose.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

# plate purpose resource
class Sequencescape::Api::V2::PlatePurpose < Sequencescape::Api::V2::Base
end
24 changes: 17 additions & 7 deletions lib/purpose_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,25 @@ class Plate < PurposeConfig # rubocop:todo Style/Documentation
]
}.freeze

# Registers plate purpose within Sequencescape.
#
# @return [Sequencescape::Api::V2::PlatePurpose] the registered plate purpose
def register!
puts "Creating #{name}"
api.plate_purpose.create!(
name: name,
stock_plate: config.fetch(:stock_plate, false),
cherrypickable_target: config.fetch(:cherrypickable_target, false),
input_plate: config.fetch(:input_plate, false),
size: config.fetch(:size, 96)
)

# Plate purpose is registered using the version 2 of the API. This
# maintains the behaviour of version 1, but includes an addditional
# asset_shape option if configured. It raises an error if the purpose
# cannot be created.
options =
{
name: name,
stock_plate: config.fetch(:stock_plate, false),
cherrypickable_target: config.fetch(:cherrypickable_target, false),
input_plate: config.fetch(:input_plate, false),
size: config.fetch(:size, 96)
}.merge(config.slice(:asset_shape))
Sequencescape::Api::V2::PlatePurpose.create!(options)
end
end

Expand Down

0 comments on commit 5ee8084

Please sign in to comment.