Skip to content

Commit

Permalink
rerun ephys_session.ipynb notebook
Browse files Browse the repository at this point in the history
rerun ecephys_session.ipynb notebook

add comments to eval_str

lint
  • Loading branch information
mikejhuang committed Nov 18, 2022
1 parent f002717 commit f59aa0e
Show file tree
Hide file tree
Showing 2 changed files with 140,410 additions and 90,271 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,21 @@ def map_column_names(table, name_map=None, ignore_case=True):


def eval_str(val):
"""Evaluates str(numeric) and str(list)
"""Evaluates value if its type==str(numeric) or type==str(list)
Parameters
----------
val: any
Returns
-------
val: evaluated val if its type==str(numeric) or type==str(list)
or passes the val through if it does not meet the condition
"""

if isinstance(val, str):
if val.replace('.', '').isdigit():
if val.replace('.', '').isdigit(): # checks if val is numeric
val = eval(val)
elif val[0] == "[" and val[-1] == "]":
elif val[0] == "[" and val[-1] == "]": # checks if val is list
val = tuple(eval(val))
return val
Loading

0 comments on commit f59aa0e

Please sign in to comment.