Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Coscine Python SDK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coscine
community features
Coscine Python SDK
Commits
09210adc
Commit
09210adc
authored
3 months ago
by
Romin
Browse files
Options
Downloads
Patches
Plain Diff
Handle new responsible_organiation field in create_project (rearranges parameters)
parent
f98a21fa
Branches
handlebars-maks
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/coscine/client.py
+19
-13
19 additions, 13 deletions
src/coscine/client.py
src/coscine/project.py
+13
-8
13 additions, 8 deletions
src/coscine/project.py
tests/__main__.py
+2
-3
2 additions, 3 deletions
tests/__main__.py
with
34 additions
and
24 deletions
src/coscine/client.py
+
19
−
13
View file @
09210adc
...
...
@@ -669,9 +669,10 @@ class ApiClient:
start_date
:
date
,
end_date
:
date
,
principal_investigators
:
str
,
disciplines
:
list
[
Discipline
],
organizations
:
list
[
Organization
],
visibility
:
Visibility
,
disciplines
:
list
[
Discipline
],
responsible_organization
:
Organization
,
additional_organizations
:
list
[
Organization
]
|
None
=
None
,
keywords
:
list
[
str
]
|
None
=
None
,
grant_id
:
str
=
""
,
parent_id
:
str
=
""
...
...
@@ -693,12 +694,15 @@ class ApiClient:
Date when the project ends.
principal_investigators
The project PIs.
disciplines
List of associated scientific disciplines.
organizations
List of organizations partaking in the project.
visibility
Project metadata visibility (relevant for search).
disciplines
List of associated scientific disciplines.
responsible_organization
The lead organization.
additional_organizations
List of organizations partaking in the project. The responsible
organization may not re-appear here.
keywords
List of project keywords (relevant for search).
grant_id
...
...
@@ -706,12 +710,14 @@ class ApiClient:
parent_id
Parent project ID if the project should be a subproject.
"""
org_data
=
[
organization
.
serialize
()
for
organization
in
organizations
]
for
item
in
org_data
:
item
[
"
responsible
"
]
=
True
# Responsible organization and additional organizations are given
# as a single list, with the differentiating aspect of an additional
# responsible = True field for the responsible organization.
organizations
=
[]
organizations
.
append
(
responsible_organization
.
serialize
())
organizations
[
0
][
"
responsible
"
]
=
True
for
org
in
additional_organizations
:
organizations
.
append
(
org
.
serialize
())
data
:
dict
=
{
"
name
"
:
name
,
"
displayName
"
:
display_name
,
...
...
@@ -723,7 +729,7 @@ class ApiClient:
discipline
.
serialize
()
for
discipline
in
disciplines
],
"
organizations
"
:
org
_data
,
"
organizations
"
:
org
anizations
,
"
visibility
"
:
visibility
.
serialize
(),
"
keywords
"
:
keywords
if
keywords
else
[],
"
grantId
"
:
grant_id
...
...
This diff is collapsed.
Click to expand it.
src/coscine/project.py
+
13
−
8
View file @
09210adc
...
...
@@ -714,9 +714,10 @@ class Project:
start_date
:
date
,
end_date
:
date
,
principal_investigators
:
str
,
disciplines
:
list
[
Discipline
],
organizations
:
list
[
Organization
],
visibility
:
Visibility
,
disciplines
:
list
[
Discipline
],
responsible_organization
:
Organization
,
additional_organizations
:
list
[
Organization
]
|
None
=
None
,
keywords
:
list
[
str
]
|
None
=
None
,
grant_id
:
str
=
""
)
->
Project
:
...
...
@@ -737,12 +738,15 @@ class Project:
Date when the project ends.
principal_investigators
The project PIs.
disciplines
List of associated scientific disciplines.
organizations
List of organizations partaking in the project.
visibility
Project metadata visibility (relevant for search).
disciplines
List of associated scientific disciplines.
responsible_organization
The lead organization.
additional_organizations
List of organizations partaking in the project. The responsible
organization may not re-appear here.
keywords
List of project keywords (relevant for search).
grant_id
...
...
@@ -757,9 +761,10 @@ class Project:
start_date
,
end_date
,
principal_investigators
,
disciplines
,
organizations
,
visibility
,
disciplines
,
responsible_organization
,
additional_organizations
,
keywords
,
grant_id
,
self
.
id
...
...
This diff is collapsed.
Click to expand it.
tests/__main__.py
+
2
−
3
View file @
09210adc
...
...
@@ -137,10 +137,9 @@ project = client.create_project(
datetime
.
now
().
date
(),
datetime
.
now
().
date
(),
"
Test User
"
,
client
.
visibility
(
"
Project Members
"
),
[
client
.
discipline
(
"
Computer Science 409
"
)],
[
client
.
organization
(
"
https://ror.org/04xfq0f34
"
)],
# -> RWTH Aachen University
client
.
visibility
(
"
Project Members
"
)
client
.
organization
(
"
https://ror.org/04xfq0f34
"
),
# -> RWTH Aachen
)
###############################################################################
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment