Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
wpbonelli merged 1 commit into
modflowpy:developfrom
wpbonelli:export-vtk-tutorial
Feb 3, 2025
Merged

perf(tutorials): skip some writes in export_vtk_tutorial.py#2432
wpbonelli merged 1 commit into
modflowpy:developfrom
wpbonelli:export-vtk-tutorial

Conversation

@wpbonelli

Copy link
Copy Markdown
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.
@codecov

codecov Bot commented Feb 3, 2025

Copy link
Copy Markdown

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

@christianlangevin christianlangevin left a comment

Copy link
Copy Markdown

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
@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