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

Optimize code to replace the df #452

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

Optimize code to replace the df #452

wants to merge 9 commits into from

Conversation

Kaniyaki
Copy link
Collaborator

No description provided.

@codecov
Copy link

codecov bot commented Apr 1, 2023

Codecov Report

Attention: Patch coverage is 88.23529% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 92.99%. Comparing base (5574283) to head (20562e2).

Files Patch % Lines
src/estimagic/parameters/check_constraints.py 82.60% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #452      +/-   ##
==========================================
+ Coverage   92.98%   92.99%   +0.01%     
==========================================
  Files         194      195       +1     
  Lines       14659    14680      +21     
==========================================
+ Hits        13631    13652      +21     
  Misses       1028     1028              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Kaniyaki
Copy link
Collaborator Author

Kaniyaki commented Apr 1, 2023

Optimized the "check_fixes_and_bounds" function, which originally had a runtime of 5.61 ms.
The main problem was that it used DataFrame.
Instead of it, I used a dictionary and added the "_iloc" function as a substitute for DataFrame.iloc. Current runtime is 55 µs, which is a significant improvement.
In the end, I made sure that all tests passed, and they did.
Below, you can see the comparison for the runtime using %timeit and %lprun.
lprun_comparison.pdf
timeit_comparison.pdf

@Kaniyaki Kaniyaki marked this pull request as ready for review April 1, 2023 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants