|
47 | 47 | WORKFLOW, |
48 | 48 | Hasher, |
49 | 49 | ) |
| 50 | + |
50 | 51 | if TYPE_CHECKING: |
51 | | - from .provenance_profile import ProvenanceProfile |
| 52 | + from .provenance_profile import ProvenanceProfile # pylint: disable=unused-import |
52 | 53 |
|
53 | 54 |
|
54 | 55 | class ResearchObject: |
@@ -95,7 +96,13 @@ def initialize_provenance( |
95 | 96 | fsaccess: StdFsAccess, |
96 | 97 | run_uuid: Optional[uuid.UUID] = None, |
97 | 98 | ) -> "ProvenanceProfile": |
98 | | - """Provide a provenance profile initialization hook function to extend details as needed.""" |
| 99 | + """ |
| 100 | + Provide a provenance profile initialization hook function. |
| 101 | +
|
| 102 | + Allows overriding the default strategy to define the |
| 103 | + provenance profile concepts and associations to extend |
| 104 | + details as needed. |
| 105 | + """ |
99 | 106 | from .provenance_profile import ProvenanceProfile |
100 | 107 |
|
101 | 108 | return ProvenanceProfile( |
@@ -144,7 +151,15 @@ def _initialize_bagit(self) -> None: |
144 | 151 | bag_it_file.write(f"Tag-File-Character-Encoding: {ENCODING}\n") |
145 | 152 |
|
146 | 153 | def resolve_user(self) -> tuple[str, str]: |
147 | | - """Provide a user provenance hook function in case the calling code can provide a better resolution.""" |
| 154 | + """ |
| 155 | + Provide a user provenance hook function. |
| 156 | +
|
| 157 | + Allows overriding the default strategy to retrieve user provenance |
| 158 | + in case the calling code can provide a better resolution. |
| 159 | + The function must return a tuple of the (username, fullname) |
| 160 | + that identifies the user. This user will be applied on top |
| 161 | + to any provided ORCID or fullname by agent association. |
| 162 | + """ |
148 | 163 | return _whoami() |
149 | 164 |
|
150 | 165 | def user_provenance(self, document: ProvDocument) -> None: |
@@ -187,7 +202,13 @@ def user_provenance(self, document: ProvDocument) -> None: |
187 | 202 | document.actedOnBehalfOf(account, user) |
188 | 203 |
|
189 | 204 | def resolve_host(self) -> tuple[str, str]: |
190 | | - """Provide a host provenance hook function in case the calling code can provide a better resolution.""" |
| 205 | + """ |
| 206 | + Provide a host provenance hook function. |
| 207 | +
|
| 208 | + Allows overriding the default strategy to retrieve host provenance |
| 209 | + in case the calling code can provide a better resolution. |
| 210 | + The function must return a tuple of the (fqdn, uri) that identifies the host. |
| 211 | + """ |
191 | 212 | fqdn = getfqdn() |
192 | 213 | return fqdn, fqdn # allow for (fqdn, uri) to be distinct, but the same by default |
193 | 214 |
|
|
0 commit comments