Skip to content

Convert stage 3 into a single file#44

Merged
siddhantwahal merged 18 commits intomasterfrom
maint/step_3_single_file
Jul 9, 2022
Merged

Convert stage 3 into a single file#44
siddhantwahal merged 18 commits intomasterfrom
maint/step_3_single_file

Conversation

@siddhantwahal
Copy link
Copy Markdown
Collaborator

This PR converts stage 3 into a single file.

In stage 2 (#42), we're adding a traits-equipped version of the script with an ImageFile model. In this PR, we extend that simple script with a traitsui view for ImageFile, ImageFileView.

Model and views for ImageFolder have been removed. Thus, the ImageFolder will be introduced for the first time in Stage 5.1.

Copy link
Copy Markdown
Owner

@jonathanrocher jonathanrocher left a comment

Choose a reason for hiding this comment

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

This looks good, but I am making suggestions as to what this stage represent and how we could make a couple of versions around it to build a progression. Feel free to share yoour thoughts, and merge if you want. My comments can be done in subsequent PRs.

Comment thread stage3.0_first_views/traited_face_detect.py Outdated
figure = Instance(Figure)

view = View(
Item("model.filepath", style="readonly", show_label=False),
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Do we want to make this not readonly so people can leverage the build_mpl_figure listener below?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Or keep it readonly in 3.1 but make it "live" and add the @observe("model.filepath") in 3.2?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Do we want to make this not readonly so people can leverage the build_mpl_figure listener below?

Great idea! This needed #44 to function properly so we can go ahead and do this now.

Or keep it readonly in 3.1 but make it "live" and add the @observe("model.filepath") in 3.2?

Interesting. Let me think a little more on how we could version this segment of the tutorial.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Side note: We should track the difference between minor versions (i.e, 3.0, 3.1, 3.2), so that the presenter's job is a little easier. I'll try to add some "developer docs" with this PR.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Yes!!!

@siddhantwahal
Copy link
Copy Markdown
Collaborator Author

@jonathanrocher I've split this into two stages, 3.0 and 3.1. Let me know if it's headed in the right direction!

Copy link
Copy Markdown
Collaborator

@prabhuramachandran prabhuramachandran left a comment

Choose a reason for hiding this comment

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

I like this, my only request is that the plotting code also be rolled into a method on the model initially, but if you and @jonathanrocher feel strongly that it should not be there, this is fine as at least the code is in an if __name__... block.

@siddhantwahal
Copy link
Copy Markdown
Collaborator Author

I like this, my only request is that the plotting code also be rolled into a method on the model initially, but if you and @jonathanrocher feel strongly that it should not be there, this is fine as at least the code is in an if __name__... block.

Thanks for the review @prabhuramachandran! I'm merging this for now, but happy to come back and add a plotting method if that's what we decide in #42.

@siddhantwahal
Copy link
Copy Markdown
Collaborator Author

Actually, @jonathanrocher, did you want to take another look?

Copy link
Copy Markdown
Owner

@jonathanrocher jonathanrocher left a comment

Choose a reason for hiding this comment

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

LGTM. 1 suggestion to reduce the number of things to introduce. I totally get that this is a personal choice, but I think we need to remain opinionated so we figure out the minimum number of concepts to get to a full and scalable app in 4h. So I would like to cutout mercilessly everything we can since we know we will overload people...


view = View(
UItem("model.filepath"),
UItem("figure", editor=MplFigureEditor()),
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I wouldn't introduce UItem and stick to Item, but use its show_label=False, to reduce the number of things we have to explain.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Totally agreed!

@siddhantwahal siddhantwahal merged commit 55a9fb2 into master Jul 9, 2022
@jonathanrocher jonathanrocher deleted the maint/step_3_single_file branch July 16, 2022 23:39
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.

3 participants