The FileSystemViewer's functionality has been expanded to support the selection of folders. This enhancement enables passing folders as parameters to extractors that require folder inputs. For instance, a fine-tuning extractor might need a folder containing multiple photos.
Testing this feature is similar to the process outlined in PR #1103.
How to Test
Prepare an extractor:
Run an extractor locally. For this example, the wordcount extractor was used.
Add a new parameter in the extractor-info.json file under the schema field of parameters. If using the wordcount extractor, modify the file here:
"FOLDER_SELECTION": {
"type": "string",
"title": "Details of the Clowder Folder",
"description": "The Clowder file id of the dataset folder to be used for inference",
"format": "ClowderFile",
"showOnlyDatasetFiles": false,
"selectFolder": true
}
Create test data:
Create a dataset with a folder and a file inside it.
Run the extractor:
Execute the extractor within the dataset. Open the extractor interface and access the file selector. The file system will be displayed, allowing selection of both files and folders. However, since selectFolder is set to true, the "Confirm" button will be disabled when files are selected.
Select a folder:
Choose a folder, confirm the selection and submit the extractor
Verify extractor logs:
Check the extractor logs to confirm that FOLDER_SELECTION appears as a parameter in the default check message. It is ok if the extractor gives an error, we are just testing the component is working as requested. The JSON is sent as a string
Test additional behavior:
Re-run the extractor after setting showOnlyDatasetFiles to true (or removing it). This change restricts the file system view to show only files and folders within the dataset being processed.
This file contains hidden or 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
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.
The FileSystemViewer's functionality has been expanded to support the selection of folders. This enhancement enables passing folders as parameters to extractors that require folder inputs. For instance, a fine-tuning extractor might need a folder containing multiple photos.
Testing this feature is similar to the process outlined in PR #1103.
How to Test
Prepare an extractor:
Create test data:
Run the extractor:
Execute the extractor within the dataset. Open the extractor interface and access the file selector. The file system will be displayed, allowing selection of both files and folders. However, since selectFolder is set to true, the "Confirm" button will be disabled when files are selected.
Select a folder:
Choose a folder, confirm the selection and submit the extractor
Verify extractor logs:
Check the extractor logs to confirm that FOLDER_SELECTION appears as a parameter in the default check message. It is ok if the extractor gives an error, we are just testing the component is working as requested. The JSON is sent as a string
Test additional behavior:
Re-run the extractor after setting showOnlyDatasetFiles to true (or removing it). This change restricts the file system view to show only files and folders within the dataset being processed.