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

update chunksize test to make it faster - and RT minor perf improvement #503

Merged
merged 4 commits into from Aug 15, 2022

Conversation

erwanp
Copy link
Member

@erwanp erwanp commented Aug 14, 2022

@sagarchotalia I realized the test implemented in #488 was extremelly slow on Travis-CI (few minutes)
Here is a small update to make it faster (~10s).

Please review.
Please also comment if needed, it's a good way to learn more about the codebase.

I'll ask you to update this PR and also make sure that the Number of chunks in the "chunksize" mode is different from 1, else we're actually computing all lines together and not testing correctly.


Other minor changes :

  • add config parameter "RESAMPLING_TOLERANCE_THRESHOLD" to deal with resampling errors globally
  • add copy_array=False option in s.take(), improve MergeSlabs performance by using it

@erwanp erwanp added this to the 0.13.1 milestone Aug 14, 2022
@codecov-commenter
Copy link

codecov-commenter commented Aug 14, 2022

Codecov Report

Merging #503 (1a9abf2) into develop (b54be7b) will decrease coverage by 0.03%.
The diff coverage is 68.42%.

@@             Coverage Diff             @@
##           develop     #503      +/-   ##
===========================================
- Coverage    73.35%   73.31%   -0.04%     
===========================================
  Files          138      138              
  Lines        18979    18958      -21     
===========================================
- Hits         13922    13900      -22     
- Misses        5057     5058       +1     

Copy link
Collaborator

@sagarchotalia sagarchotalia left a comment

Choose a reason for hiding this comment

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

Hello, this looks great to me! I'll add the number of chunks parameter by explicitly calculating the "N" parameter in the code and asserting that N>1, if that's okay

@erwanp
Copy link
Member Author

erwanp commented Aug 14, 2022

In production, having N=1 (i.e. all lines processed at once) is not necessarily a problem; so it should remained allowed.

But in the test it's very important we're having N>1. You could store N as a hidden variable in the SpectrumFactory; sf._Nchunks for instance, and evaluate this in the test()

make calc_spectrum(..., return_factory=True) returns the factory directly if only one molecule
…sampling errors globally

add copy_array=False option in s.take(), improve MergeSlabs performance by using it
@erwanp erwanp added interface not related to the physics of the code performance labels Aug 15, 2022
@erwanp erwanp changed the title update chunksize test to make it faster update chunksize test to make it faster - and RT minor perf improvement Aug 15, 2022
@erwanp erwanp merged commit 91bfcd0 into radis:develop Aug 15, 2022
@erwanp erwanp mentioned this pull request Aug 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interface not related to the physics of the code performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants