Skip to content

Data

cannlytics.lims.data

Data Collection | Cannlytics

Authors:
Keegan Skeate keegan@cannlytics.com
Charles Rice charles@ufosoftwarellc.com
Created: 6/15/2021
Updated: 7/15/2021

clean_special_characters(df, column_name)

Parameters:

Name Type Description Default
df DataFrame

A DataFrame.

required

Returns:

Type Description
(dict)

get_compound_df(df)

Rename the columns in the Compound sheet to match the required names. For simplicity, make a copy of the Compound sheet to handle NaN values.

Parameters:

Name Type Description Default
df DataFrame

A DataFrame.

required

Returns:

Type Description
(dict)

get_sample_name(df)

Return the sample name from a dictionary. Converts the first column of the first sheet to lowercase.

Parameters:

Name Type Description Default
df DataFrame

A DataFrame.

required

Returns:

Type Description
(dict)

The sample name as a key, value pair.

import_agilent_cannabinoids(file_name)

This is the same as residual solvents routine.

Parameters:

Name Type Description Default
df DataFrame

A DataFrame.

required

Returns:

Type Description
(dict)

import_agilent_gc_residual_solvents(file_name)

Read in all the excel sheets at one time, get the sample name, get and cleanup the compound df from the compound sheet, add the analyte names and measurements to an array of dictionaries, and add that to the main array.

Parameters:

Name Type Description Default
df DataFrame

A DataFrame.

required

Returns:

Type Description
(dict)

import_agilent_gc_terpenes(file_name)

Read in all the excel sheets at one time, get the sample name, get and cleanup the compound df from the compound sheet, replace special characters, add the analyte names and measurements to an array of dictionaries, and add that to the main array.

Parameters:

Name Type Description Default
df DataFrame

A DataFrame.

required

Returns:

Type Description
(dict)

import_data_model(directory)

Import analyses to Firestore from a .csv or .xlsx file.

Parameters:

Name Type Description Default
filename str

The full filename of a data file.

required

import_heavy_metals(file_name)

Parameters:

Name Type Description Default
df DataFrame

A DataFrame.

required

Returns:

Type Description
(dict)

import_measurements()

Import measurements taken by scientific instruments.

import_worksheet(filename, sheetname, range_start='A1')

Read the data from a given worksheet.

Parameters:

Name Type Description Default
filename str

The name of the Excel file to read.

required
range_start str

Optional starting cell.

'A1'

Returns:

Type Description
list(dict)

A list of dictionaries.