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

CoM rotation and flip in the GUI #1087

Merged
merged 15 commits into from
Aug 24, 2021
Merged

Conversation

sk1p
Copy link
Member

@sk1p sk1p commented Aug 23, 2021

Fixes #31

TODO

  • The template for notebook download should also be updated to include the new parameters.
  • Fix results data download.
  • Add better input method (slider) in addition to allowing to enter values directly
    • Fix for easily entering negative rotation angles in number input
  • Add documentation
    • CoM section in applications section → @uellue will take care of this one
    • Explain parameters (info box or similar?)
  • Fix bug: time delta resets after analysis finishes

Contributor Checklist:

Reviewer Checklist:

  • /azp run libertem.libertem-data passed

+ `Analysis.need_rerun`: based on old and new parameters, decide if we can
  re-use an existing UDF result, or if we need to re-run
+ `COMAnalysis`: don't re-run if only `flip_y` or `scan_rotation`
  changed
+ JobDetailHandler: re-use existing UDF results, based on
  `Analysis.need_rerun`
@sk1p sk1p added enhancement New feature or request GUI labels Aug 23, 2021
@sk1p sk1p requested a review from uellue August 23, 2021 13:49
@sk1p sk1p changed the title CoM rotation and flip CoM rotation and flip in the GUI Aug 23, 2021
@codecov
Copy link

codecov bot commented Aug 23, 2021

Codecov Report

Merging #1087 (7f54f8a) into master (7c2d502) will increase coverage by 0.15%.
The diff coverage is 57.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1087      +/-   ##
==========================================
+ Coverage   69.28%   69.44%   +0.15%     
==========================================
  Files         268      268              
  Lines       12614    12795     +181     
  Branches     1777     1817      +40     
==========================================
+ Hits         8740     8885     +145     
- Misses       3532     3567      +35     
- Partials      342      343       +1     
Impacted Files Coverage Δ
...mpoundAnalysis/components/CenterOfMassAnalysis.tsx 0.00% <0.00%> (ø)
...alysis/components/layouts/AnalysisLayoutTwoCol.tsx 0.00% <ø> (ø)
client/src/compoundAnalysis/helpers.ts 0.00% <0.00%> (ø)
client/src/messages.ts 100.00% <ø> (ø)
src/libertem/api.py 93.06% <ø> (ø)
src/libertem/analysis/disk.py 94.00% <50.00%> (-1.84%) ⬇️
src/libertem/web/base.py 89.36% <50.00%> (ø)
src/libertem/analysis/base.py 95.29% <100.00%> (+0.11%) ⬆️
src/libertem/analysis/com.py 96.66% <100.00%> (+0.27%) ⬆️
src/libertem/io/writers/results/base.py 100.00% <100.00%> (ø)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7c2d502...7f54f8a. Read the comment docs.

Copy link
Member

@uellue uellue left a comment

Choose a reason for hiding this comment

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

Looks good so far! We should include a link or info sign that explains the parameters. We have them documented in https://libertem.github.io/LiberTEM/reference/api.html#libertem.api.Context.create_com_analysis, for example. :-)

With near-instantaneous recalculation after parameter change it would be awesome to have a slider for the angle, or a rotation handle on the widget for position and size!

I noticed that we don't have COM in our Applications section. We could perhaps create a stub for the "phase contrast" application with an API example, link to reference docs and one screenshot for COM, and a link to https://ptychography-4-0.github.io/ptychography/algorithms.html for SSB ptychography?

.editorconfig Show resolved Hide resolved
src/libertem/analysis/com.py Show resolved Hide resolved
@uellue
Copy link
Member

uellue commented Aug 23, 2021

  • The template for notebook download should also be updated to include the new parameters.
  • Fix results data download.

Current result when downloading:

image

@uellue uellue added this to the 0.8 milestone Aug 23, 2021
@uellue
Copy link
Member

uellue commented Aug 23, 2021

We could consider baking a new release soon after this?

@sk1p
Copy link
Member Author

sk1p commented Aug 23, 2021

Looks good so far! We should include a link or info sign that explains the parameters. We have them documented in https://libertem.github.io/LiberTEM/reference/api.html#libertem.api.Context.create_com_analysis, for example. :-)

👍 - I'll add more information about the parameters. I also thought about always showing the parameter form, as it doesn't take up a lot of space anyway - what do you think?

Current result when downloading: [...]

Thanks, I'll look into that, should be easy to fix.

We could consider baking a new release soon after this?

Yeah, I thought the same - what do you think about including a fix for #633, too, as I'm touching that code anyways?

I noticed that we don't have COM in our Applications section. We could perhaps create a stub for the "phase contrast" application with an API example, link to reference docs and one screenshot for COM, and a link to https://ptychography-4-0.github.io/ptychography/algorithms.html for SSB ptychography?

Sure, I'll add a section to the docs.

@uellue
Copy link
Member

uellue commented Aug 23, 2021

Looks good so far! We should include a link or info sign that explains the parameters. We have them documented in https://libertem.github.io/LiberTEM/reference/api.html#libertem.api.Context.create_com_analysis, for example. :-)

👍 - I'll add more information about the parameters. I also thought about always showing the parameter form, as it doesn't take up a lot of space anyway - what do you think?

Yes, I was wondering why they were hidden but figured you had your reasons. 😆

We could consider baking a new release soon after this?

Yeah, I thought the same - what do you think about including a fix for #633, too, as I'm touching that code anyways?

Yes, perfect! Would require a bit more change in the CoM API, but should be pretty straightforward, right? :-)

Other points: Thx, great! 👍

@sk1p
Copy link
Member Author

sk1p commented Aug 23, 2021

/azp run libertem.libertem-data

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sk1p
Copy link
Member Author

sk1p commented Aug 23, 2021

/azp run libertem.libertem-data

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sk1p
Copy link
Member Author

sk1p commented Aug 24, 2021

/azp run libertem.libertem-data

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sk1p
Copy link
Member Author

sk1p commented Aug 24, 2021

@uellue I've pushed the last fixes; if you are happy with this, I can re-build the client and merge - or do you want to push CoM docs also to this PR?

@sk1p sk1p requested a review from uellue August 24, 2021 14:25
@uellue
Copy link
Member

uellue commented Aug 24, 2021

or do you want to push CoM docs also to this PR?

If it is OK it could be a quick solution! :-) I can also rebuild the client if I am at it. :-)

@sk1p
Copy link
Member Author

sk1p commented Aug 24, 2021

If it is OK it could be a quick solution! :-) I can also rebuild the client if I am at it. :-)

Sounds good!

@sk1p sk1p mentioned this pull request Aug 24, 2021
7 tasks
* Include links to API use
* Cite seminal paper on CoM
* Notebook test coverage for new parameters
@uellue
Copy link
Member

uellue commented Aug 24, 2021

/azp run libertem.libertem-data

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@uellue uellue left a comment

Choose a reason for hiding this comment

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

Looks good, many thanks! :-)

Should be ready to merge now. :-)

@sk1p sk1p merged commit 98b1e0f into LiberTEM:master Aug 24, 2021
@sk1p sk1p deleted the com-rotation-transform branch August 24, 2021 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request GUI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Visualization and UI for center of mass shift
2 participants