Skip to content

Commit

Permalink
refactor get_assay_path() (#2016)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkonie committed Sep 27, 2024
1 parent fb21ffb commit d9fa11f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Changed
- Update REST API views for OpenAPI compatibility (#1951)
- Send iRODS delete request emails to all addresses of user (#2000)
- Disable ontology term select box while querying (#1974)
- Refactor ``SampleSheetAssayPluginPoint.get_assay_path()`` (#2016)
- **Taskflowbackend**
- Refactor task tests (#2002)
- Unify user name parameter naming in flows (#1653)
Expand Down
15 changes: 11 additions & 4 deletions samplesheets/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -937,20 +937,27 @@ class SampleSheetAssayPluginPoint(PluginPoint):
#: Irodsbackend IrodsAPI object
irods_backend = None

#: iRDOS path for the assay for which the plugin is initialized
assay_path = None

def __init__(self):
super().__init__()
self.irods_backend = get_backend_api('omics_irods')

def get_assay_path(self, assay):
"""
Helper for getting the assay path.
Return the iRODS path for the given assay.
:param assay: Assay object
:return: Full iRODS path for the assay
"""
if not self.irods_backend:
return None
return self.irods_backend.get_path(assay)
if not self.assay_path:
self.assay_path = (
self.irods_backend.get_path(assay)
if self.irods_backend and assay
else None
)
return self.assay_path

def get_row_path(self, row, table, assay, assay_path):
"""
Expand Down

0 comments on commit d9fa11f

Please sign in to comment.