Skip to content

Commit

Permalink
X
Browse files Browse the repository at this point in the history
  • Loading branch information
John Major committed Aug 18, 2024
1 parent dc5cc52 commit 883c003
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
54 changes: 27 additions & 27 deletions bloom_lims/bobjs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1889,8 +1889,8 @@ def handle_jsonb_filter(key, value, conditions):
return [result.euid for result in results]

class BloomContainer(BloomObj):
def __init__(self, bdb):
super().__init__(bdb)
def __init__(self, bdb, is_deleted=False, cfg_printers=False, cfg_fedex=False):
super().__init__(bdb,is_deleted=is_deleted, cfg_printers=cfg_printers, cfg_fedex=cfg_fedex)

def create_empty_container(self, template_euid):
return self.create_instances(template_euid)
Expand All @@ -1909,8 +1909,8 @@ def unlink_content(self, container_euid, content_euid):


class BloomContainerPlate(BloomContainer):
def __init__(self, bdb):
super().__init__(bdb)
def __init__(self, bdb, is_deleted=False, cfg_printers=False, cfg_fedex=False):
super().__init__(bdb,is_deleted=is_deleted, cfg_printers=cfg_printers, cfg_fedex=cfg_fedex)

def create_empty_plate(self, template_euid):
return self.create_instances(template_euid)
Expand Down Expand Up @@ -1969,8 +1969,8 @@ def organize_wells(self, wells, parent_container):


class BloomContent(BloomObj):
def __init__(self, bdb):
super().__init__(bdb)
def __init__(self, bdb, is_deleted=False, cfg_printers=False, cfg_fedex=False):
super().__init__(bdb,is_deleted=is_deleted, cfg_printers=cfg_printers, cfg_fedex=cfg_fedex)

def create_empty_content(self, template_euid):
"""_summary_
Expand All @@ -1986,8 +1986,8 @@ def create_empty_content(self, template_euid):


class BloomWorkflow(BloomObj):
def __init__(self, bdb):
super().__init__(bdb)
def __init__(self, bdb, is_deleted=False, cfg_printers=False, cfg_fedex=False):
super().__init__(bdb,is_deleted=is_deleted, cfg_printers=cfg_printers, cfg_fedex=cfg_fedex)

# This can be made more widely useful now that i've detangled the wf-wfs special relationship
def get_sorted_uuid(self, workflow_id):
Expand Down Expand Up @@ -2098,8 +2098,8 @@ def do_action_create_package_and_first_workflow_step(self, wf_euid, action_ds={}


class BloomWorkflowStep(BloomObj):
def __init__(self, bdb):
super().__init__(bdb)
def __init__(self, bdb, is_deleted=False, cfg_printers=False, cfg_fedex=False):
super().__init__(bdb,is_deleted=is_deleted, cfg_printers=cfg_printers, cfg_fedex=cfg_fedex)

def create_empty_workflow_step(self, template_euid):
return self.create_instances(template_euid)
Expand Down Expand Up @@ -2660,8 +2660,8 @@ def do_action_create_test_req_and_link_child_workflow_step(


class BloomReagent(BloomObj):
def __init__(self, bdb):
super().__init__(bdb)
def __init__(self, bdb, is_deleted=False, cfg_printers=False, cfg_fedex=False):
super().__init__(bdb,is_deleted=is_deleted, cfg_printers=cfg_printers, cfg_fedex=cfg_fedex)

def create_rgnt_24w_plate_TEST(self, rg_code="idt-probes-rare-mendelian"):
# I am taking a short cut and not taking time to think about making this generic.
Expand Down Expand Up @@ -2700,26 +2700,26 @@ def create_rgnt_24w_plate_TEST(self, rg_code="idt-probes-rare-mendelian"):


class BloomEquipment(BloomObj):
def __init__(self, bdb):
super().__init__(bdb)
def __init__(self, bdb, is_deleted=False, cfg_printers=False, cfg_fedex=False):
super().__init__(bdb,is_deleted=is_deleted, cfg_printers=cfg_printers, cfg_fedex=cfg_fedex)

def create_empty_equipment(self, template_euid):
return self.create_instances(template_euid)


class BloomObjectSet(BloomObj):
def __init__(self, bdb):
super().__init__(bdb)

def __init__(self, bdb, is_deleted=False, cfg_printers=False, cfg_fedex=False):
super().__init__(bdb,is_deleted=is_deleted, cfg_printers=cfg_printers, cfg_fedex=cfg_fedex)

# TODO -- is this used at all, and if so, is it used correctly?
class AuditLog(BloomObj):
def __init__(self, session, base):
super().__init__(session, base)


class BloomHealthEvent(BloomObj):
def __init__(self, bdb):
super().__init__(bdb)
def __init__(self, bdb, is_deleted=False, cfg_printers=False, cfg_fedex=False):
super().__init__(bdb,is_deleted=is_deleted, cfg_printers=cfg_printers, cfg_fedex=cfg_fedex)

def create_event(self):

Expand All @@ -2734,9 +2734,10 @@ def create_event(self):


class BloomFile(BloomObj):
def __init__(self, bdb, bucket_prefix=None):
super().__init__(bdb)


def __init__(self, bdb, bucket_prefix=None, is_deleted=False, cfg_printers=False, cfg_fedex=False):
super().__init__(bdb,is_deleted=is_deleted, cfg_printers=cfg_printers, cfg_fedex=cfg_fedex)

if bucket_prefix is None:
bucket_prefix = os.environ.get(
"BLOOM_DEWEY_S3_BUCKET_PREFIX", "set-a-bucket-prefix-in-the-dotenv-file"
Expand Down Expand Up @@ -3338,9 +3339,8 @@ def create_presigned_url(self,
# As in expiring s3 links and so on. Potentially allow sharing of files with hosting protocols like SFTP, etc...
class BloomFileReference(BloomObj):

def __init__(self, bdb):
super().__init__(bdb)

def __init__(self, bdb, is_deleted=False, cfg_printers=False, cfg_fedex=False):
super().__init__(bdb,is_deleted=is_deleted, cfg_printers=cfg_printers, cfg_fedex=cfg_fedex)


def create_file_reference(self, file_euid=None, reference_type='presigned', visibility='public', valid_duration=0, start_datetime=None, end_datetime=None, comments="", status="active", presigned_url="", file_set_euid=None, rclone_config={}):
Expand Down Expand Up @@ -3457,8 +3457,8 @@ def create_file_reference(self, file_euid=None, reference_type='presigned', visi
return file_reference

class BloomFileSet(BloomObj):
def __init__(self, bdb):
super().__init__(bdb)
def __init__(self, bdb, is_deleted=False, cfg_printers=False, cfg_fedex=False):
super().__init__(bdb,is_deleted=is_deleted, cfg_printers=cfg_printers, cfg_fedex=cfg_fedex)

def create_file_set(self, file_uids=[], file_set_metadata={}):
file_set = self.create_instance(
Expand Down
8 changes: 4 additions & 4 deletions tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
import sys
import os

bob_wf = BloomWorkflow(BLOOMdb3())
bob_wf = BloomWorkflow(BLOOMdb3(),cfg_fedex=True)

bob_wfs = BloomWorkflowStep(BLOOMdb3())
bob_wfs = BloomWorkflowStep(BLOOMdb3(), cfg_fedex=True)

bob_rg = BloomReagent(BLOOMdb3())
bob_rg = BloomReagent(BLOOMdb3(), cfg_fedex=True)

idt_plate_euid = bob_rg.create_rgnt_24w_plate_TEST('idt-probes-rare-mendelian')
naoh_plate_euid = bob_rg.create_rgnt_24w_plate_TEST('naoh')

from random import randint

ASSAY = "workflow/assay/hla-typing/1.2" if randint(0,9) > 99 else "workflow/assay/carrier-screen/3.9"
ASSAY = "workflow/assay/hla-typing/1.2" if int(sys.argv[2]) > 0 else "workflow/assay/carrier-screen/3.9"

giab_cx, giab_mx = bob_wf.create_container_with_content(
("container", "tube", "tube-generic-10ml", "1.0"),
Expand Down

0 comments on commit 883c003

Please sign in to comment.