Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
4d5b3837
Commit
4d5b3837
authored
5 years ago
by
Swen Vermeul
Browse files
Options
Downloads
Patches
Plain Diff
property_assignment class is obsolete
parent
de4589e4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pybis/src/python/pybis/property_assignment.py
+0
-86
0 additions, 86 deletions
pybis/src/python/pybis/property_assignment.py
with
0 additions
and
86 deletions
pybis/src/python/pybis/property_assignment.py
deleted
100644 → 0
+
0
−
86
View file @
de4589e4
from
tabulate
import
tabulate
from
texttable
import
Texttable
from
pybis.utils
import
check_datatype
,
split_identifier
,
format_timestamp
,
is_identifier
,
is_permid
,
nvl
from
pandas
import
DataFrame
class
PropertyAssignments
():
"""
holds all properties that are assigned to an entity (eg. sample or experiment)
"""
def
__init__
(
self
,
openbis_obj
,
data
):
self
.
openbis
=
openbis_obj
self
.
data
=
data
self
.
prop
=
{}
if
self
.
data
[
'
propertyAssignments
'
]
is
None
:
self
.
data
[
'
propertyAssignments
'
]
=
[]
for
pa
in
self
.
data
[
'
propertyAssignments
'
]:
self
.
prop
[
pa
[
'
propertyType
'
][
'
code
'
].
lower
()]
=
pa
def
__str__
(
self
):
"""
String representation of this entity type
"""
return
self
.
data
[
'
code
'
]
def
_attrs
(
self
):
return
[
'
code
'
,
'
description
'
,
'
autoGeneratedCode
'
,
'
subcodeUnique
'
,
'
generatedCodePrefix
'
,
'
listable
'
,
'
showContainer
'
,
'
showParents
'
,
'
showParentMetadata
'
,
'
validationPlugin
'
]
def
__dir__
(
self
):
return
self
.
_attrs
()
+
[
'
get_propertyAssignments()
'
]
def
__getattr__
(
self
,
name
):
if
name
in
self
.
_attrs
():
if
name
in
self
.
data
:
return
self
.
data
[
name
]
else
:
return
''
def
__eq__
(
self
,
other
):
return
str
(
self
)
==
str
(
other
)
def
__ne__
(
self
,
other
):
return
str
(
self
)
!=
str
(
other
)
# def get_propertyAssignments(self):
# attrs = ['code', 'dataType', 'description', 'label', 'mandatory', 'ordinal']
# pas = [ {**pa['propertyType'], **pa} for pa in self.data['propertyAssignments'] ]
# return DataFrame(pas, columns=attrs)
# def codes(self):
# codes = []
# for pa in self.data['propertyAssignments']:
# codes.append(pa['propertyType']['code'].lower())
# return codes
# def __repr__(self):
# title = """
#{}: {}
#description: {}""".format (
# self.data['@type'].split('.')[-1],
# self.data['code'],
# self.data['description']
# )
#
# table = Texttable()
# table.set_deco(Texttable.HEADER)
#
# headers = ['code', 'label', 'description', 'dataType', 'mandatory']
#
# lines = []
# lines.append(headers)
# for pa in self.data['propertyAssignments']:
# lines.append([
# pa['propertyType']['code'].lower(),
# pa['propertyType']['label'],
# pa['propertyType']['description'],
# pa['propertyType']['dataType'],
# pa['mandatory']
# ])
# table.add_rows(lines)
# table.set_cols_width([28,28,28,28,9])
# table.set_cols_align(['l','l','l','l','l'])
# return title + "\n\n" + table.draw()
#
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