Skip to content

Commit

Permalink
reformatted with black ahhhhhhhhhhhh
Browse files Browse the repository at this point in the history
  • Loading branch information
zb32 committed Jan 12, 2024
1 parent 18b4461 commit 5d51bec
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
10 changes: 8 additions & 2 deletions src/npg_irods/metadata/lims.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ def make_reduced_study_metadata(study: Study) -> list[AVU]:
return [avu_if_value(TrackedStudy.ID, study.id_study_lims)]


def make_sample_acl(seq:SeqConcept, sample: Sample, study: Study, zone=None) -> list[AC]:
def make_sample_acl(
seq: SeqConcept, sample: Sample, study: Study, zone=None
) -> list[AC]:
"""Returns an ACL for a given Sample in a Study.
This method takes into account all factors influencing access control, which are:
Expand Down Expand Up @@ -197,7 +199,11 @@ def make_sample_acl(seq:SeqConcept, sample: Sample, study: Study, zone=None) ->
irods_group = f"{STUDY_IDENTIFIER_PREFIX}{study.id_study_lims}_human"
else:
irods_group = f"{STUDY_IDENTIFIER_PREFIX}{study.id_study_lims}"
perm = Permission.NULL if sample.consent_withdrawn or (seq is not None and seq.value == "xahuman") else Permission.READ
perm = (
Permission.NULL
if sample.consent_withdrawn or (seq is not None and seq.value == "xahuman")
else Permission.READ
)

return [AC(irods_group, perm, zone=zone)]

Expand Down
8 changes: 6 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1031,8 +1031,12 @@ def illumina_synthetic_irods(tmp_path):
),
"12345/12345#1_xahuman.cram": (
AVU(idp, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"),
AVU(cmp, '{"id_run":12345, "position":1, "tag_index":1, "subset":"xahuman"}'),
AVU(cmp, '{"id_run":12345, "position":2, "tag_index":1, "subset":"xahuman"}'),
AVU(
cmp, '{"id_run":12345, "position":1, "tag_index":1, "subset":"xahuman"}'
),
AVU(
cmp, '{"id_run":12345, "position":2, "tag_index":1, "subset":"xahuman"}'
),
*run_pos,
AVU(tag, 1),
),
Expand Down
2 changes: 1 addition & 1 deletion tests/test_illumina.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def test_updates_human_permissions_mx(
]
new_permissions = [
AC("irods", perm=Permission.OWN, zone=zone),
AC("ss_4000_human", perm=Permission.READ, zone=zone),
AC("ss_4000_human", perm=Permission.READ, zone=zone),
]

for obj in [DataObject(path), DataObject(qc_path)]:
Expand Down

0 comments on commit 5d51bec

Please sign in to comment.