-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add validation to TUI. #492
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
4718ca8
Add validation to TUI.
JoeZiminski f71aaaa
Adding tests.
JoeZiminski e30c0e9
Add tooltips.
JoeZiminski 4a496c6
Convert local only on the TUI side.
JoeZiminski cc2fcdc
Fix missing 'local_only'.
JoeZiminski d6b9ce6
Fix tests.
JoeZiminski 3918744
Fix linting.
JoeZiminski 76503e6
Refactor contents widgets and document the tests.
JoeZiminski 3f468fd
Fix tests.
JoeZiminski fd11edb
Improve docs.
JoeZiminski b1427f1
Fix example path.
JoeZiminski bcc04e4
Tidy up documentation.
JoeZiminski 27fe351
Fix tooltips not taken from get_tooltips.
JoeZiminski 1a6fbbe
Add docstring to interface alidate_project.
JoeZiminski 081e2ac
Delete unused function.
JoeZiminski d44bf10
Fix validate at path class docstring.
JoeZiminski cccbc28
Fix regression to interface error.
JoeZiminski 2eccf2d
Fix local-only mode.
JoeZiminski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,40 @@ | ||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
from textual.app import ComposeResult | ||
|
||
from datashuttle.tui.app import App | ||
|
||
from textual.screen import Screen | ||
from textual.widgets import Button, Header | ||
|
||
from datashuttle.tui.shared import validate_content | ||
|
||
|
||
class ValidateScreen(Screen): | ||
""" | ||
Screen to hold the validation window for | ||
validating an existing project at a given path. | ||
All widgets are stored in `ValidateContent`, which is | ||
shared between here and the validation tab on the project manager. | ||
""" | ||
|
||
TITLE = "Validate Project" | ||
|
||
def __init__(self, mainwindow: App) -> None: | ||
super(ValidateScreen, self).__init__() | ||
|
||
self.mainwindow = mainwindow | ||
|
||
def compose(self) -> ComposeResult: | ||
yield Header() | ||
yield Button("Main Menu", id="all_main_menu_buttons") | ||
yield validate_content.ValidateContent( | ||
self, interface=None, id="validate_from_path_content" | ||
) | ||
|
||
def on_button_pressed(self, event: Button.Pressed) -> None: | ||
if event.button.id == "all_main_menu_buttons": | ||
self.dismiss(None) |
File renamed without changes.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To maintain uniformity across all projects, should we consider setting strict_mode=True as the default? This would ensure that only NeuroBlueprint-compliant folders exist, preventing inconsistencies in datasets. Users who need flexibility could still override this by explicitly setting strict_mode=False when calling the function. This is what I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Transyltooniaa this is a good point. I'm not 100% sure on this but, due to how datashuttle is likely to be used in neuroscience projects, I think it makes sense to assume there will be non-datashuttle folders within the project folder. This is not ideal (it would be nice if all folders / data were in the datatype folders) but unfortunately this is the reality. As such, it would be good to avoid confusing new users with errors related to extra folders they have in their project. Then, they can opt-in to the stricter mode once they understand the details.