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

Faster parser for CrystFEL stream files #216

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

kmdalton
Copy link
Member

I wrote a faster version of the stream file parser. It mostly just uses more numpy and less pandas while vectorizing operations within a crystal block.

@kmdalton kmdalton requested a review from JBGreisman June 29, 2023 03:24
@codecov-commenter
Copy link

codecov-commenter commented Jun 29, 2023

Codecov Report

Merging #216 (d0ee0d6) into main (859e75c) will decrease coverage by 1.81%.
The diff coverage is 74.39%.

@@            Coverage Diff             @@
##             main     #216      +/-   ##
==========================================
- Coverage   98.39%   96.58%   -1.81%     
==========================================
  Files          45       45              
  Lines        1803     1845      +42     
==========================================
+ Hits         1774     1782       +8     
- Misses         29       63      +34     
Flag Coverage Δ
unittests 96.58% <74.39%> (-1.81%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
reciprocalspaceship/io/crystfel.py 75.86% <74.39%> (-18.84%) ⬇️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@DHekstra
Copy link
Contributor

Does this/could this also address #213 ?

@kmdalton
Copy link
Member Author

@DHekstra , i don't know if the information you want is available in the stream file. i would need to see an example.

@JBGreisman
Copy link
Member

This looks pretty good to me, but I'll do another look through before approving/merging.

Copy link
Member

@JBGreisman JBGreisman left a comment

Choose a reason for hiding this comment

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

I think this looks good to me-- feel free to merge if you think it is ready to go.

@kmdalton
Copy link
Member Author

There are a couple of issues that still need to be addressed

  1. Doeke provided me some more recent stream files, and they seem to break some of my formatting assumptions.
  2. The current version doesn't respect that some files have the photon energy measured per frame. My code just uses the photon energy in the header for every crystal. This is a problem for XFEL data where the peak energy changes from shot to shot.

I'm going to hold off until I have a bit more time to look through it.

@kmdalton kmdalton added the performance Issue or pull request related to performance label Jul 11, 2023
@DHekstra
Copy link
Contributor

@kmdalton, what is the status of this? I'm revisiting some stream files next week, and could test drive your parser.

@kmdalton
Copy link
Member Author

kmdalton commented Oct 2, 2023

I was not able to parse some stream files @DHekstra gave me. There are some formatting differences between stream files that I haven't accounted for. I'm unlikely to have time to finish this soon.

@DHekstra
Copy link
Contributor

DHekstra commented Oct 2, 2023

that's alright. I have a slow but functional parser.

@JBGreisman JBGreisman changed the title faster stream file parser Faster parser for CrystFEL stream files Dec 21, 2023
@JBGreisman
Copy link
Member

Just checking in here -- is there anything left to do on this PR or should it be merged into main?

@kmdalton
Copy link
Member Author

I discovered this version in was incompatible with some stream files provided by @DHekstra. I haven't been able to diagnose the issue yet. I would recommend we hold off on merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Issue or pull request related to performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants