robotools 1.5.1__tar.gz → 1.5.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: robotools
3
- Version: 1.5.1
3
+ Version: 1.5.2
4
4
  Summary: Pythonic in-silico liquid handling and creation of Tecan FreedomEVO worklists.
5
5
  Home-page: https://github.com/jubiotech/robotools
6
6
  Author: Michael Osthege
7
7
  Author-email: m.osthege@fz-juelich.de
8
8
  License: GNU Affero General Public License v3
9
- Download-URL: https://github.com/jubiotech/robotools/tarball/1.5.1
9
+ Download-URL: https://github.com/jubiotech/robotools/tarball/1.5.2
10
10
  Description: UNKNOWN
11
11
  Platform: UNKNOWN
12
12
  Classifier: Programming Language :: Python
@@ -4,4 +4,4 @@ from .liquidhandling import Labware, Trough, VolumeOverflowError, VolumeUnderflo
4
4
  from .transform import WellRotator, WellShifter, make_well_array, make_well_index_dict
5
5
  from .utils import DilutionPlan, get_trough_wells
6
6
 
7
- __version__ = "1.5.1"
7
+ __version__ = "1.5.2"
@@ -3446,6 +3446,16 @@ class TestWellRandomizer(unittest.TestCase):
3446
3446
  numpy.testing.assert_array_equal(expected, derandomized)
3447
3447
  return
3448
3448
 
3449
+ def test_derandomize_wells_bug_29(self) -> None:
3450
+ A = (6, 8)
3451
+ S = 13
3452
+ randomizer = transform.WellRandomizer(A, S)
3453
+ original = ["A01", "F02", "A05", "A07", "B07", "D06"][::-1]
3454
+ expected = ["A01", "A02", "A03", "A04", "A05", "A06"][::-1]
3455
+ derandomized = randomizer.derandomize_wells(original)
3456
+ numpy.testing.assert_array_equal(expected, derandomized)
3457
+ return
3458
+
3449
3459
 
3450
3460
  if __name__ == "__main__":
3451
3461
  unittest.main()
@@ -203,6 +203,7 @@ class WellRandomizer:
203
203
  self.original_wells = make_well_array(*self.original_shape).flatten()
204
204
  self.randomized_wells = self.rng.permutation(self.original_wells).tolist()
205
205
  self.lookup = {owell: rwell for owell, rwell in zip(self.original_wells, self.randomized_wells)}
206
+ self.lookup_reverse = {rwell: owell for owell, rwell in self.lookup.items()}
206
207
  super().__init__()
207
208
 
208
209
  def randomize_wells(self, wells: ArrayLike) -> numpy.ndarray:
@@ -237,9 +238,8 @@ class WellRandomizer:
237
238
  derandomized_output_wells : ndarray
238
239
  Array of well ids
239
240
  """
240
- self.input_wells = numpy.array(wells)
241
- self.derandomized_output_wells = [
242
- key for key, value in self.lookup.items() if value in self.input_wells
243
- ]
241
+ input_wells = numpy.array(wells)
242
+ wells_shape = input_wells.shape
243
+ derandomized_output_wells = [self.lookup_reverse.get(well) for well in input_wells]
244
244
 
245
- return numpy.array(self.derandomized_output_wells)
245
+ return numpy.array(derandomized_output_wells).reshape(wells_shape)
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: robotools
3
- Version: 1.5.1
3
+ Version: 1.5.2
4
4
  Summary: Pythonic in-silico liquid handling and creation of Tecan FreedomEVO worklists.
5
5
  Home-page: https://github.com/jubiotech/robotools
6
6
  Author: Michael Osthege
7
7
  Author-email: m.osthege@fz-juelich.de
8
8
  License: GNU Affero General Public License v3
9
- Download-URL: https://github.com/jubiotech/robotools/tarball/1.5.1
9
+ Download-URL: https://github.com/jubiotech/robotools/tarball/1.5.2
10
10
  Description: UNKNOWN
11
11
  Platform: UNKNOWN
12
12
  Classifier: Programming Language :: Python
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes