Skip to content

Conversation

eddiebergman
Copy link
Contributor

This PR updates the Stopwatch used in automl.py and smbo.py mainly. It seems like it was previously used for timing certain steps.

Main update is that StopWatch has a context manager and automl.py::AutoML::fit now uses the context manager to help break up the different steps occuring.

from autosklearn.util.stopwatch import StopWatch

sw = StopWatch()

with sw.time("My Task Name") as task:
    # ... do stuff
    
print(f"{task.name} took {task.wall_duration}")

@codecov
Copy link

codecov bot commented Mar 22, 2022

Codecov Report

Merging #1425 (1a6a23a) into development (23bfdf8) will decrease coverage by 0.15%.
The diff coverage is 69.14%.

@@               Coverage Diff               @@
##           development    #1425      +/-   ##
===============================================
- Coverage        84.46%   84.31%   -0.16%     
===============================================
  Files              147      147              
  Lines            11293    11284       -9     
  Branches          1924     1934      +10     
===============================================
- Hits              9539     9514      -25     
- Misses            1245     1255      +10     
- Partials           509      515       +6     

Impacted file tree graph

@eddiebergman eddiebergman merged commit 415f144 into development Mar 27, 2022
github-actions bot pushed a commit that referenced this pull request Mar 27, 2022
@eddiebergman eddiebergman deleted the update_stopwatch branch April 21, 2022 10:35
eddiebergman added a commit that referenced this pull request Aug 18, 2022
…1425)

* Cleanup: Stopwatch

* Uddate: Stopwatch with context manager and use it

* Fix: Don't call property

* Add: Ignore automl_common

* Fix: wrong variable name `self.time_for_task`

* Remove: Old test file

* Better error message for stopwatch `time_since`

* Update: `time_since` can now optionally raise

* Use the new `time_since` stopwatch method

* Trigger workflow

* Add extra time for cross-val automl cases

* Add comment in code to explain why
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.

1 participant