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

Fix OligosynthesizeOligo serialization #396

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions autoprotocol/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import warnings

from collections import defaultdict
from dataclasses import dataclass, field
from dataclasses import dataclass, field, fields
from numbers import Number
from typing import Any, Dict, List, Optional, Tuple, Union

Expand Down Expand Up @@ -4197,7 +4197,6 @@ def gel_purify(

instructions = []
for pe in parsed_extracts:

lane_set = [e["lane"] for e in pe]

if len(lane_set) > max_well:
Expand Down Expand Up @@ -5090,7 +5089,7 @@ def flow_analyze(
if c.get("emission_wavelength"):
try:
Unit(c.get("emission_wavelength"))
except (UnitError) as e:
except UnitError as e:
raise UnitError(
"Each `emission_wavelength` "
"must be of type unit."
Expand All @@ -5102,7 +5101,7 @@ def flow_analyze(
if c.get("excitation_wavelength"):
try:
Unit(c.get("excitation_wavelength"))
except (UnitError) as e:
except UnitError as e:
raise UnitError(
"Each `excitation_wavelength` "
"must be of type unit."
Expand Down Expand Up @@ -5717,7 +5716,6 @@ def mag_mix(
return self._add_mag(mag, head, new_tip, new_instruction, "mix")

def image_plate(self, ref: Union[str, Container], mode: str, dataref: str):

"""
Capture an image of the specified container.

Expand Down Expand Up @@ -6594,6 +6592,7 @@ def _refify(
Ref,
Compound,
Informatics,
OligosynthesizeOligo,
],
):
"""
Expand Down Expand Up @@ -6631,6 +6630,10 @@ def _refify(
return op_data.as_dict()
elif isinstance(op_data, Informatics):
return self._refify(op_data.as_dict())
elif isinstance(op_data, OligosynthesizeOligo):
return self._refify(
{field.name: getattr(op_data, field.name) for field in fields(op_data)}
)
else:
return op_data

Expand Down
Loading