Skip to content
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

Expanding ClowderFileSystem to select Folders as well #1219

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Vismayak
Copy link
Contributor

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

  1. 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
      }
  2. Create test data:

    • Create a dataset with a folder and a file inside it.
  3. 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.

      image

  4. Select a folder:

    • Choose a folder, confirm the selection and submit the extractor

      image

  5. 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

      image

  6. 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.

      image

@Vismayak Vismayak requested a review from longshuicy as a code owner January 21, 2025 20:31
@Vismayak Vismayak self-assigned this Jan 21, 2025
@Vismayak Vismayak requested review from lmarini and max-zilla January 21, 2025 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant