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

Profile CLI run through dask #193

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

Conversation

gerritholl
Copy link
Collaborator

For the CLI added in #184, add an option to profile the results using dask.diagnostics and visualize the results as a bokeh plot.

  • Tests added
  • Tests passed
  • Passes flake8 trollflow2
  • Fully documented

@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

Merging #193 (328642b) into main (b25f2ca) will increase coverage by 0.35%.
Report is 56 commits behind head on main.
The diff coverage is 99.42%.

@@            Coverage Diff             @@
##             main     #193      +/-   ##
==========================================
+ Coverage   95.56%   95.92%   +0.35%     
==========================================
  Files          13       15       +2     
  Lines        2821     3091     +270     
==========================================
+ Hits         2696     2965     +269     
- Misses        125      126       +1     
Flag Coverage Δ
unittests 95.92% <99.42%> (+0.35%) ⬆️

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

Files Coverage Δ
trollflow2/cli.py 100.00% <100.00%> (ø)
trollflow2/tests/test_cli.py 100.00% <100.00%> (ø)
trollflow2/tests/test_launcher.py 98.12% <100.00%> (+<0.01%) ⬆️
trollflow2/launcher.py 88.45% <97.22%> (+0.33%) ⬆️

... and 2 files with indirect coverage changes

@gerritholl
Copy link
Collaborator Author

We should merge #184 first.

@djhoese
Copy link
Member

djhoese commented Oct 24, 2023

In polar2grid I think I called this --create-profile and nargs=?. That way I could provide a default HTML file name with info about the reader and writer being used and the current time.

@gerritholl
Copy link
Collaborator Author

In polar2grid I think I called this --create-profile and nargs=?. That way I could provide a default HTML file name with info about the reader and writer being used and the current time.

I don't understand what you mean by "provide a default HTML file name". With nargs=? you'd be giving multiple HTML file names to write to? Info about the reader and writer, you mean by string substitution?

@djhoese
Copy link
Member

djhoese commented Oct 24, 2023

Sorry. With nargs="?" and default=False you can pass only --create-profile to the CLI and args.create_profile will be None (if I remember correctly). Or you can do --create-profile profile_my_filename.html. Or if it isn't specified at all then args.create_profile is False. If it is None I then later set it to "{project_name}_{glue_name}_{start_time:%Y%m%d_%H%M%S}.html" where for P2G project_name is either "geo2grid" or "polar2grid", glue_name is <reader_name>2<writer_name> and start_time is the current time when the script is executed. I also allow the user to specify end_time in the format string.

I turned it into a context manager:

https://github.com/ssec/polar2grid/blob/4c470fa9de54c4b141cf4a5301a90005f35d5c84/polar2grid/glue.py#L241-L266

You'll notice I also print out a file:// version of the HTML path so in my Terminal on linux it is Ctrl + left click-able and opens in my browser.

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

4 participants