CHESSCore API Reference
CHESSCore is the in-memory "lab engine": the Location, Stock, Attribute, and Read types and the operations that act on them. It has no database dependency. The reference is split by topic:
- Locations & Operations: building locations, moving them, occupancy, locking and activity, transfers between wells, and instrument capability.
- Stocks: reagents, chemicals, organisms, stocks, and CHESS's extra units.
- Solution Chemistry: molar composition, pH, and acid/base equilibria.
- Attributes & Reads: environmental attributes, inheritance, and instrument reads.
- Interop: table and JSON conversion of stocks and locations.
The entry points most code starts from are build_location, move_into!, deposit!, transfer!, set_attribute!, and record_read!.
This page lists the error types CHESSCore throws and register_lab, which registers a lab's constants module. The Troubleshooting page explains the most common errors.
CHESSCore.register_lab — Method
register_lab(lab_module::Module)Makes CHESSCore aware of lab objects defined in a new lab module and allows the string macros @spc_str and @org_str to work with the objects. When defining new lab objects, make sure to call register_lab.
Example:
# in a custom module
module MyLab
using CHESSCore
function __init__()
...
CHESSCore.register_lab(MyLab)
...
end
end #moduleCHESSCore.AlreadyLocatedInError — Type
AlreadyLocatedInErrorThe two locations already share a parent-child relationship
CHESSCore.AmbiguousChildNameError — Type
AmbiguousChildNameError(loc,name,matches)More than one child of loc has the given name.
CHESSCore.AmbiguousOccupancyRuleError — Type
AmbiguousOccupancyRuleError(parent_kind,child_kind,matches)More than one category-based occupancy rule matches parent_kind/child_kind with no exact-kind rule to break the tie. Add an explicit exact-kind rule to resolve the ambiguity.
CHESSCore.ChildNotFoundError — Type
ChildNotFoundError(loc,name)No child of loc has the given name.
CHESSCore.FixedMembershipError — Type
FixedMembershipError(loc,msg)loc's children are fixed and cannot be added to or removed from through the normal movement API.
CHESSCore.LockedLocationError — Type
LockedLocationError(loc)The location cannot be moved because it is locked
CHESSCore.MixingError — Type
MixingError(chem,msg)chemical chem causes a mixing operation to be invalid
CHESSCore.OccupancyError — Type
OccupancyError(val,msg)The movement would overoccupy the parent, with an occupancy val greater than 1
CHESSCore.UncommittedLocationError — Type
UncommittedLocationError(loc)An uncommitted Location (no location_id) was passed to a function that requires the location to already be tracked in the database.
CHESSCore.WellCapacityError — Type
WellCapacityError(vol,cap)The volume vol exceeds the capacity cap of its well.