strateos/transcriptic

container() error

bmiles opened this issue · 3 comments

When attempting to retrieve a container:

>>> container("ct14xw49m8awy9")
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    container("ct14xw49m8awy9")
  File "build/bdist.macosx-10.11-x86_64/egg/transcriptic/__init__.py", line 45, in container
    return _get_object(id, Container)
  File "build/bdist.macosx-10.11-x86_64/egg/transcriptic/__init__.py", line 26, in _get_object
    return klass(data['id'], data, connection = ctx)
  File "build/bdist.macosx-10.11-x86_64/egg/transcriptic/objects.py", line 177, in __init__
    self.containerType = parse_containerType()
  File "build/bdist.macosx-10.11-x86_64/egg/transcriptic/objects.py", line 176, in parse_containerType
    return ContainerType(**containerType)
TypeError: __new__() takes exactly 13 arguments (12 given)

It looks like this method:

def parse_containerType():
            from autoprotocol.container_type import _CONTAINER_TYPES, ContainerType
            from copy import deepcopy
            containerType = deepcopy(self.attributes["container_type"])

            containerType.pop("well_type", None)
            containerType.pop("id", None)
            if "dead_volume" not in containerType:
              containerType["dead_volume_ul"] = _CONTAINER_TYPES[containerType["shortname"]].dead_volume_ul

            return ContainerType(**containerType)
        self.containerType = parse_containerType()

Is expecting 13 args, but the API only gives 12 under the container type:

container_type: {
id: "micro-1.5",
name: "1.5mL Microcentrifuge tube",
well_count: 1,
well_type: null,
well_depth_mm: null,
well_volume_ul: "1500.0",
well_coating: null,
sterile: null,
capabilities: [
"spin",
"maxiprep_destination",
"miniprep_destination",
"sanger_sequence_primer",
"flash_freeze",
"spin",
"incubate"
],
shortname: "micro-1.5",
col_count: 1,
is_tube: true
},

From Autoprotocol-python:

class ContainerType(namedtuple("ContainerType",
                    ["name", "is_tube", "well_count",
                     "well_depth_mm", "well_volume_ul",
                     "well_coating", "sterile", "capabilities",
                     "shortname", "col_count", "dead_volume_ul", "safe_min_volume_ul"])):

It seems the API is not providing values for "dead_volume_ul", "safe_min_volume_ul". Though the API is giving an id, but ContainerType() does not require that.

Thanks for resolving this issue, Ben