Conversation
daskms/table_proxy.py
Outdated
|
|
||
| wrapper.calls = 0 | ||
| wrapper.run_time = [] | ||
| return wrapper |
daskms/table_proxy.py
Outdated
|
|
||
| wrapper.calls = 0 | ||
| wrapper.run_time = [] | ||
| return wrapper |
| @@ -0,0 +1,227 @@ | |||
| # -*- coding: utf-8 -*- | |||
|
|
|||
| try: | |||
There was a problem hiding this comment.
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_runstable_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
autopep8and thenflake8andpycodestyleto fix the remaining issues.Fully documented, including
HISTORY.rstfor all changesand one of the
docs/*-api.rstfiles for new APITo build the docs locally: