-
Notifications
You must be signed in to change notification settings - Fork 7
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
Dask ms profiling #114
base: master
Are you sure you want to change the base?
Dask ms profiling #114
Conversation
daskms/table_proxy.py
Outdated
|
||
wrapper.calls = 0 | ||
wrapper.run_time = [] | ||
return wrapper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As _nolock_runner
daskms/table_proxy.py
Outdated
|
||
wrapper.calls = 0 | ||
wrapper.run_time = [] | ||
return wrapper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As _writelock_runner
@@ -0,0 +1,227 @@ | |||
# -*- coding: utf-8 -*- | |||
|
|||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Start the test file from scratch.
def test_function_profiling():
from daskms.table_proxy import _function_runs
# Look at the rest of the test cases that use xds_from_ms
# Set this one's arguments up similarly
# Use xds_from_ms to produce datasets
# then call compute on the datasets or the dataset arrays
# that should invoke your profiling code
# Whose results you can inspect in _function_runs
table_keywords changes to class type 'tuple'. So I made a change to _put_keywords function to check for None. Added print statements to trace table_keywors (debugging)
The test code from |
OK, I can see that you've added a print function at the end of the test. I assume that this is what you're using to verify your results. Generally when one writes tests one should use assert statements on the output to verify correctness. Something like: from numpy.testing import assert_array_equal, assert_array_almost_equal
assert x == 1 # Standard python equality
assert_array_equal(y, z) # Test arrays are exactly equal
assert_array_almost_equal(y, z) # Test arrays are minimally different from each other
Hmmmm, it shouldn't. Is a tuple being passed into xds_from_ms or xds_from_table? xds_from_ms(..., table_keywords=('x', 'y')) for instance. |
Yes, I am using assert statements. |
Tests added / passed
If the pep8 tests fail, the quickest way to correct
this is to run
autopep8
and thenflake8
andpycodestyle
to fix the remaining issues.Fully documented, including
HISTORY.rst
for all changesand one of the
docs/*-api.rst
files for new APITo build the docs locally: