<jupyter_start><jupyter_text>[WIP] Automated workflow Method for inserting entriesModify `user_data/subjects.csv` and `user_data/sessions.csv`, and run the following commandsor with the `ingest` method and accompanying `csv` files.<jupyter_code># Change into the parent directory to find the `dj_local_conf.json` file. 
# When you type `import datajoint as dj` the credentials from `dj_local_conf.json` will be used to log into the database.
import os
os.chdir('..')
from workflow_miniscope.pipeline import *
from workflow_miniscope.ingest import ingest_subjects, ingest_sessions
ingest_subjects()
ingest_sessions()
import pathlib
from workflow_miniscope.paths import get_imaging_root_data_dir

root_dir = pathlib.Path(get_imaging_root_data_dir())

for scan_key in (scan.Scan & scan.ScanInfo - imaging.ProcessingTask).fetch('KEY'):
    scan_file = root_dir / (scan.ScanInfo.ScanFile & scan_key).fetch('file_path')[0]
    recording_dir = scan_file.parent

    miniscope_analysis_dir = recording_dir / 'miniscope_analysis'
    if miniscope_analysis_dir.exists():
        imaging.ProcessingTask.insert1({**scan_key,
                                        'paramset_idx': 0,
                                        'processing_output_dir': miniscope_analysis_dir.as_posix()})<jupyter_output><empty_output><jupyter_text>+ To this end, we make use of a convenient function `imaging.Curation().create1_from_processing_task()`<jupyter_code>for key in (imaging.ProcessingTask - imaging.Curation).fetch('KEY'):
    imaging.Curation().create1_from_processing_task(key)<jupyter_output><empty_output><jupyter_text>Method for populating tables<jupyter_code>from workflow_miniscope.populate import populate
populate(display_progress=False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09287749287749288, 'fraction_numerical': 0.002849002849002849, 'mean_word_length': 5.226950354609929, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '368925', 'license': 'MIT', 'n_tokens_mistral': 558, 'n_tokens_neox': 536, 'n_words': 118, 'path': 'notebooks/03-automate.ipynb', 'repo_name': 'datajoint/workflow-miniscope', 'size': '1755'}