<commit_before>from datetime import datetime
from metatlas import metatlas_objects as metob
from metatlas.helpers import metatlas_get_data_helper_fun as ma_data
from metatlas import gui


import pandas as pd
import os
import os.path
import sys

from IPython.display import display
import matplotlib.pyplot as plt
try:
    import ipywidgets as widgets
except ImportError:
    from IPython.html import widgets
try:
    import traitlets
except ImportError:
    from IPython.utils import traitlets

from ipywidgets import interact, fixed, FloatSlider


try:
    foo = widgets.Select()
except Exception as e:
    print(e)
    sys.exit(0)



data = []
groups = []
file_names = []
compound_names = []
compound_objects = []
files_idx = dict()
compound_idx = dict()
groups_idx = dict()
grid = gui.create_qgrid([])
grid2 = gui.create_qgrid([])

compounds_list_dict = dict()


atlas_header = ['Atlas Name', 'No. Compounds', 'Last Modified']
compound_header = ['Compound', 'rt_max', 'rt_min', 'rt_peak', 'rt_units', 'mz', 'mz_tolerance', 'mz_tolerance_units',
                   'lcms_run']

# --------------------------------------------------------------------------------------------------------------------
# --------------------- W I D G E T S ---------------- W I D G E T S -------------------- W I D G E T S --------------
# --------------------------------------------------------------------------------------------------------------------

# single select widget for atlas
atlases_select = widgets.Select(description='Atlases:', options=[])

# text widget to select for atlases in a database. accepts wild cards
search_string = widgets.Text(description="")
search_button = widgets.Button(description="Search for Atlas")
display_compounds_and_files = widgets.Button(description="Display Compounds & Files")


# single select widget for the compound
wcompounds = widgets.Select(
    description="compounds",
    options=[]
)

# multiple select widget for the files
wfiles = widgets.Select(
    description="files",
    options=[]
)

# dill file name
wfname = widgets.Text(
    description='Atlas Name',
    value='myAtlas',
)

# button that plots the intensity
plot_button = widgets.Button(description='Plot me')
save_atlas_button = widgets.Button(description="Save Atlas")
save_as_button = widgets.Button(description="Save Atlas As")
save_atlas_as_txt = widgets.Text()

# radio buttons to control how atlas is to be written
choose_output = widgets.RadioButtons(description='choose output:',
                                     options=['new atlas name', 'old atlas name'],
                                     )

# button that creates the atlas based on the selection from the radio buttons
create_atlas_btn = widgets.Button(description="Create Atlas from Dill")
modify_atlas_btn = widgets.Button(description="Modify Selected Atlas")

# text box that holds the selected atlas' RT values for the selected compound. displays
atlas_ref_vals = widgets.Text(description="RT values for compound in Atlas")
atlas_ref_vals.value = "RT values for compound in Atlas go here"
atlas_ref_vals.color = 'red'

# sliders for the user to change the RT values
rtmin_widget = FloatSlider()
rtpeak_widget = FloatSlider()
rtmax_widget = FloatSlider()


# --------------------------------------------------------------------------------------------------------------------
# --------------- F U N C T I O N S ------------- F U N C T I O N S ----------- F U N C T I O N S --------------------
# --------------------------------------------------------------------------------------------------------------------

###########################################################################
###
def mod_atlas_compound_RT_values(**kwargs):<commit_msg>Another widgets fix<commit_after>from datetime import datetime
from metatlas import metatlas_objects as metob
from metatlas.helpers import metatlas_get_data_helper_fun as ma_data
from metatlas import gui


import pandas as pd
import os
import os.path
import sys

from IPython.display import display
import matplotlib.pyplot as plt
try:
    import ipywidgets as widgets
except ImportError:
    from IPython.html import widgets
try:
    import traitlets
except ImportError:
    from IPython.utils import traitlets

from ipywidgets import interact, fixed, FloatSlider


try:
    foo = widgets.Select()
except Exception as e:
    print(e)
    sys.exit(0)



data = []
groups = []
file_names = []
compound_names = []
compound_objects = []
files_idx = dict()
compound_idx = dict()
groups_idx = dict()
grid = gui.create_qgrid([])
grid2 = gui.create_qgrid([])

compounds_list_dict = dict()


atlas_header = ['Atlas Name', 'No. Compounds', 'Last Modified']
compound_header = ['Compound', 'rt_max', 'rt_min', 'rt_peak', 'rt_units', 'mz', 'mz_tolerance', 'mz_tolerance_units',
                   'lcms_run']

# --------------------------------------------------------------------------------------------------------------------
# --------------------- W I D G E T S ---------------- W I D G E T S -------------------- W I D G E T S --------------
# --------------------------------------------------------------------------------------------------------------------

# single select widget for atlas
atlases_select = widgets.Select(description='Atlases:', options=[])

# text widget to select for atlases in a database. accepts wild cards
search_string = widgets.Text(description="")
search_button = widgets.Button(description="Search for Atlas")
display_compounds_and_files = widgets.Button(description="Display Compounds & Files")


# single select widget for the compound
wcompounds = widgets.Select(
    description="compounds",
    options=[]
)

# multiple select widget for the files
wfiles = widgets.Select(
    description="files",
    options=[]
)

# dill file name
wfname = widgets.Text(
    description='Atlas Name',
    value='myAtlas',
)

# button that plots the intensity
plot_button = widgets.Button(description='Plot me')
save_atlas_button = widgets.Button(description="Save Atlas")
save_as_button = widgets.Button(description="Save Atlas As")
save_atlas_as_txt = widgets.Text()

# radio buttons to control how atlas is to be written
choose_output = widgets.RadioButtons(description='choose output:',
                                     options=['new atlas name', 'old atlas name'],
                                     )

# button that creates the atlas based on the selection from the radio buttons
create_atlas_btn = widgets.Button(description="Create Atlas from Dill")
modify_atlas_btn = widgets.Button(description="Modify Selected Atlas")

# text box that holds the selected atlas' RT values for the selected compound. displays
atlas_ref_vals = widgets.Text(
    description="RT values for compound in Atlas",
    value = "RT values for compound in Atlas go here",
    color = 'red'
)

# sliders for the user to change the RT values
rtmin_widget = FloatSlider()
rtpeak_widget = FloatSlider()
rtmax_widget = FloatSlider()


# --------------------------------------------------------------------------------------------------------------------
# --------------- F U N C T I O N S ------------- F U N C T I O N S ----------- F U N C T I O N S --------------------
# --------------------------------------------------------------------------------------------------------------------

###########################################################################
###
def mod_atlas_compound_RT_values(**kwargs):
{'fraction_non_alphanumeric': 0.25571390158644797, 'fraction_numerical': 0.0005377789728421619, 'mean_word_length': 2.1086502298370244, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1991050', 'n_tokens_mistral': 1977, 'n_tokens_neox': 1917, 'n_words': 642}