forked from LINCellularNeuroscience/VAME
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve handling of user input for not all sessions
- Loading branch information
1 parent
d322bc3
commit 0839bc1
Showing
7 changed files
with
94 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from typing import List | ||
|
||
|
||
def get_sessions_from_user_input( | ||
cfg: dict, | ||
action_message: str = "run this step", | ||
) -> List[str]: | ||
user_input = input( | ||
f"Do you want to {action_message} for your entire dataset? \n" | ||
"If you only want to use a specific session, type the session name \n" | ||
"yes/no/<session_name>: " | ||
) | ||
if user_input in ["Yes", "yes"]: | ||
sessions = cfg["session_names"] | ||
elif user_input in ["No", "no"]: | ||
sessions = [] | ||
for session in cfg["session_names"]: | ||
use_session = input("Do you want to use " + session + "? yes/no: ") | ||
if use_session in ["Yes", "yes"]: | ||
sessions.append(session) | ||
else: | ||
continue | ||
else: | ||
if user_input in cfg["session_names"]: | ||
sessions = [user_input] | ||
else: | ||
raise ValueError( | ||
"Invalid input. Please enter yes, no, or a valid session name." | ||
) |