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

perf(tutorials): skip some writes in export_vtk_tutorial.py #2432

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

wpbonelli
Copy link
Member

Since exporting a transient array looks the same as exporting a normal array, I removed that cell. And commented out 2 more write statements that were each taking ~45s. This brings the runtime from >2 minutes down to ~30 seconds on my machine.

The goal here (eventually) is to get the notebooks to run fast enough for the RTD build service, so we don't have to run them on GH actions and then upload to RTD. Also just for convenience — it seems a bit daunting and unexpected for a tutorial notebook to spin for minutes. Is there a different transient model we could swap into the VTK export example to avoid commenting out the write statements?

The next slowest are

142.58s call     test_notebooks.py::test_notebooks[/Users/wbonelli/dev/flopy/.docs/Notebooks/swi2package_example5.py]
117.58s call     test_notebooks.py::test_notebooks[/Users/wbonelli/dev/flopy/.docs/Notebooks/swi2package_example2.py]
66.68s call     test_notebooks.py::test_notebooks[/Users/wbonelli/dev/flopy/.docs/Notebooks/plot_array_example.py]
65.77s call     test_notebooks.py::test_notebooks[/Users/wbonelli/dev/flopy/.docs/Notebooks/feat_working_stack_examples.py]
63.09s call     test_notebooks.py::test_notebooks[/Users/wbonelli/dev/flopy/.docs/Notebooks/plot_cross_section_example.py]
42.40s call     test_notebooks.py::test_notebooks[/Users/wbonelli/dev/flopy/.docs/Notebooks/raster_intersection_example.py]

But this PR does not attempt anything on these yet

This brings the runtime from >2 minutes down to ~30 seconds.
Copy link

codecov bot commented Feb 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.3%. Comparing base (bb9824e) to head (efbd104).
Report is 44 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff            @@
##           develop   #2432     +/-   ##
=========================================
+ Coverage     68.4%   76.3%   +7.8%     
=========================================
  Files          294     294             
  Lines        59390   59934    +544     
=========================================
+ Hits         40652   45739   +5087     
+ Misses       18738   14195   -4543     

see 248 files with indirect coverage changes

@wpbonelli wpbonelli marked this pull request as ready for review February 3, 2025 17:44
Copy link
Contributor

@langevin-usgs langevin-usgs left a comment

Choose a reason for hiding this comment

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

Thanks, @wpbonelli. This looks good. Agreed on effort to speed this all up.

@wpbonelli wpbonelli merged commit 8fd6375 into modflowpy:develop Feb 3, 2025
23 checks passed
@wpbonelli wpbonelli deleted the export-vtk-tutorial branch February 3, 2025 20:59
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.

2 participants