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

Interactive files #1063

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

Interactive files #1063

wants to merge 18 commits into from

Conversation

alex-l-kong
Copy link
Contributor

What is the purpose of this PR?

Closes #1029. Add interactive file selection to the notebooks.

How did you implement your changes

Use ipyfilechooser to allow users to interactively set home directories, such as base_dir, tiff_dir, etc.

Remaining issues

Start with notebooks 2 and 3. Gradually expand to include the others.

@alex-l-kong alex-l-kong self-assigned this Sep 14, 2023
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@alex-l-kong alex-l-kong marked this pull request as draft September 14, 2023 20:58
@alex-l-kong alex-l-kong marked this pull request as ready for review October 3, 2023 20:16
Copy link
Contributor

@srivarra srivarra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RIP coverage, but otherwise it looks good. Did you plan on adding it to the other notebooks in this PR, or save it for later?

@alex-l-kong
Copy link
Contributor Author

RIP coverage, but otherwise it looks good. Did you plan on adding it to the other notebooks in this PR, or save it for later?

For now, I'm sandboxing all of these aesthetic improvements to Pixie. We can talk about more widespread adoption after we've fully fleshed them out.

@@ -27,6 +27,7 @@
"outputs": [],
Copy link
Contributor

@camisowers camisowers Oct 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #7.        fc.create_file_chooser(base_dir, dir_to_assign="cell_clustering_params_dir", file_to_assign="cell_clustering_params_path")

Is there any reason the user would have a different file path than the default /base_dir/pixie/example_pixel_output_dir/cell_clustering_params.json? I feel like this could be an automatic assignment rather than having the user find and select a nested file like this. Maybe selecting the pixel_output_dir would make more sense, e.g. if the user had multiple pixel clustering runs.


Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think so, good idea to just leave it as an automatic assignment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So to load the cell_clustering_params.json file the user will need to specify the path to the pixel_output_dir created in the previous notebook. Still agreed we don't need them to explicitly specify the cell_clustering_params.json file though.

@camisowers
Copy link
Contributor

camisowers commented Oct 5, 2023

Just a minor comment on selecting a nested file which should have the same name for all users, so it probably can just be assigned by us rather than making them search for and choose it.
I think if implemented throughout the other notebooks we should still maintain a lot of the subdir and file path setting automatically based on expected structure, and only use the path selection for top level dirs that might be different for people (i.e. base dir, image dir, segmentation dir).

@alex-l-kong
Copy link
Contributor Author

alex-l-kong commented Oct 13, 2023

Not a whole lot we can do about coverage, the original repo didn't have any test functions written for it. Don't think it's worth writing our own either.

@alex-l-kong alex-l-kong requested a review from cliu72 October 19, 2023 19:01
templates/2_Pixie_Cluster_Pixels.ipynb Show resolved Hide resolved
templates/2_Pixie_Cluster_Pixels.ipynb Show resolved Hide resolved
templates/3_Pixie_Cluster_Cells.ipynb Show resolved Hide resolved
templates/3_Pixie_Cluster_Cells.ipynb Show resolved Hide resolved
templates/3_Pixie_Cluster_Cells.ipynb Show resolved Hide resolved
Copy link
Contributor

@cliu72 cliu72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting this error in the cell clustering notebook:

image

Looks like fc.path_vars["cell_table_file"] is None, but I think I selected the file properly:
image

@alex-l-kong
Copy link
Contributor Author

@cliu72 just had to make one small tweak to ensure the function can retrieve the file names consistently on top of the full parent paths.

@alex-l-kong alex-l-kong requested a review from cliu72 October 25, 2023 23:54
@@ -31,16 +31,42 @@
"from ark.utils import data_utils, example_dataset, plot_utils\n",
Copy link
Contributor

@cliu72 cliu72 Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small comment - can we update this to say "If you'd like to test the features in ark with an example dataset, leave use_example_dataset as True. If you're using your own data, set as False ."


Reply via ReviewNB

@@ -31,16 +31,42 @@
"from ark.utils import data_utils, example_dataset, plot_utils\n",
Copy link
Contributor

@cliu72 cliu72 Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again very small comment - I think there a small typo, should be ../data/example_dataset. Also, I don't think we need quotes around "../data/example_dataset" , since it's already displaying as code.


Reply via ReviewNB

@@ -31,16 +31,42 @@
"from ark.utils import data_utils, example_dataset, plot_utils\n",
Copy link
Contributor

@cliu72 cliu72 Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent with the way this path is specified for the example dataset above, can we change{base_dir}/image_data to ../data/example_dataset/image_data ?


Reply via ReviewNB

@@ -42,20 +42,44 @@
"from ark.utils import data_utils, example_dataset, plot_utils\n",
Copy link
Contributor

@cliu72 cliu72 Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above - can we update this to say "If you'd like to test the features in ark with an example dataset, leave use_example_dataset as True. If you're using your own data, set as False ."


Reply via ReviewNB

@@ -42,20 +42,44 @@
"from ark.utils import data_utils, example_dataset, plot_utils\n",
Copy link
Contributor

@cliu72 cliu72 Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above - I think there a small typo, should be ../data/example_dataset. Also, I don't think we need quotes around "../data/example_dataset" , since it's already displaying as code.

Also, I think the last sentence of the base_dir bullet point should say "...created during cell clustering" (not pixel clustering).


Reply via ReviewNB

@@ -42,20 +42,44 @@
"from ark.utils import data_utils, example_dataset, plot_utils\n",
Copy link
Contributor

@cliu72 cliu72 Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent with the way this path is specified for the example dataset above, can we change{base_dir}/pixie/example_pixel_output_dir to ../data/example_dataset/pixie/example_pixel_output_dir ?


Reply via ReviewNB

@@ -42,20 +42,44 @@
"from ark.utils import data_utils, example_dataset, plot_utils\n",
Copy link
Contributor

@cliu72 cliu72 Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent with the way this path is specified for the example dataset above, can we change{base_dir}/segmentation/cell_table/cell_table_size_normalized.csv to ../data/example_dataset/segmentation/cell_table/cell_table_size_normalized.csv? And also get rid of the quotes.


Reply via ReviewNB

Copy link
Contributor

@cliu72 cliu72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to have the paths that were selected by the user persist after saving the notebook? When the pixel clustering notebook crashes or if people break up their run over several days, it's annoying to have to re-select multiple paths every time they start the notebook.

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.

Make file path selection more interactive
4 participants