<jupyter_start><jupyter_text>Notebook purpose:- Demonstrate how to set up a lattice based sampling experiment. - Generate and pass on a data structure which contains:    - sample information        - all possible sample compositions which satisfy **Sum(volume fraction) = 1**        - component names and properties        - extensive properties for each sample (mass, volume, moles)<jupyter_code>import pandas as pd

import importlib
import setup_functions
importlib.reload(setup_functions)<jupyter_output>C:\Users\lacho\.opentrons\deck_calibration.json not found. Loading defaults
C:\Users\lacho\.opentrons\robot_settings.json not found. Loading defaults<jupyter_text>1. - experiment plan .csv $\rightarrow$ dictionary. get_experiment_plan makes use of ast module. - chemical inventory .xls $\rightarrow$ pandas dataframe.<jupyter_code>experiment_plan_filepath = 'experiment_plan.csv'
experiment_plan_dict = setup_functions.get_experiment_plan(experiment_plan_filepath)
chemical_db_df = pd.read_excel('chemical_inventory.xlsx')
chemical_db_df
experiment_plan_dict<jupyter_output><empty_output><jupyter_text>2. Overall strategy:Given N component names, \and N-1:    - volume fractions,     - np.linspace() arguments    - concentration types    Calculate the volume fractions for all sample combinations. Regarding experiment_plan_dict    - ['Component names'] corresponds to "chemical abbreviation" in the chemical inventory df.\    This dictionary entry is a list of N components. The index of this list will correspond to\    concentration types, and concentration linspace.    - ['Concentration types'] can be volf, molarity, or mgpermL.     - ['Concentration linspace'] keyword arguments for linspace call for nth component.     3. generate_candidate_lattice_concentrations()Calculates volume fractions of all components, including the Nth component.Returns a dictionary of format:"concentration type":numpy array of shape M x N where,N is the number of components, M is the number of samples.**NOTE** Mixture constrain is applied inside generate_candidate_lattice_concentrations. I.e., any sample for which the volume fraction of the last component is negative will be discarded due to being impossible.<jupyter_code>exp_conc_dict = setup_functions.generate_candidate_lattice_concentrations(experiment_plan_dict, chemical_db_df)<jupyter_output><empty_output><jupyter_text>4. Using the sample concentration arrays generated above, and chemical information of each component \generate arrays of extensive properties.<jupyter_code>extensive_dict = setup_functions.get_extensive(exp_conc_dict, experiment_plan_dict, chemical_db_df)<jupyter_output>No density input for chcl using density = 1.0
{'fraction_non_alphanumeric': 0.06570155902004454, 'fraction_numerical': 0.002969561989606533, 'mean_word_length': 5.822784810126582, 'pattern_counts': {'":': 1, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '325689', 'license': 'MIT', 'n_tokens_mistral': 746, 'n_tokens_neox': 709, 'n_words': 250, 'path': 'code-collab/database/Code_demo.ipynb', 'repo_name': 'pozzo-research-group/OT2Protocols2', 'size': '2694'}