Skip to content

Commit 09c52c9

Browse files
committed
Rename quick_validate_project.
1 parent 04233d5 commit 09c52c9

File tree

8 files changed

+17
-17
lines changed

8 files changed

+17
-17
lines changed

datashuttle/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from importlib.metadata import PackageNotFoundError, version
22

33
from datashuttle.datashuttle_class import DataShuttle
4-
from datashuttle.datashuttle_functions import quick_validate_project
4+
from datashuttle.datashuttle_functions import validate_project_from_path
55

66

77
try:

datashuttle/datashuttle_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
)
2323

2424

25-
def quick_validate_project(
25+
def validate_project_from_path(
2626
project_path: str | Path,
2727
top_level_folder: Optional[TopLevelFolder] = "rawdata",
2828
display_mode: DisplayMode = "warn",

datashuttle/tui/shared/validate_content.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
Select,
2121
)
2222

23-
from datashuttle.datashuttle_functions import quick_validate_project
23+
from datashuttle.datashuttle_functions import validate_project_from_path
2424
from datashuttle.tui.custom_widgets import ClickableInput
2525
from datashuttle.tui.screens import modal_dialogs, validate_at_path
2626
from datashuttle.tui.tooltips import get_tooltip
@@ -192,7 +192,7 @@ def on_button_pressed(self, event: Button.Pressed) -> None:
192192
)
193193
return
194194

195-
output = quick_validate_project(
195+
output = validate_project_from_path(
196196
path_,
197197
top_level_folder=top_level_folder,
198198
strict_mode=strict_mode,

docs/source/pages/api_index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ API Reference
77

88
.. autoclass:: DataShuttle
99

10-
.. autofunction:: quick_validate_project
10+
.. autofunction:: validate_project_from_path

docs/source/pages/get_started/quick-validate-project.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
:orphan:
2-
(quick-validate-projects)=
2+
(validate-project-from-path)=
33

44
# Validate a project from a filepath
55

@@ -54,12 +54,12 @@ raise a validation issue.
5454
:sync: python
5555

5656
To validate a project using the Python API, pass the path
57-
to the project to validate to ``quick_validate_project``:
57+
to the project to validate to ``validate_project_from_path``:
5858

5959
```python
60-
from datashuttle import quick_validate_project
60+
from datashuttle import validate_project_from_path
6161

62-
quick_validate_project(
62+
validate_project_from_path(
6363
project_path="/mydrive/path/to/project/project_name",
6464
display_mode="error",
6565
)
@@ -69,7 +69,7 @@ quick_validate_project(
6969
In this case, `display_mode=error` will result in an error on the first encountered validation issue.
7070
Otherwise, `"warn"` will show a python warning for all detected issues, while `"print"` will print directly to the console.
7171

72-
See the [](datashuttle.quick_validate_project) API documentation
72+
See the [](validate_project_from_path()) API documentation
7373
for full details of parameters, including the important argument ``strict_mode``
7474
that controls how validation is performed.
7575

docs/source/pages/user_guides/validate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[NeuroBlueprint specification](https://neuroblueprint.neuroinformatics.dev/latest/specification.html).
77
This will find and display a list of all formatting errors in the project.
88

9-
To quickly validate an existing project with only the project path, see [quick-validate-projects](quick-validate-projects).
9+
To quickly validate an existing project with only the project path, see how to [validate a project from a path](validate-project-from-path).
1010

1111
Below we will cover how to validate a datashuttle-managed project
1212
(which will additionally [log](how-to-read-the-logs) the validation results).

tests/tests_integration/test_validation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import pytest
66

7-
from datashuttle import quick_validate_project
7+
from datashuttle import validate_project_from_path
88
from datashuttle.utils import formatting, validation
99
from datashuttle.utils.custom_exceptions import NeuroBlueprintError
1010

@@ -794,7 +794,7 @@ def test_quick_validation(self, mocker, project):
794794
os.makedirs(project.cfg["local_path"] / "derivatives" / "sub-02")
795795

796796
with pytest.warns(UserWarning) as w:
797-
quick_validate_project(
797+
validate_project_from_path(
798798
project.get_local_path(),
799799
display_mode="warn",
800800
top_level_folder=None,
@@ -812,7 +812,7 @@ def test_quick_validation(self, mocker, project):
812812
datashuttle.datashuttle_functions.validation, "validate_project"
813813
)
814814

815-
quick_validate_project(
815+
validate_project_from_path(
816816
project.get_local_path(),
817817
display_mode="print",
818818
top_level_folder="derivatives",
@@ -829,7 +829,7 @@ def test_quick_validation_top_level_folder(self, project):
829829
bad project path input.
830830
"""
831831
with pytest.raises(FileNotFoundError) as e:
832-
quick_validate_project(
832+
validate_project_from_path(
833833
project.get_local_path() / "does not exist",
834834
display_mode="error",
835835
)

tests/tests_tui/test_tui_validate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ async def test_validate_on_project_manager_kwargs(
160160

161161
@pytest.mark.asyncio
162162
async def test_validate_at_path_kwargs(self, setup_project_paths, mocker):
163-
"""Test kwargs are properly passed through from the TUI to `quick_validate_project`
163+
"""Test kwargs are properly passed through from the TUI to `validate_project_from_path`
164164
with mocker. Note that the 'Select' button / directorytree is not tested here,
165165
as the screen is tested elsewhere and it's non-critical feature here.
166166
"""
@@ -179,7 +179,7 @@ async def test_validate_at_path_kwargs(self, setup_project_paths, mocker):
179179
# Spy the function and click 'validate' button
180180
spy_validate = mocker.spy(
181181
datashuttle.tui.shared.validate_content,
182-
"quick_validate_project",
182+
"validate_project_from_path",
183183
)
184184

185185
warnings.filterwarnings("ignore")

0 commit comments

Comments
 (0)