tomoscan.series.Series#
- class tomoscan.series.Series(name=None, iterable=None, use_identifiers=False)#
Bases:
list
A series can be view as an extended list of
TomoObject
. This allow the user to define a relation between scans like:- __init__(name=None, iterable=None, use_identifiers=False)#
Methods
__init__
([name, iterable, use_identifiers])append
(object)Append object to the end of the list.
clear
()Remove all items from list.
copy
()Return a shallow copy of the list.
count
(value, /)Return number of occurrences of value.
extend
(iterable, /)Extend list by appending elements from the iterable.
from_dict_of_str
(dict_[, factory, ...])create a Series from it definition from a dictionary
index
(value[, start, stop])Return first index of value.
insert
(index, object, /)Insert object before index.
pop
([index])Remove and return item at index (default last).
remove
(object)Remove first occurrence of value.
reverse
()Reverse IN PLACE.
sort
(*[, key, reverse])Sort the list in ascending order and return None.
call for each scan DatasetIdentifier.to_str() if use dataset identifier.
Attributes
name
- rtype
str
use_identifiers
- append(object)#
Append object to the end of the list.
- clear()#
Remove all items from list.
- copy()#
Return a shallow copy of the list.
- count(value, /)#
Return number of occurrences of value.
- extend(iterable, /)#
Extend list by appending elements from the iterable.
- static from_dict_of_str(dict_, factory=<class 'tomoscan.factory.Factory'>, use_identifiers=None)#
create a Series from it definition from a dictionary
- Param
dictionary containing the series to create
- Parameters
factory – factory to use in order to create scans defined from there Identifier (as an instance of DatasetIdentifier or is str representation)
use_identifiers – use_identifiers can be overwrite when creating the series
- Returns
created Series
- index(value, start=0, stop=9223372036854775807, /)#
Return first index of value.
Raises ValueError if the value is not present.
- insert(index, object, /)#
Insert object before index.
- pop(index=-1, /)#
Remove and return item at index (default last).
Raises IndexError if list is empty or index is out of range.
- remove(object)#
Remove first occurrence of value.
Raises ValueError if the value is not present.
- reverse()#
Reverse IN PLACE.
- sort(*, key=None, reverse=False)#
Sort the list in ascending order and return None.
The sort is in-place (i.e. the list itself is modified) and stable (i.e. the order of two equal elements is maintained).
If a key function is given, apply it once to each list item and sort them, ascending or descending, according to their function values.
The reverse flag can be set to sort in descending order.
- to_dict_of_str()#
call for each scan DatasetIdentifier.to_str() if use dataset identifier. Otherwise return a default list with dataset identifiers
- Return type
dict