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

user doc update _ eds.rst #3006

Open
wants to merge 10 commits into
base: RELEASE_next_patch
Choose a base branch
from

Conversation

OliDG
Copy link

@OliDG OliDG commented Sep 1, 2022

Description of the change

User guide update _ eds.rst
Model fitting sequence changed in the user docs for improved logic.
First we run the m.fit_background() as it fixes the background components, then m.fit() is launched for the Gaussian components fitting. Their A values depend on the background and fitting the background after the m.fit() do not change the A component values.
Documentation text revised to match the new order.

Progress of the PR

  • Change implemented (can be split into several points),
  • update docstring (if appropriate),
  • update user guide (if appropriate),
  • add an changelog entry in the upcoming_changes folder (see upcoming_changes/README.rst),
  • Check formatting changelog entry in the readthedocs doc build of this PR (link in github checks)
  • add tests,
  • ready for review.

@@ -519,7 +519,7 @@ EDS curve fitting

The intensity of X-ray lines can be extracted using curve-fitting in HyperSpy.
This example uses an EDS-SEM spectrum of a test material (EDS-TM001) provided
by `BAM <https://www.webshop.bam.de>`_.
by `BAM <http://www.webshop.bam.de>`_.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please keep the https

>>> m.fit_background()

>>> m.fit()
Copy link
Contributor

Choose a reason for hiding this comment

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

remove unnecessarily added indent

@@ -25,7 +25,7 @@
# When running setup.py the ".dev" string will be replaced (if possible)
# by the output of "git describe" if git is available or the git
# hash if .git is present.
version = "1.7.2.dev0"
version = "1.8.0.dev0"
Copy link
Contributor

Choose a reason for hiding this comment

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

RELEASE_next_patch should stay on 1.7.2.dev0

This and the next change look like you had started out from RELEASE_next_minor, which would explain the errors you got when trying to PR into RELEASE_next_patch

Copy link
Author

Choose a reason for hiding this comment

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

Hi, yes, the only branch I could fork was the RELEASE_next_minor, the other were not listed, how to start out from the the RELEASE_next_patch instead? *first time on Github

Copy link
Member

Choose a reason for hiding this comment

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

There are different ways of doing it, but here are the main steps:

  1. Checkout the branch off RELEASE_next_patch, for example: git checkout -b my_new_branch RELEASE_next_patch
  2. commit your changes
  3. push your changes to your own repository (should be https://github.com/OliDG/hyperspy)
  4. on github, make the pull request to https://github.com/hyperspy/hyperspy from your branch in https://github.com/OliDG/hyperspy

Usually, the term fork is used in the context of repository, not branch.

Copy link
Member

Choose a reason for hiding this comment

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

If you have issue with this, for this time, you can continue to commit and push to this branch and we can "clean" the branch before merging, once we are happy with the content of this PR.

>>> m.fit_background()

>>> m.fit()
The width of the X-ray lines is defined from the energy resolution (FWHM at
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The width of the X-ray lines is defined from the energy resolution (FWHM at
The widths of the X-ray lines are defined from the energy resolution (FWHM at

@jlaehne
Copy link
Contributor

jlaehne commented Sep 1, 2022

If you are at it, could you once proofread the whole eds.rst file, I have seen a few more typos while browsing over.

@codecov
Copy link

codecov bot commented Sep 1, 2022

Codecov Report

Merging #3006 (85e486f) into RELEASE_next_patch (2db6536) will not change coverage.
The diff coverage is 100.00%.

@@                 Coverage Diff                 @@
##           RELEASE_next_patch    #3006   +/-   ##
===================================================
  Coverage               80.80%   80.80%           
===================================================
  Files                     209      209           
  Lines                   32706    32706           
  Branches                 7329     7329           
===================================================
  Hits                    26428    26428           
  Misses                   4512     4512           
  Partials                 1766     1766           
Impacted Files Coverage Δ
hyperspy/Release.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@ericpre ericpre added this to the v1.7.2 milestone Sep 2, 2022
Copy link
Member

@ericpre ericpre left a comment

Choose a reason for hiding this comment

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

Fitting background independently is not always necessary and I guess that this is the reason why in the current version, it came after and says that the "background fitting can be improved with".
In my opinion, the changes of this PR are more or less equivalent, except that now it implies that one need to fit the background first and then do the rest of the fit. For example, doing the fit without fitting background independently can work well for many cases.

In its current form and in its PR, this is vague and lack details on what are the consequences of the fitting order and its corresponding logic. Can you try to improve these aspects?

@jlaehne jlaehne removed this from the v1.7.2 milestone Sep 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants