Skip to content

Commit c30f31c

Browse files
authored
Merge pull request #76 from dnlbauer/fix_agent_without_name
Fix failing conversion if author name is not set
2 parents 8221800 + cbfd4c0 commit c30f31c

27 files changed

+2515
-4
lines changed

CITATION.cff

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ authors:
1010
- family-names: Crusoe
1111
given-names: Michael R.
1212
orcid: https://orcid.org/0000-0002-2961-9670
13+
- family-names: Bauer
14+
given-names: Daniel
15+
orcid: https://orcid.org/0000-0001-9447-460X
1316
title: "runcrate"
1417
version: 0.5.0
1518
doi: 10.5281/zenodo.7762627

src/runcrate/convert.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright 2022-2024 CRS4.
22
# Copyright 2023-2024 Michael R. Crusoe
3+
# Copyright 2024 Senckenberg Society for Nature Research
34
#
45
# Licensed under the Apache License, Version 2.0 (the "License");
56
# you may not use this file except in compliance with the License.
@@ -472,10 +473,12 @@ def add_agent(self, crate, roc_engine_run, engine):
472473
agent_id = a.identifier.uri
473474
if not agent_id.startswith("http"):
474475
agent_id = "#" + agent_id.rsplit(":", 1)[-1]
475-
ro_a = crate.add(ContextEntity(crate, agent_id, properties={
476-
"@type": "Person",
477-
"name": a.label
478-
}))
476+
properties = {
477+
"@type": "Person"
478+
}
479+
if isinstance(a.label, str):
480+
properties["name"] = a.label
481+
ro_a = crate.add(ContextEntity(crate, agent_id, properties=properties))
479482
roc_engine_run.append_to("agent", ro_a, compact=True)
480483

481484
def add_action(self, crate, activity, parent_instrument=None):
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Bag-Software-Agent: cwltool 3.1.20240112164112
2+
BagIt-Profile-Identifier: https://w3id.org/ro/bagit/profile
3+
Bagging-Date: 2024-03-26
4+
External-Description: Research Object of CWL workflow run
5+
External-Identifier: arcp://uuid,73420c43-a023-4f52-9630-13bcdd9441c2/
6+
Payload-Oxum: 3333.3
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BagIt-Version: 0.97
2+
Tag-File-Character-Encoding: UTF-8
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Call me Ishmael. Some years ago--never mind how long precisely--having
2+
little or no money in my purse, and nothing particular to interest me on
3+
shore, I thought I would sail about a little and see the watery part of
4+
the world. It is a way I have of driving off the spleen and regulating
5+
the circulation. Whenever I find myself growing grim about the mouth;
6+
whenever it is a damp, drizzly November in my soul; whenever I find
7+
myself involuntarily pausing before coffin warehouses, and bringing up
8+
the rear of every funeral I meet; and especially whenever my hypos get
9+
such an upper hand of me, that it requires a strong moral principle to
10+
prevent me from deliberately stepping into the street, and methodically
11+
knocking people's hats off--then, I account it high time to get to sea
12+
as soon as I can. This is my substitute for pistol and ball. With a
13+
philosophical flourish Cato throws himself upon his sword; I quietly
14+
take to the ship. There is nothing surprising in this. If they but knew
15+
it, almost all men in their degree, some time or other, cherish very
16+
nearly the same feelings towards the ocean with me.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
gnivah--ylesicerp gnol woh dnim reven--oga sraey emoS .leamhsI em llaC
2+
no em tseretni ot ralucitrap gnihton dna ,esrup ym ni yenom on ro elttil
3+
fo trap yretaw eht ees dna elttil a tuoba lias dluow I thguoht I ,erohs
4+
gnitaluger dna neelps eht ffo gnivird fo evah I yaw a si tI .dlrow eht
5+
;htuom eht tuoba mirg gniworg flesym dnif I revenehW .noitalucric eht
6+
dnif I revenehw ;luos ym ni rebmevoN ylzzird ,pmad a si ti revenehw
7+
pu gnignirb dna ,sesuoheraw niffoc erofeb gnisuap yliratnulovni flesym
8+
teg sopyh ym revenehw yllaicepse dna ;teem I larenuf yreve fo raer eht
9+
ot elpicnirp larom gnorts a seriuqer ti taht ,em fo dnah reppu na hcus
10+
yllacidohtem dna ,teerts eht otni gnippets yletarebiled morf em tneverp
11+
aes ot teg ot emit hgih ti tnuocca I ,neht--ffo stah s'elpoep gnikconk
12+
a htiW .llab dna lotsip rof etutitsbus ym si sihT .nac I sa noos sa
13+
ylteiuq I ;drows sih nopu flesmih sworht otaC hsiruolf lacihposolihp
14+
wenk tub yeht fI .siht ni gnisirprus gnihton si erehT .pihs eht ot ekat
15+
yrev hsirehc ,rehto ro emit emos ,eerged rieht ni nem lla tsomla ,ti
16+
.em htiw naeco eht sdrawot sgnileef emas eht ylraen
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
yrev hsirehc ,rehto ro emit emos ,eerged rieht ni nem lla tsomla ,ti
2+
ylteiuq I ;drows sih nopu flesmih sworht otaC hsiruolf lacihposolihp
3+
yllacidohtem dna ,teerts eht otni gnippets yletarebiled morf em tneverp
4+
wenk tub yeht fI .siht ni gnisirprus gnihton si erehT .pihs eht ot ekat
5+
teg sopyh ym revenehw yllaicepse dna ;teem I larenuf yreve fo raer eht
6+
pu gnignirb dna ,sesuoheraw niffoc erofeb gnisuap yliratnulovni flesym
7+
ot elpicnirp larom gnorts a seriuqer ti taht ,em fo dnah reppu na hcus
8+
no em tseretni ot ralucitrap gnihton dna ,esrup ym ni yenom on ro elttil
9+
gnivah--ylesicerp gnol woh dnim reven--oga sraey emoS .leamhsI em llaC
10+
gnitaluger dna neelps eht ffo gnivird fo evah I yaw a si tI .dlrow eht
11+
fo trap yretaw eht ees dna elttil a tuoba lias dluow I thguoht I ,erohs
12+
dnif I revenehw ;luos ym ni rebmevoN ylzzird ,pmad a si ti revenehw
13+
aes ot teg ot emit hgih ti tnuocca I ,neht--ffo stah s'elpoep gnikconk
14+
a htiW .llab dna lotsip rof etutitsbus ym si sihT .nac I sa noos sa
15+
;htuom eht tuoba mirg gniworg flesym dnif I revenehW .noitalucric eht
16+
.em htiw naeco eht sdrawot sgnileef emas eht ylraen
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
327fc7aedf4f6b69a42a7c8b808dc5a7aff61376 data/32/327fc7aedf4f6b69a42a7c8b808dc5a7aff61376
2+
97fe1b50b4582cebc7d853796ebd62e3e163aa3f data/97/97fe1b50b4582cebc7d853796ebd62e3e163aa3f
3+
b9214658cc453331b62c2282b772a5c063dbd284 data/b9/b9214658cc453331b62c2282b772a5c063dbd284
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
[2024-03-26T08:34:59,882.000000Z] [cwltool] /home/dbauer/.local/bin/cwltool --provenance testprov revsort.cwl input.yml
2+
[2024-03-26T08:34:59,883.000000Z] Resolved 'revsort.cwl' to 'file:///home/dbauer/projects/runcrate/tests/data/revsort-run-author/snapshot/revsort.cwl'
3+
[2024-03-26T08:35:00,191.000000Z] [provenance] Adding to RO file:///home/dbauer/projects/runcrate/tests/data/revsort-run-author/snapshot/hello.txt
4+
[2024-03-26T08:35:00,192.000000Z] [workflow ] start
5+
[2024-03-26T08:35:00,192.000000Z] [workflow ] starting step rev
6+
[2024-03-26T08:35:00,192.000000Z] [step rev] start
7+
[2024-03-26T08:35:00,204.000000Z] [job rev] /tmp/j235527o$ docker \
8+
run \
9+
-i \
10+
--mount=type=bind,source=/tmp/j235527o,target=/bhhcmi \
11+
--mount=type=bind,source=/tmp/ikqpjjr8,target=/tmp \
12+
--mount=type=bind,source=/home/dbauer/projects/runcrate/tests/data/revsort-run-author/snapshot/hello.txt,target=/var/lib/cwl/stgc6fb3435-bf77-40bf-a2d7-2ce7ffbd3469/hello.txt,readonly \
13+
--workdir=/bhhcmi \
14+
--read-only=true \
15+
--log-driver=none \
16+
--user=1000:1000 \
17+
--rm \
18+
--cidfile=/tmp/crhqjdrm/20240326093500-204573.cid \
19+
--env=TMPDIR=/tmp \
20+
--env=HOME=/bhhcmi \
21+
debian:8 \
22+
rev \
23+
/var/lib/cwl/stgc6fb3435-bf77-40bf-a2d7-2ce7ffbd3469/hello.txt > /tmp/j235527o/output.txt
24+
[2024-03-26T08:35:01,207.000000Z] [job rev] completed success
25+
[2024-03-26T08:35:01,207.000000Z] [step rev] completed success
26+
[2024-03-26T08:35:01,207.000000Z] [workflow ] starting step sorted
27+
[2024-03-26T08:35:01,207.000000Z] [step sorted] start
28+
[2024-03-26T08:35:01,209.000000Z] [job sorted] /tmp/eo0fu8e3$ docker \
29+
run \
30+
-i \
31+
--mount=type=bind,source=/tmp/eo0fu8e3,target=/bhhcmi \
32+
--mount=type=bind,source=/tmp/2bhihxc0,target=/tmp \
33+
--mount=type=bind,source=/tmp/j235527o/output.txt,target=/var/lib/cwl/stg35a7c99e-7809-482d-92a1-712ed8215b58/output.txt,readonly \
34+
--workdir=/bhhcmi \
35+
--read-only=true \
36+
--log-driver=none \
37+
--user=1000:1000 \
38+
--rm \
39+
--cidfile=/tmp/0gcyad43/20240326093501-209419.cid \
40+
--env=TMPDIR=/tmp \
41+
--env=HOME=/bhhcmi \
42+
debian:8 \
43+
sort \
44+
--reverse \
45+
/var/lib/cwl/stg35a7c99e-7809-482d-92a1-712ed8215b58/output.txt > /tmp/eo0fu8e3/output.txt
46+
[2024-03-26T08:35:02,211.000000Z] [job sorted] completed success
47+
[2024-03-26T08:35:02,211.000000Z] [step sorted] completed success
48+
[2024-03-26T08:35:02,212.000000Z] [workflow ] completed success
49+
[2024-03-26T08:35:02,250.000000Z] Final process status is success

0 commit comments

Comments
 (0)