You're reading an old version of this documentation. For up-to-date information, please have a look at v0.12.

aspecd.system module

Obtaining information on the system used for data processing and analysis.

One key aspect of reproducibility is to record sufficient details of the system used to perform processing and analysis. Therefore, each aspecd.dataset.HistoryRecord contains a field with system information that is an aspecd.system.SystemInfo object.

General information stored within the aspecd.system.SystemInfo class are the Python version, the platform, as well as the login name of the user currently logged in. Therefore, this is a relevant aspect for personal data protection, and each and every user of the system should be made available of this fact.

class aspecd.system.SystemInfo(package='')

Bases: ToDictMixin

General information on the system used.

python

Version of Python (and potentially further information)

Type:

dict

packages

Relevant modules and their version numbers

Type:

dict

platform

Identifier of the platform

Type:

string

user

Currently only the login name of the currently logged-in user

Type:

dict

Parameters:

package (str) –

Name of package whose version shall be added to the modules dictionary

Useful (and necessary) for packages derived from the ASpecD framework to store their version number in the SystemInfo class and hence in the history records. Prerequisite for reproducibility.

from_dict(dict_=None)

Set properties from dictionary.

Only parameters in the dictionary that are valid properties of the class are set accordingly.

Parameters:

dict (dict) – Dictionary containing properties to set

to_dict(remove_empty=False)

Create dictionary containing public attributes of an object.

Parameters:

remove_empty (bool) –

Whether to remove keys with empty values

Default: False

Returns:

public_attributes – Ordered dictionary containing the public attributes of the object

The order of attribute definition is preserved

Return type:

collections.OrderedDict

Changed in version 0.6: New parameter remove_empty

Changed in version 0.9: Settings for properties to exclude and include are not traversed

Changed in version 0.9.1: Dictionaries get copied before traversing, as otherwise, the special variables __dict__ and __0dict__ are modified, what may result in strange behaviour.

Changed in version 0.9.2: Dictionaries do not get copied by default, but there is a private method that can be overridden in derived classes to copy the dictionary.