How to create a script used for data read-in?
Write a python script that contains a method called "readIn" with five input arguments:
During read-in this method will be called. You can define other classes and other method that can be called from the readIn method.
The script must return a list that contain dictionaries. One dict for each Column. Each dict must have the following keys:
You can use all standard python modules plus the following packages:
To interact with classical data files:
- filePath: string, the file path of the selected file to read-in
- dataObjceExp: An data object representing the referred experiment
- dataObjectSample: An data object representing the referred sample
- dataObjectGroup: An data object representing the referred group
- Utility: instance of the Utility class. Find the documentation here.
During read-in this method will be called. You can define other classes and other method that can be called from the readIn method.
The script must return a list that contain dictionaries. One dict for each Column. Each dict must have the following keys:
- Name: The value is the name of the column, string
- Type: Must be string out of: "Text", "Date", "Numeric", "Bool"
- UnitID: In case that Type is "Numeric", you can specify the Unit of the column. You have to parse the _id of the Unit. The Unit can be retrieved by calling Utility.getUnitByShortName(shortName)
- Data: Lists in a List. Each list in this list represents the data of one step. The content of each list must fit to the selected Type.
You can use all standard python modules plus the following packages:
To interact with classical data files:
- csv, pyexcel, pyexcel_ods, pyexcel_xlsx, pyexcel_xls, pyexcel_io, openpyxl
- numpy