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

Added graphical solution to example #474

Closed
wants to merge 29 commits into from

Conversation

lawrencefchan
Copy link

Added the fitted curve to demonstrate optimize-fit example.

Also added some lines to the plot code snippet to reflect output graph more closely.

Comment on lines 63 to 66
>>> ax.set_xlabel('Time [ns]') #doctest: +ELLIPSIS
Text(0.5,0,'Time [ns]')
>>> ax.set_ylabel('Intensity [bins]') #doctest: +ELLIPSIS
Text(0,0.5,'Intensity [bins]')
Copy link
Author

Choose a reason for hiding this comment

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

I wasn't sure whether #doctest ELLIPSIS should have been included, but my code didn't pass the tests without it.

@pdebuyl
Copy link
Member

pdebuyl commented Feb 10, 2020

Dear @lawrencefchan

Thank you for the contribution. I will review it later this week.

@pdebuyl
Copy link
Member

pdebuyl commented Mar 2, 2020

Hello, here are my comments on the pull request:

  1. There are existing graphics file, which we try to remove (see Replace old figure with generated one #262). For any update to the project, we do not take figure files but request that figures are generated: http://scipy-lectures.org/guide/index.html#figures-and-code-examples

    Could you transform your pull request to autogenerate the figures? Also, the third figure is superfluous.

  2. The +ELLIPSIS option is only necessary when the code returns the object id, which is the case for plots and legends but not for the labels where they can be removed.

  3. The usage of subplot and the related ax. method calls introduce unnecessary complexity. Please use the simpler plt.plot, plt.xlabel, etc.

I realize that these are big changes to your pull request, please let me know if you are interested to go on with the modifications.

Pierre

@lawrencefchan
Copy link
Author

@pdebuyl thanks for the comments. I'll fix it and try again. Probably this weekend.

pdebuyl and others added 18 commits March 10, 2020 21:44
Create in build:
- a zip archive of the html file
- a copy of the pdf
- a zip archive of the source
CNAME is necessary for the custom domain

.nojekyll is necessary to avoid github pages hiding directories starting
with an underscore
also add release name in about page
The SciPy routines are deprecated. imageio is the recommended successor
replace image i/o from scipy.misc by imageio
The example is already in the exercises.

Part solution of scipy-lectures#94
* suppress warnings for mandelbrot example

the code applies the iteration for all array elements, some of which are
expected to overflow.

fix scipy-lectures#480
remove hares lynxes carrots examples from chapter
@lawrencefchan
Copy link
Author

@pdebuyl sorry it's taken so long. how do the most recent changes look?

@pdebuyl
Copy link
Member

pdebuyl commented Jun 25, 2020

I'll give it a look soon. Sorry for the delay. The merges end up with a lot of changes, many unrelated to your proposition. I'll have to sort it out.

@lawrencefchan
Copy link
Author

Would it be easier if I closed this pull request and opened a new one from the current master?

@pdebuyl
Copy link
Member

pdebuyl commented Jul 6, 2020

Yes, a pull request with only your changes would be easier.

Also:

  1. The line "Solution: :ref:Python source file <sphx_glr_intro_summary-exercises_auto_examples_plot_optimize_lidar_data.py>" should be de-indented (else it is part of the "image" directive that takes no comment". Same for "Compare the result of :func:scipy.optimize.leastsq".

  2. I'd like to keep the current narrative version, as in the rest of the lecture notes, where the code is show below its explanation. "load the waveform" followed by a few lines of Python code, and so on. There would be some duplication of code between the lecture page and the sphinx-gallery generated page from the Python file but that seems the best solution to me.

  3. For many matplotlib commands, you don't need #doctest: +ELLIPSIS. This is only necessary for those that return a memory address ("line object at ..." for instance).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants