Skip to content

Update van der waal example#680

Merged
aaronayres35 merged 7 commits into
masterfrom
update-van-der-waal
Apr 20, 2021
Merged

Update van der waal example#680
aaronayres35 merged 7 commits into
masterfrom
update-van-der-waal

Conversation

@aaronayres35
Copy link
Copy Markdown
Contributor

@aaronayres35 aaronayres35 commented Apr 16, 2021

part of #660

This PR updates the Van Der Waal example in the documentation. It removes the use of ChacoPlotItem and the like with ComponentEditor, replaces use of on_trait_change with observe, removes development setup section, cleans up wording, and adds the code for the example in examples/demo/vanderwaals.py.

@aaronayres35 aaronayres35 changed the title [WIP] Update van der waal example Update van der waal example Apr 19, 2021
Copy link
Copy Markdown
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

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

Almost LGTM - there is one minor bug and a small suggestion.

@@ -285,24 +320,26 @@ Source Code
The final version on the program, `vanderwaals.py` ::
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's not explicitly copy the code from the python file here - instead just use literalinclude. Also, it would be awesome if we provide a way to click on vanderwaals.py and see the example on github. I think that's possible - not sure how.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've tried doing both of these things. The link to github is tricky because the file doesn't exist yet, it is bing introduced in this PR. The link I used is where the file will be located, but currently it is a broken link if you try to test it on this PR...
I am not sure the best way to go about this

self.plot.delplot(old_plot_type)
self.plot.plot(
("x", "y"), type=new_plot_type, name=new_plot_type, color="blue"
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

so when i change plot_type, i need to change some other variable before the plot is updated i.e. if i change from line to scatter, i need to change temperature before the plot changes from line plot to scatter plot.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah I wasn't observing this locally. Thanks for pointing this out. I tried adding self.plot.invalidate_and_redaw(). Lmk if this fixes it for you

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

FWIW I was seeing something similar to what you describe while working on the hyetograph example and invalidate_and_redraw fixed it

Comment thread examples/demo/vanderwaals.py Outdated
@rahulporuri
Copy link
Copy Markdown
Contributor

still LGTM

@aaronayres35 aaronayres35 merged commit 6feea0c into master Apr 20, 2021
@aaronayres35 aaronayres35 deleted the update-van-der-waal branch April 20, 2021 12:10
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.

2 participants